var mooSimpleSlide = new Class({
  Implements: Options,
  options: {
    period: 0
  },
  initialize: function(imageArray,options) {
    if($type(imageArray) != 'array') return;
    
    this.images = imageArray;
    this.setOptions(options);
    this.active = 0;
    this.max = this.images.length;
    
    this.images.each(function(img) {
      img.setStyles({
        'display': 'none',
        'position':'absolute'
      }).fade('hide');
    });
    
    if(this.options.period > 0) this.displayImage.periodical(this.options.period,this);
  },

  displayImage: function() {
    var FxTransitionTime = this.options.period/5;
    
    this.images[this.active].get('tween',{property:'opacity', duration:FxTransitionTime, onComplete:function(item) {
      item.setStyle('display','none');
    }}).start(1,0);
    
    this.active < this.max-1 ? this.active++ : this.active = 0;
    this.images[this.active].get('tween',{property:'opacity', duration:FxTransitionTime, onStart:function(item) {
    	item.setStyle('display','inline');
    }}).start(0,1);
  }
});

