// extern eingebunden js file
Home = Class.create({
	initialize: function() {
		this.currentPage = 0;
		this.counter = 0;
		this.buildInterface();
		this.index = 2;
		this.appearDuration = 3;
		this.timeoutCounterOrgValue = 2 + this.appearDuration;
		this.timeoutCounter = this.timeoutCounterOrgValue;		
	},
  
  
	buildInterface: function() {
		var minus = 1;
		var interval = 1;
		var self = this;
		new PeriodicalExecuter(function ( pe ) {
			self.timeoutCounter -= minus;
			if(self.timeoutCounter <= 0){
				self.hideImage(self.index);
				self.index++;
				if(self.index > $$('.image').length)
					self.index = 1;
				self.showImage(self.index);
               			self.timeoutCounter = self.timeoutCounterOrgValue;
			}
		}, interval);
	},
	
  	hideImage: function(index) {
		$('image'+index).fade({duration: this.appearDuration});
	},
	
	showImage: function(index) {
		$('image'+index).appear({duration: this.appearDuration});
	}
});






// auf der jew. seite
/*
document.observe('dom:loaded', function() {
  blubb = new Bla('element_id', [{ name: 'lala', element_id: 'blabla', infoText: 'fjshjdf hjsdf ' }]);
})
*/

