      function Slideshow(idOfIndex, classOfElements){
        this.currentItem = 0;
        this.idOfIndex = idOfIndex;
        this.classOfElements = classOfElements;
        this.maxItems = $("#" + this.idOfIndex + " > li").length;
        this.slideInterval;
      }
      
      Slideshow.prototype.change = function(number) {
        this.currentItem = number;
        $('div.' + this.classOfElements).fadeOut();
        $('ul.' + this.idOfIndex + ' > li').removeAttr('class');
        $('div.' + this.classOfElements + ':eq(' + number + ')').fadeIn();
        $('ul.' + this.idOfIndex + ' li:eq(' + number + ')').attr("class", "selected"); 
      }
      
      Slideshow.prototype.play = function(interval) {
        var myself = this;
        this.slideInterval = window.setInterval(
          function() {
            myself.currentItem = (myself.currentItem + 1) % myself.maxItems; 
    	      myself.change(myself.currentItem);
          },interval
        );
      }
      
      Slideshow.prototype.stop = function() {
        window.clearInterval(this.slideInterval);
      }

