function Slideshow(slideshow, timeout) {
  this.slides = [];
  var isFirst = true;
  
  var nl = $(slideshow).select('.slide');
  
  for (var i = 0; i < nl.length; i++) {
      if(isFirst){
        nl[i].show();
        isFirst = false;
      }
      this.slides.push(nl[i]);
  }
  
  this.timeout = timeout;
  this.current = 0;

  for (var i = 0; i < this.slides.length; i++) {
    this.slides[i].style.zIndex = this.slides.length - i;
  }

  Element.show(slideshow);
  if(this.slides.length > 1) {
    setTimeout((function(){this.next();}).bind(this), this.timeout + 850);
  }
}
Slideshow.prototype = {
  next: function() {
    for (var i = 0; i < this.slides.length; i++) {
      var slide = this.slides[(this.current + i) % this.slides.length];
      slide.style.zIndex = this.slides.length - i;
    }
    
    var previous = this.slides[this.current];
    
    this.current = (this.current + 1) % this.slides.length;

    Effect.Fade(previous);
    
    Effect.Appear(this.slides[this.current]);
    
    setTimeout((function(){this.next();}).bind(this), this.timeout + 850);
  }
}