// JavaScript Document
	  var demo = new Class({
	    initialize: function(){
	      this.el = $('show');
	     
  		  $$('#demos li').each(function(li, i){
  		    li.set('events', {'click': this.start.pass(i + 1, this)});
  		  }, this)
  		  
	      this.start();
	    },
	    
	    start: function(p){
        var data = {};
        
        if (this.show)
          this.show.destroy('empty');
 	      switch(p){
	        case 1: 
	          [
	            
	          ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
    			  this.show = new Slideshow(this.el, data, { captions: true, classes: ['', '', '', '', '', '', '', 'alternate-images'], controller: true, duration: 1250, height: 400, hu: 'images/', overlap: false, thumbnails: true, transition: 'back:in:out', width: 500});
    			  break;
    			  
    			case 2:
          [
            
          ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
  			  this.show = new Slideshow.KenBurns(this.el, data, { captions: true, controller: true, delay: 5000, duration: 2000, height: 400, hu: 'images/', thumbnails: true, width: 500, zoom: 50 });
  			  break;
    			
    			case 3: 
          [
            
          ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
  			  this.show = new Slideshow(this.el, data, { captions: true, classes: ['', '', '', '', '', '', '', '', '', '', 'alternate-thumbnails'], controller: true, duration: 1250, height: 400, hu: 'images/', random: true, thumbnails: true, transition: 'back:out', width: 500, zoom: 25 });
  			  break;
	          
    			case 4:
          [
            
          ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
  			  this.show = new Slideshow.Push(this.el, data, { captions: true, controller: true, delay: 2500, duration: 2000, height: 400, hu: 'images/', transition: 'elastic:out', width: 500, zoom: 25 });
  			  break;
	          
    			case 5:
          [
            
          ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
    			this.show = new Slideshow(this.el, data, { captions: true, classes: ['', '', '', '', '', '', '', '', '', 'alternate-controller'], controller: {transition: 'back:in:out'}, duration: 1000, height: 400, hu: 'images/', linked: true, thumbnails: true, width: 940 });
    			this.show.slideshow.retrieve('images').getElements('a').set('rel', 'lightbox');
    			var box = new Lightbox({ 
    			  'onClose': function(){ this.pause(false); }.bind(this.show), 
    			  'onOpen': function(){ this.pause(true); }.bind(this.show) 
    			});
    			box.image.addEvent('click', function(){ this.close(); }.bind(box));	        
  			  break;

    			case 6:
          [
            
           ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
    			this.show = new Slideshow.Flash(this.el, data, { captions: true, color: ['#EC2415', '#7EBBFF'], controller: true, delay: 3000, duration: 3000, height: 400, hu: 'images/', width: 940 });
   			  break;

      			case 7:
            [
              
            ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
      			this.show = new Slideshow.KenBurns(this.el, data, { captions: true, controller: true, delay: 4000, duration: 1000, height: 400, hu: 'images/', linked: true, thumbnails: true, width: 940, zoom: 0 });
      			this.show.slideshow.retrieve('images').getElements('a').set('rel', 'lightbox');
      			var box = new Lightbox({ 
      			  'onClose': function(){ this.pause(false); }.bind(this.show), 
      			  'onOpen': function(){ this.pause(true); }.bind(this.show) 
      			});
      			box.image.addEvent('click', function(){ this.close(); }.bind(box));	        
    			  break;

      			case 8:
            [
              
             ].each(function(str, i){ this[(i + 1) + '.jpg'] = { 'caption': str }; }, data);    			  
      			this.show = new Slideshow.Fold(this.el, data, { captions: true, center: false, controller: true, duration: 1000, height: 400, hu: 'images/', transition: 'bounce:out', width: 940 });
     			  break;

	        default:
	         
      			this.show = new Slideshow.KenBurns(this.el, null, { captions: true, controller: true, delay: 4000, duration: 1000, height: 400, hu: 'images/', thumbnails: true, width: 940, zoom: 0 });
  	      }
  	      
  	    if (this.show.options.thumbnails){
   	      ['a', 'b'].each(function(p){ 
    			  new Element('div', { 'class': 'overlay ' + p }).inject(this.show.slideshow.retrieve('thumbnails'));
          }, this);
  	    }
	    }
	  })
