window.addEvent('domready', function(){
  var transition = 'alternate';
  $$('input[name=transition]').addEvent('click', function(){ transition = this.value; });
  var slideAvailable = ['slide-left', 'slide-right', 'slide-top', 'slide-bottom', 'fade'];
  var slideTransition = function(){
    switch(transition){
      case 'alternate':
        if(! $defined(this.count)) this.count = -1;
        return slideAvailable[++this.count % slideAvailable.length];
      case 'random': return slideAvailable.getRandom();
      default: return transition;
    }
  }
  
  $('option-auto').addEvent('click', function(){
    slideshow.options.auto = this.checked;
  });
// -----------------------------------------------------------------------------
// BIBCDC  
// PARAMETRI SLIDESHOW da mettere nell parentesi {}
// LINK di riferimento: 
// http://www.ajaxupdates.com/barackslideshow-tiny-lightweight-slideshow-script/
// Options
// * transition (defaults to .fade.) Can be .slide-left., .slide-right., .slide-top., .slide-bottom., .fade.
// * auto (defaults to false) Whether to move from image to image automatically
// * autostart (defaults to false) Whether to start slideshow automatically upon initialization
// * autointerval (defaults to 2000) Interval time from image to image in ms
// * tween (defaults to {duration: 700}) Options to pass to MooTools Fx.Tween, which takes care of image transitions.
// DEAFULT: var slideshow = new BarackSlideshow('menu', 'pictures', 'loading', { transition: slideTransition, auto: $('option-auto').checked });
  var slideshow = new BarackSlideshow('menu', 'pictures', 'loading', { transition: 'fade', auto: true, autointerval: 5000, autostart: true });
});
// -----------------------------------------------------------------------------

