(function($){
// Script per la rotazione di pi� banner in un unico DIV, creato per Valeria
$.fn.bannerRotation = function(){
    return this.each(function() {
      var $this = $(this);
      var bannerCount = $this.find('a').length;
      var bannerIndex = 0;
      
      // se c'� pi� di un banner, devo creare una funzione in append al body che verr� richiamata da uno specifico setInterval.
      if(bannerCount > 1) {
      
        $this.find('a').hide(); // nascondo tutti i banner
        $this.find('a:eq(0)').show(); // visualizzo il primo
        
        setInterval(function(){
          $this.find('a:eq('+bannerIndex+')').hide();
          bannerIndex += 1;
          if(bannerIndex == bannerCount){ bannerIndex = 0; }
          $this.find('a:eq('+bannerIndex+')').show();
        },10000);
      }
    });
}
})(jQuery);
