/* JavaScript for Image Rotation */
/* Copyright (c) Ceri Williams 2005 */

var displayItems = new Array(1,2,3,4,5,6,7);
var prefix		 = new String("images/horsebox");
var fileType	 = new String(".jpg");
var currentItem  = 0;
var totalItems	 = displayItems.length;

rotate = function(){
	if(document.images && document.getElementById){
		var placeHolder = document.getElementById("horseBox");
		currentItem++;
		if(currentItem == totalItems){
			currentItem = 0;
		}
		placeHolder.src = prefix+displayItems[currentItem]+fileType;
		setTimeout("rotate()", 4 * 1000);
	}
}

window.onload = rotate;