var currentTestimonial = 0;
var testimonials = Array();
var timer = null;
window.onload = function() {
	var divs = document.getElementById('testimonials').getElementsByTagName('div');
	
	if(divs.length > 0)
	{
		var k=0;
		for(var i=0; i<divs.length; i++)
		{
			if(divs[i].className == 'testimonial')
			{
				testimonials[k] = divs[i];
				k++;
			}
		}
		
		testimonials[currentTestimonial].style.display = 'block';
		timer = setInterval('nextTestimonial()',5000);
	}
}

function nextTestimonial()
{
	testimonials[currentTestimonial].style.display = 'none';
	if(testimonials[(currentTestimonial+1)] != null)
	{
		currentTestimonial++;
	}
	else
	{
		currentTestimonial = 0;
	}
	testimonials[currentTestimonial].style.display = 'block';
}


