/*var imgLength = MyImages.length - 1;
imagesPreloaded = new Array(imgLength)

for (var i = 0; i < MyImages.length ; i++)
{
	imagesPreloaded[i] = new Image(120,120)
	imagesPreloaded[i].src=MyImages[i]
}*/

function Nexter(){
	if (currentIndx<imagesPreloaded.length-1){	
	//the length of our array is 4. But the images go from 0 to 3, so we take one off the count. (We made currentIndx equal 0 right at the beginning of our script!)	
	currentIndx=currentIndx+1;	
	// To go forward, we add one, providing the number is less than the number of images	
	document.theImage.src=imagesPreloaded[currentIndx].src	
	//The NAME of the image in our slide show is theImage. We can change the image loaded here as above 
	document.form1.text1.value=Messages[currentIndx];	
	//The NAME of the form is 'form1', and the name of the text area is 'text1'. We make its value (content) equal the text in the array 'Messages'. So if currentIndx is 0, the text will be 'We learn about our world through the 5 senses' and so on
}
	else {	
		currentIndx=0	
		// Otherwise, we go back to the beginning, if currentIndx is too big	
		document.theImage.src=imagesPreloaded[currentIndx].src		
		//document.form1.text1.value=Messages[currentIndx];
		document.getElementById(CaptionBox).value=Messages[currentIndx];
		}
}

//The function Baccker() is similar to the previous function, so it contains no comments 
function Backer(){

	if (currentIndx>0){	
		currentIndx=currentIndx-1;		
		document.theImage.src=imagesPreloaded[currentIndx].src		
		document.getElementById(CaptionBox).value=Messages[currentIndx];
	}
else {
	currentIndx=imgLength;	
	document.theImage.src=imagesPreloaded[currentIndx].src	
	document.getElementById(CaptionBox).value=Messages[currentIndx];
	}
}