var Fader = new Class({
	Implements: [Events],
	
	initialize: function(wrapper){
		this.wrapper = wrapper;
		
		this.fade.periodical(4000, this);
	},
	
	fade: function(){
		var elementOut = this.wrapper.getChildren('div')[0];
		var elementIn = this.wrapper.getChildren('div')[1];
		var fadeOut = new Fx.Morph(elementOut,  {
			onComplete: function(){
				elementOut.destroy();
			}.bind(this)
		});
		var fadeIn = new Fx.Morph(elementIn);
		
		cloneEl = elementOut.clone().inject(this.wrapper).setStyles({'display' : 'none'});
		
		fadeOut.start({'opacity' : 0}).chain(function(){
			
			fadeIn.set({'opacity' : 0, 'display' : 'block'}).start({'opacity' : 1});
		}.bind(this));
	}
});

