var Slideshow = Class.create({
  initialize : function(container) {
      this.delay = 1000;
      this.start_frame = 0;
      this.frame = 0;

      this.lis = $(container).getElementsByTagName('li');
	
      this.lisAppear = this.lis[this.frame];

      for( i=0; i < this.lis.length; i++){
	if(i!=0){
	  this.lis[i].style.display = 'none';
	}
      }
      this.end_frame = this.lis.length -1;
	
      if (this.lis.length > 1)
	setInterval(this.fadeInOut(this), this.delay + 1850);
    },


  fadeInOut : function(that) {
      return (function() {
		Effect.Fade(that.lis[that.frame]);
		if (that.frame == that.end_frame) {
                    that.frame = that.start_frame; 
                } else { 
                    that.frame++; }
		var lisAppear = that.lis[that.frame];
		Effect.Appear(lisAppear);
	      })
	}
  });
