
/*
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("root-nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
*/

/*
$(function() {


});*/


var $j = jQuery.noConflict();

function carosello(){

	pages = 0;
	
	while(pages<4) {
	$('#logos-wrapper').delay(5500).animate({'margin-left':'-=462px'}, 300, 'swing');
	pages++;
	}
	
	$('#logos-wrapper').delay(5500).animate({'margin-left':'0px'}, 300, 'swing');
	
}

/*******************SLIDESHOW HOMEPAGE******************/
	
	function slideSwitch() {
  	  var $active = $('#slideshow IMG.active');

   	 if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

   	 var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

   	 $active.addClass('last-active');

    	$next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
	}

	$(function() {
	    setInterval( "slideSwitch()", 3500 );
	});	
	/*******************************************************/


$j(document).ready(function() {
	
	//Aggiunge la classe first-item al primo li del menu nel footer	
	$j('.list-pages ul li:first-child').addClass('first-item');
	
	//chiamo la funzione carosello in un ciclo while che fa ripetere lo scorrimento 200 volte
	var cont=0;
	do{
	carosello();
	cont++;
	}
	while(cont<200);
	
	
	
	
	
	
	

})
