// Adds a class 'js_on' to the <html> tag if JavaScript is enabled,
// also helps remove flickering...

document.documentElement.className += 'js_on';


// Add Cufon fonts fix IE 7
Cufon.set('fontFamily', 'Helvetica Neue LT Pro');
Cufon.replace('h1', { fontFamily: 'Helvetica Neue LT Pro' });
Cufon.replace('h2', { fontFamily: 'Helvetica Neue LT Pro' });
Cufon.replace('h3', { fontFamily: 'Helvetica Neue LT Pro' });

// Fade vari

 jQuery(function () {
			jQuery('#Fascione img,  #Banner img, #slider1 img, #Img_Dett img').hide();
			});
			var i = 0;
			var int=0;
jQuery(window).bind("load", function() {
				var int = setInterval("imgLoader(i)",300);
			});
			
function imgLoader() {
				var images = jQuery('#Fascione img, #Banner img,  #slider1 img, #Img_Dett img').length;
				if (i >= images) {
					clearInterval(int);
				//	jQuery('.loader  img').css('background', 'none');
			}
		jQuery('#Fascione img:hidden, #Banner img, #slider1 img:hidden, #Img_Dett img:hidden').eq(0).fadeIn(300)
			i++;
}



// animazione menu principale

// $(function(){
//	$('#menu a')
//		.css( {backgroundPosition: "0 0"} )
//		.mouseover(function(){
//			$(this).stop().animate({backgroundPosition:"(0 -250px)"}, {duration:300})
//		})
//		.mouseout(function(){
//			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:500})
//		})
//});

// animazione banner
$(function(){
	$('.fadein img:gt(0)').hide();
	setInterval(function(){$('.fadein :first-child').fadeOut().next('img').fadeIn().end().appendTo('.fadein');},6000);
});


// Animazione link

			$(document).ready(function() {
				$('#Contenuti_Home li a, #Sx li a, #Sx_Short li a, #Sx_Short_Dett li a, #Contenuti_Azienda li a, #Contenuti_Storia li a, #Contenuti_Dettaglio li a, #Contenuti_Spot li a, #Contenuti_Contatti a, #Descriz_Distrib a').hover(function() { 
				$(this).stop().animate({ marginLeft: '15px' },300); // on Mouseover move to left
				}, function() { //on Mouseout move back to original positon
				$(this).stop().animate({ marginLeft: '0px' }, 300);
			});
			
			});


