var SimpleFader = new Class({
	initialize: function(imagesWrapper){
	    
	    this.ImageWrappers = $$("." + imagesWrapper + " img");
	    this.ImageWrappers[0].set("opacity", 1);

	    if (this.ImageWrappers.length == 1)
	      return;

	    this.Els = []; 
	    this.alt = [];
	    this.title = [];
	    $$("." + imagesWrapper + " img").each( function(item) {
		    this.Els.include( new Fx.Morph(item, { duration: 2000, transitions: Fx.Transitions.Sine.easeOut, link: 'cancel' }) );
		    this.alt.include( item.getProperty('alt') );
		    this.title.include( item.getProperty('title') );
	      }.bind(this));
 
	    this.currentEl = this.Els[0];
	    this.current = 0;

	    this.ImageWrappers[this.ImageWrappers.length - 1].setProperty('alt', this.alt[this.current]);
	    this.ImageWrappers[this.ImageWrappers.length - 1].setProperty('title', this.title[this.current]);

	    this.Fade.periodical(5000, this);
	},
 
	Fade: function(){
	    this.currentEl.start({"opacity" : [1, 0]});
 	    (this.current != this.Els.length - 1) ? this.current++ : this.current = 0;
	    this.Els[this.current].start({"opacity" : [0, 1]});

	    this.ImageWrappers[this.ImageWrappers.length - 1].setProperty('alt', this.alt[this.current]);
	    this.ImageWrappers[this.ImageWrappers.length - 1].setProperty('title', this.title[this.current]);

	    this.currentEl = this.Els[this.current];             
	}
    }); 
