var interval = 1.5; // delay between rotating images (in seconds)
var height, width;	//global variables for thumbnail size
interval *= 1100;
var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/Domkirche-Dresden119x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/John-Ulrick67x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/Engine-Detail133x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/Heroes-Square211x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/Langdale-Light148x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/S-Bend135x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/Prom-At-Brid178x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/The-Working-Man133x100.jpg");
image_list[image_index++] = new imageItem("../photographs/TonyMitchell2010/Violin-Player126x100.jpg");

var number_of_image = image_list.length;
function imageItem(image_location) {	//get source of next image
this.image_item = new Image();
this.image_item.src = image_location;
}

function get_ImageItemLocation(imageObj) {	//get next image and height and width
height = (imageObj.image_item.height);
width =  (imageObj.image_item.width);
if (width > 200)
	{width = 200}; 				//set max width to 200px
return (imageObj.image_item.src);
}

function getNextImage() {
image_index = (image_index + 1) % number_of_image;	//update image_index (image index = from 1 to last image)
var new_image = get_ImageItemLocation(image_list[image_index]);
return (new_image);
}

function rotateImage(cycle) {
var new_image = getNextImage();
document.getElementById("cycle").src = new_image;
document.getElementById("cycle").width = width; //set width on page
document.getElementById("cycle").height = height; //set height on page

var recur_call = "rotateImage ('"+cycle+"')";
setTimeout(recur_call, interval);
}
//  End -->




