$(document).ready(function(){
						   
	$('#slider').nivoSlider({
        effect:'random', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:3000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:false, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        controlNavThumbs:false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav:false, // Use left & right arrows
        pauseOnHover:true, // Stop animation while hovering
        manualAdvance:false, // Force manual transitions
        captionOpacity:1, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
	
	
	//jQuery('.first-and-second-carousel').jcarousel({start: 4});
	
	
	/*
	$(".elem_cantiere","#vista_due").hover(
	  function () {
		$('.dett_elem_cantiere',this).animate({marginTop: '75px'}, 300, function() {});
		$('.dett_elem_cantiere',this).animate({ backgroundColor: "#592826" }, 300);
	  }, 
	  function () {
		$('.dett_elem_cantiere',this).animate({marginTop: '106px'}, 300, function() {});
		$('.dett_elem_cantiere',this).animate({ backgroundColor: "#2B1413" }, 300);
	  }
	);
	*/
	
	/*
	var config = {    
     over: makeTall, // function = onMouseOver callback (REQUIRED)    
     timeout: 500, // number = milliseconds delay before onMouseOut    
     out: makeShort // function = onMouseOut callback (REQUIRED)    
	};
	
	function makeTall(){
		$('.dett_elem_cantiere',this).animate({marginTop: '75px'}, 300);
		//$('.dett_elem_cantiere',this).animate({ backgroundColor: "#592826" }, 300);
	}
	function makeShort(){
		$('.dett_elem_cantiere',this).animate({marginTop: '106px'}, 300);
		//$('.dett_elem_cantiere',this).animate({ backgroundColor: "#2B1413" }, 300);
	}
	
	$('.elem_cantiere','#vista_due').hoverIntent( config )
	*/

	
	/*
	$(".elem_01").hover(
	  function () {
		$('.dettagli',this).animate({marginTop: '70px'}, 600, function() {});
	  }, 
	  function () {
		$('.dettagli',this).animate({marginTop: '100px'}, 600, function() {});
	  }
	);
	*/
	
	var config = {    
     over: makeTall, // function = onMouseOver callback (REQUIRED)    
     timeout: 400, // number = milliseconds delay before onMouseOut    
     out: makeShort // function = onMouseOut callback (REQUIRED)    
	};
	
	function makeTall(){  $('.dettagli',this).animate({marginTop: '70px'}, 400);}
	function makeShort(){ $('.dettagli',this).animate({marginTop: '100px'}, 400);}
	
	$(".elem_01").hoverIntent( config )
	
	
	$(".elem_03").hover(
	  function () {
		$(".dettagli .titolo",this).animate({ color: "#FF9900" }, 700);
	  }, 
	  function () {
		$(".dettagli .titolo",this).animate({ color: "white" }, 700);
	  }
	);
	
	navi="chiuso";
	
	$('.puls_navi').click(function() {
	  ///////$('.navi').slideToggle('slow', function() {});
	  if (navi=="chiuso"){
		  navi="aperto";
		   $('.puls_navi').css("background-image","url(img/bg_puls_02.png)");
		   $('.navi').animate({height: "130px"}, 600, function() {});
		  }else{
		  navi="chiuso";
		   $('.puls_navi').css("background-image","url(img/bg_puls_01.png)");
		   $('.navi').animate({height: "0px"}, 600, function() {});
		}
	});
	
	
	/*
	$('.puls_navi_02').click(function() {
	  $('.navi').slideToggle('slow', function() {});
	  if (navi=="chiuso"){
		  navi="aperto";
		   $('.puls_navi').css("background-image","../img/bg_puls_02b.png");
		  }else{
		   $('.puls_navi').css("background-image","../img/bg_puls_01b.png");
		}
	});
	*/
	
	$('.puls_navi_02').click(function() {
	  ///////$('.navi').slideToggle('slow', function() {});
	  if (navi=="chiuso"){
		  navi="aperto";
		   $('.puls_navi_02').css("background-image","url(img/bg_puls_02b.png)");
		   $('.navi').animate({height: "130px"}, 600, function() {});
		  }else{
		  navi="chiuso";
		   $('.puls_navi_02').css("background-image","url(img/bg_puls_01b.png)");
		   $('.navi').animate({height: "0px"}, 600, function() {});
		}
	});
	
	var tempo01
	tempo01=01;
	
	

	
	
	$('.elem_menu').click(function() {
		var ident = $(this).attr("id");
		var tempo01=ident;
		
		$('.elem_menu').css('background-image', 'url(img/icone/04.png)');
		$('.elem_menu').css('background-color', '#2B1413');
		$('.elem_menu').css('color', 'white');
		
		$('#01').css('background-image', 'url(img/icone/01.png)');
		$('#01').css('background-color', '#2B1413');
		$('#01').css('color', 'white');
		$('#02').css('background-image', 'url(img/icone/02.png)');
		$('#02').css('background-color', '#2B1413');
		$('#02').css('color', 'white');
		$('#03').css('background-image', 'url(img/icone/03.png)');
		$('#03').css('background-color', '#2B1413');
		$('#03').css('color', 'white');
		$('#04').css('background-image', 'url(img/icone/04.png)');
		$('#04').css('background-color', '#2B1413');
		$('#04').css('color', 'white');
		$('#05').css('background-image', 'url(img/icone/05.png)');
		$('#05').css('background-color', '#2B1413');
		$('#05').css('color', 'white');
		/*$('.elem_menu').css('background-color', '#2B1413');
		$('.elem_menu').css('color', 'white');*/
		
		//alert($(this).attr("id"));
		
		$(this).css('background-image', 'url(img/icone/'+ident+'h.png)');
		$(this).css('background-color', 'white');
		$(this).css('color', '#2B1413');
		if ( parseInt(ident)>5 || ident=="08" || ident=="09"){$(this).css('background-image','url(img/icone/04h.png)');};
		
	});
	
	
	
	
	
	
	
});
