// testimonials fade in/out quick fix code

var Testimonials = [
	['<p><i>"Since day one dante have provided our centre with the depth of knowledge and skills required to tackle a site of this magnitude."</i><br><br><font color=#560000>Paul Deasy - Fire Safety Manager Manchester Arndale Centre</font></p>'],
	['<p><i>"The service and attention to detail from dante is second to none."</i><br><br><font color=#560000>Dave Arrowsmith - GSH Group</font></p>'],
	['<p><i>"We continue to choose Dante Fire and Security to maintain our Fire Alarm and Security Systems due to the efficient and reliable service we have recieved."</i><br><br><font color=#560000>Bill Thomas - Queen Elizabeth Sixth Form College, Darlington</font></p>'],
	['<p><i>"I have found Dante Fire and Security to be one of the most professional companies I have worked with, offering an unparalleled attention to detail and quality."</i><br><br><font color=#560000>James Lovelady - L.J.Lovelady Ltd.</font></p>'] // Note: no comma after last entry
	];
	
var fileInx = 0;
var fadeCnt = 0;
var fadeInc = Testimonials.length-1;

function dispTestimonial () {
  document.getElementById("testimonials").innerHTML = Testimonials[fileInx]; // +'<p>'+fadeCnt;
  document.getElementById('testimonials').style.opacity = (fadeCnt/100).toFixed(2);
  document.getElementById('testimonials').style.filter = 'alpha(opacity=' + fadeCnt + ')';
  fadeCnt += fadeInc;
  if (fadeCnt >= 400) { fadeInc *= -1; }
  if (fadeCnt <= 0) {
	fadeInc *= -1;   
    fileInx = Math.floor(Math.random()*Testimonials.length);
      
  }
}

window.onload = function () {
  fileInx = Math.floor(Math.random()*Testimonials.length);
  dispTestimonial()
  setInterval("dispTestimonial()", 100);
}