	var interval = 2.0; // delay between rotating images (in seconds)
	var random_display = 1; // 0 = no, 1 = yes
	interval *= 1000;

	var image_index = 0;
	image_list = new Array();
	image_list[image_index++] = new imageItem("./graphics/rotatingimages/01.gif");
	image_list[image_index++] = new imageItem("./graphics/rotatingimages/02.gif");
	image_list[image_index++] = new imageItem("./graphics/rotatingimages/03.gif");
	image_list[image_index++] = new imageItem("./graphics/rotatingimages/04.gif");

	var url_index = 0;
	url_list = new Array();
	url_list[url_index++] = new urlItem("./gallery/bcc1291.html");
	url_list[url_index++] = new urlItem("./gallery/eep1081.html");
	url_list[url_index++] = new urlItem("./gallery/gaj1181.html");
	url_list[url_index++] = new urlItem("./gallery/iar1041.html");

	var number_of_image = image_list.length;

	function imageItem(image_location) {
		this.location = image_location;
	}

	function urlItem(url_location) {
		this.location = url_location;
	}

	function get_ImageItemLocation(imageObj) {
		return(imageObj.location);
	}

	function get_UrlItemLocation(urlObj) {
			return(urlObj.location);
	}

	function generate(x, y) {
		var range = y - x + 1;
		return Math.floor(Math.random() * range) + x;
	}

	function getNextIndex() {
		if (random_display) {
			image_index = generate(0, number_of_image-1);
		}
		else {
			image_index = (image_index+1) % number_of_image;
		}
		return(image_index);
	}

	function rotateImage(placeHolder1, placeHolder2) {
		var new_image_index = getNextIndex();
		var new_image_location = get_ImageItemLocation(image_list[new_image_index]);
		var new_url_location = get_UrlItemLocation(url_list[new_image_index]);

		document.getElementById(placeHolder1).src = new_image_location;
		document.getElementById(placeHolder2).href = new_url_location;

		var recur_call = "rotateImage('" + placeHolder1 + "', '" + placeHolder2 + "')";
		setTimeout(recur_call, interval);
	}