//version 1.1 for Inn at Bay Harbor Andy Mascaro July 2007
//removed mckinley specific functions
//added imageList changing ability

var totalImageList = new Array();

var Photos = {
	list: new Array(),
	id: "",
	obj: new Object(),
	currentIndex: 0,
	showNext: function(reverse) {
		if (reverse) {
			this.currentIndex--;
			if (this.currentIndex<0) this.currentIndex = this.list.length-1;
		}
		else {
			this.currentIndex++;
			if (this.currentIndex>(this.list.length-1)) this.currentIndex = 0;
		}
		this.obj.src = this.list[this.currentIndex]["image"];
		//alert(this.obj.src);
		this.displayObj.firstChild.nodeValue = this.list[this.currentIndex]["room"];
	},
	
	showPrevious: function() {this.showNext(true);},
	
	initiate: function(id, displayId, imageList) {
		this.id = id;
		this.displayObj = document.getElementById(displayId);
		this.obj = document.getElementById(id);
		this.list = imageList;
		//for (i in imageList) preloadImages(imageList[i]["image"]);
		this.currentIndex = -1;
		this.showNext();
	},
	
	setImageList: function(imageListIndex) {
		//this.list = imageList;
		//for (i in imageList) preloadImages(imageList[i]);
		this.currentIndex = imageListIndex;
		this.showNext();
	}
}