// i vari messaggi di testo sono configurati per la traduzione nel file traduzioni.php 
function init(){
		var box = {};
		if(document.getElementById("show")) 
		{
			window.demo=new demo()
			if($$('.mb').length > 0)//only triggered if 'mb' class found on page
			{
				var box = new multiBox('mb', {
					descClassName: 'multiBoxDesc',
					useOverlay: false
				});
			};
		} else
			box = new MultiBox('mb', {descClassName: 'multiBoxDesc', useOverlay: false});

}


window.addEvent('domready', init);
	var demo = new Class({
	    initialize: function(){
	      this.el = $('show');
	      // We attach our event listener to each of the demos.
  		  $$('#demos li').each(function(li, i){
  		    li.set('events', {'click': this.start.pass(i + 1, this)});
  		  }, this)
  		  // Start our default demo.
	      this.start();
	    },
	    
	    start: function(p){
        var data = {};
        if (this.show)
        this.show.destroy('empty');
		this.show = new Slideshow.KenBurns(this.el, null, { captions: true, controller: true, delay: 10000, duration: 1000, height: 500, hu: 'images/', thumbnails: true, width: 880, 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));	   
  	    
		
		
  	    // This last little bit just inserts our thumbnails "fuzzy edge" overlays.
  	    if (this.show.options.thumbnails){
   	      ['a', 'b'].each(function(p){ 
    			  new Element('div', { 'class': 'overlay ' + p }).inject(this.show.slideshow.retrieve('thumbnails'));
          }, this);
  	    }
	    }
	  })		



