Testimonials_divCount = 2; // ein Testimonials besteht aus * div-Tags auf oberster Ebene
Testimonials_timeout  = 20; // jedes Testimonial für * Sekunden zeigen

Testimonials_lastShown = 0;

function Testimonials ()
{
	Testimonials_lastShown = Math.ceil(Math.random() * Testimonials_count()) - 1;
	Testimonials_showNext();
}

function Testimonials_showNext ()
{
	if (Testimonials_lastShown >= Testimonials_count()) {
		Testimonials_show(1);
	} else {
		Testimonials_show(Testimonials_lastShown + 1);
	}
	
	setTimeout("Testimonials_showNext()", Testimonials_timeout * 1000);
}

function Testimonials_show (tm_number)
{
	Testimonials_lastShown = tm_number;
	
	var root = document.getElementById('ContentLeft').getElementsByTagName('div')[0];
	var div_counter = 0;
	
	for (var i = 0; i < root.childNodes.length; i++)
	{
		if (root.childNodes[i].nodeName.toLowerCase() != 'div') continue;
		div_counter += (1 / Testimonials_divCount);
		
		if (Math.ceil(div_counter) == tm_number) {
			root.childNodes[i].style.display = 'block';
		} else {
			root.childNodes[i].style.display = 'none';
		}
	}
}

function Testimonials_count ()
{
	var root = document.getElementById('ContentLeft').getElementsByTagName('div')[0];
	var div_counter = 0;
	
	for (var i = 0; i < root.childNodes.length; i++)
	{
		if (root.childNodes[i].nodeName.toLowerCase() != 'div') continue;
		div_counter++;
	}
	
	return Math.floor(div_counter / Testimonials_divCount);
}
