currentIndx=0;
MyImages=new Array();
MyImages[0]='images/testimonial-1.jpg';
MyImages[1]='images/testimonial-2.jpg';
MyImages[2]='images/testimonial-3.jpg';
MyImages[3]='images/testimonial-4.jpg';
MyImages[4]='images/testimonial-5.jpg';
MyImages[5]='images/testimonial-6.jpg';
MyImages[6]='images/testimonial-7.jpg';
MyImages[7]='images/testimonial-8.jpg';
MyImages[8]='images/testimonial-9.jpg';
MyImages[9]='images/testimonial-10.jpg';
MyImages[10]='images/testimonial-11.jpg';

imagesPreloaded = new Array(11);
for (var i = 0; i < MyImages.length ; i++)
{
	imagesPreloaded[i] = new Image(517,274);
	imagesPreloaded[i].src=MyImages[i];
}

/* Forward Function */
function Nexter(){
	if(currentIndx < imagesPreloaded.length-1)
	{
		currentIndx=currentIndx+1;
		document.theImage.src=imagesPreloaded[currentIndx].src;
	}
	else {
	 	currentIndx=0;
		document.theImage.src=imagesPreloaded[currentIndx].src;
	}
}

/* Backward Function */
function Backer(){
	if (currentIndx>0){
		currentIndx=currentIndx-1;
		document.theImage.src=imagesPreloaded[currentIndx].src;
	}
	else {
		currentIndx=10;
		document.theImage.src=imagesPreloaded[currentIndx].src;
	}
}



/* Automatic Image rotation */
function automaticly() {
	if (currentIndx<imagesPreloaded.length){
		currentIndx=currentIndx;
	}
	else {
		currentIndx=0;
	}
	document.theImage.src=imagesPreloaded[currentIndx].src;
	currentIndx=currentIndx+1;
	var delay = setTimeout("automaticly()",15000);
}


/*###### function to reload the images and text when refresh is pressed ##### */
function setCurrentIndex()
{
	currentIndx=0;
	document.theImage.src=MyImages[0];
}