var SimpleSlideShow = new Class({
  
  Implements: Options,
  
  options: {
    fadeTime: 1000,
    stayTime: 3000
  },
  
  initialize: function(wrapper, images, options) {
    this.setOptions(options);
    this.wrapper = $(wrapper);
    this.images = images.map(function(image){
      return new Element('img', {
        src: image, width: '250px', height: '250px',
        tween: {duration: this.options.fadeTime}
      });
    }, this);
    this.index = 0;
    this.topImage = this.images[0].inject(this.wrapper);
    this.fade.periodical(this.options.stayTime + this.options.fadeTime, this);
  },
  
  fade: function() {
    this.index = (this.index + 1) % this.images.length;
    this.bottomImage = this.topImage;
    this.topImage = this.images[this.index]
      .fade('hide')
      .inject(this.wrapper)
      .fade('in');
  }
  
});
    
