
var imageIndex = 0;
var imageLength = eval(tourScript + "_imageFile").length-1;
var imageFile;
var flagOne = 0;

function displayImages() {
	if (document.images) {
		imageFile = eval(tourScript + "_imageFile[imageIndex]");
		flagOne = 1;    
		document.nowshowing.src = imageFile;
		/* This is the Netscape work-around:
		un-comment this line and remove the onLoad from
		the nowshowing image. */
		//displayTitle()
	}
}

function displayTitle()  {
	if (document.images) {
		if (flagOne == 1) {
			document.displaycomments.comments.value = eval(tourScript + "_imageComments")[imageIndex];
		}
	}
}

function turnLeft()  {
	imageIndex--;
	if (imageIndex < 0)  { imageIndex = imageLength };
	displayImages();
}

function turnRight()  {
	//alert(imageIndex);
	imageIndex++;
	if (imageIndex > imageLength)  { imageIndex = 0 };
	displayImages();
}