DivFadder = new Class({
	Implements: [Chain, Events, Options],
	
	options: {
		divClass: 'highlight'
	},


	initialize: function(options){
		this.divs = $$('.'+this.options.divClass);
		this.divs.each(function(el) {
			el.fade('hide');
			el.set('tween', {duration: 'long'});
		});
		this.activeDiv = this.divs[0];
		this.activeDiv.fade('show');
		this.start();
	},
	
	start : function() {
		this.next.periodical(8000, this);
	},
	
	next : function() {
		divOut = this.activeDiv;
		if ((index = this.divs.indexOf(this.activeDiv)) == this.divs.length - 1) {
			this.activeDiv = this.divs[0];
		}
		else this.activeDiv = this.divs[index+1];
		divIn = this.activeDiv;
	
		divOut.fade('out');
		divIn.fade('in');
	}
});
