var exhibitionist_vi_slideshowController = function(){
	this.currentItem = -1;
	this.changeTime = 3000;
	this.init = function(object,itemDiv,settingArray){
		this.object = object;
		this.itemDiv = itemDiv;
		this.slideshowTimer = parseInt(settingArray['slideshowTimer']);
		if (this.slideshowTimer < 1){
			this.slideshowTimer = 4000;
			alert("Slide Duration set too low. Resetting to 4000.");
		}
		this.changeTime = this.slideshowTimer;
	};
	this.start = function(){
		setTimeout(function(object){
			return function(){
				object.gotoNextItem();
			}
		}(this),this.changeTime);
	};
	this.gotoNextItem = function(){
		setTimeout(function(object){
			return function(){
				object.gotoNextItem();
			}
		}(this),this.changeTime);
		
		if(this.object.threadsBusy == 0){
			this.currentItem++;
			if (this.currentItem >= this.object.thumbnailItems.length){
				this.currentItem = 0;
			}
			this.object.changeToItem(this.currentItem);
		}
	}
	this.changeToItem = function(item){
		this.currentItem = item;
	}
}