var comments = new Array(
	'"Dr. Benson and his staff were amazing, second only to the results of my SmartLipo procedure at QnA." - Janice T.', 
	'"Dr. Benson recently diagnosed a rare skin cancer that had previously been misdiagnosed by three other doctors."'
);
var current = 0;
var element = document.getElementById('Testimonials');
var text    = document.getElementById('TestimonialsTxt');

/* cross browser method to set opacity */
function setOpacity(level) {
	element.style.opacity = level;
	element.style.MozOpacity = level;
	element.style.KhtmlOpacity = level;
	element.style.filter = "alpha(opacity=" + (level * 100) + ");";
}

/* rotate and create timers to fade the testimonial in */
function fadeIn(){
	text.innerHTML = comments[current];
	current = (current + 1) % comments.length;
	for (i = 0; i <= 1.05; i = i + 0.05) {
		setTimeout("setOpacity(" + i + ")", i * 1000);
	}
	setTimeout(function(){element.style.filter = "none";},i * 1000);
	setTimeout("fadeOut()", 9000);
}

/* create timers to fade the testimonial away */
function fadeOut() {
	for (i = 0; i <= 1; i = i + 0.05) {
		setTimeout("setOpacity(" + (1 - i) + ")", i * 1000);
	}
	setTimeout("fadeIn()", 1000);
}

fadeIn(); 