var Automatic = {
	counter : 0,
	tmout : "",
	
	play : function(){
		Config.renderImage(this.counter);
		Config.setCurrentImagePos(this.counter);
		this.start();
	},
	
	start: function(){
		this.counter++;
		if(this.counter > Config.getImageMaxLength() - 1 ){
			this.counter = 0;
		}
		this.tmout = setTimeout("Automatic.play()",Config.interval * 1000);
	},
	
	stop: function(){
		clearTimeout(this.tmout);
	}
	
}