/* 
******** TESTIMONIAL ********
*/

function testimonialrotate()
{ 
	try
	{
		var name = rotateTestimonialsList[rotateTestimonialsNumber];

		rotateTestimonialsNumber += 1;
		if(rotateTestimonialsNumber>=rotateTestimonialsList.length)
			rotateTestimonialsNumber = 0;

		for(var i=0; i<rotateTestimonialsList.length; i++)
		{
			name = rotateTestimonialsList[i];
			document.getElementById(name).style.display = "none";
			name = "large_" + rotateTestimonialsList[i];
			document.getElementById(name).style.display = "none";		
		}

		name = rotateTestimonialsList[rotateTestimonialsNumber];
		document.getElementById(name).style.display = "inline";  
	  
		if(rotateTestimonialsShowlarge)
		{
			name = "large_" + rotateTestimonialsList[rotateTestimonialsNumber];
			document.getElementById(name).style.display = "block";
		}
	  
		setTimeout("testimonialrotate()", rotateTestimonialsMilliSeconds);
	}
	catch(ex){}
}


function testimonialshowlargeimage(doShow)
{
	try
	{
		rotateTestimonialsShowlarge = doShow;
		var name = "large_" + rotateTestimonialsList[rotateTestimonialsNumber];

		if(rotateTestimonialsShowlarge)
		{
			document.getElementById(name).style.display = "block";
		}
		else
		{
			document.getElementById(name).style.display = "none";
		}
	}
	catch(ex){}		
}

/*
******** TESTIMONIAL 2 *********
*/

//*** Weisse Überblendung an/aus ***
function testimonial2activatesmallimage(imageNumber, activate)
{
    var name = "testimonial2-thumbnaildiv" + imageNumber;
	if(activate)
		document.getElementById(name).className = "testimonial2active";
	else
		document.getElementById(name).className = "testimonial2inactive";
}

//*** Andere kleine Testimonials sollen angezeigt werden ***
function testimonial2scroll(listCount, backwards)
{
	var name;
	var imagepath;
	var j;
	for(var i=0; i<listCount; i++)
	{
		name = "testimonial2-thumbnail" + i;
		if(backwards)//*** links geklickt ***
		{
			j = i - 1 + imageNumberAdd;
			if(j < 0)
			{
				j = j + imagelistSmall.length;
			}
			if(j >= imagelistSmall.length)
			{
				j = j - imagelistSmall.length;
			}			
			
			imagepath = imagelistSmall[j].src;
		}
		else//*** rechts geklickt ***
		{
			j = i + 1 + imageNumberAdd;
			if(j>=imagelistSmall.length)
			{
				j = j - imagelistSmall.length;
			}
			imagepath = imagelistSmall[j].src;
		}

		//alert(name + " : " + imagepath);

		document.getElementById(name).src = imagepath;
	}

	if(backwards)//*** links geklickt ***
	{
		imageNumberAdd--;
		if(imageNumberAdd<0)
			imageNumberAdd = imagelistSmall.length-1;
	}
	else//*** rechts geklickt ***
	{
		imageNumberAdd++;
		if(imageNumberAdd>=imagelistSmall.length)
			imageNumberAdd = 0;
	}
}

//*** Das große Testimonial Bild soll angezeigt werden ***
function testimonial2showimage(imageID, imageNumber)
{
	var j = imageNumber + imageNumberAdd;
	if(j >= imagelistSmall.length)
	 j = j - imagelistSmall.length;
	
	//alert(divName + " : " + imageNumber + " - " + j + " - " + imageNumberAdd)
	
	var imagepath = imagelistLarge[j].src;

	var image = document.getElementById(imageID);
	if (image != null)
	{
	    image.src = imagepath;
	    image.style.display = "block";
	}
}