function SlideShow(frame, slides) {
  this.marker = 0;
  this.num_photos = slides.length;
  this.element = 'li';

  this.setup = function(){
    test = slides[this.marker];
    frame.append('<' + this.element + ' id="photo_' + this.marker + '" class="current"><img src="http://farm' + test['farm'] + '.static.flickr.com/' + test['server'] + '/' + test['id'] + '_' + test['secret'] + '.jpg" /><p>' + test['title'] + '</p></' + this.element + '>');
    this.marker++;
    test = slides[this.marker];
    frame.append('<' + this.element + ' id="photo_' + this.marker + '" class="hidden"><img src="http://farm' + test['farm'] + '.static.flickr.com/' + test['server'] + '/' + test['id'] + '_' + test['secret'] + '.jpg" /><p>' + test['title'] + '</p></' + this.element + '>')
  }

  this.next = function(){
    this.marker++; if(this.marker > this.num_photos - 1) this.marker = 0;
    test = slides[this.marker];
    next = $('.hidden');
    next.show();
    $('.current').fadeOut(800, function(){
      $(this).remove();
      next.addClass('current').removeClass('hidden');
    });
    frame.append('<' + this.element + ' id="photo_' + this.marker + '" class="hidden"><img src="http://farm' + test['farm'] + '.static.flickr.com/' + test['server'] + '/' + test['id'] + '_' + test['secret'] + '.jpg" /><p>' + test['title'] + '</p></' + this.element + '>')
  }
};
