$j=jQuery.noConflict();

function showMenu(cl){

	$j("."+cl+" .sub").stop().fadeTo(500,0.95,"easeOutCubic");
}

function hideMenu(cl){
	$j("."+cl+" .sub").stop().fadeTo(250,0,function(){ 
		$j("."+cl+" .sub").hide();	
		});
}

function colorBarNav(n){	

	//n=$j(".b1").parent().get(0).attr("id");
			
			$j(".l"+n).stop().animate({ backgroundColor: "#F06000" },time);	
}
function resetBarNav(n){
		if($j(".l"+n).hasClass("currentPg")){
				
				
				$j(".l"+n).stop().animate({ backgroundColor: "#9C1101" },time,'easeOutCirc');
			}
			else $j(".l"+n).stop().animate({ backgroundColor: "#FFD62F" },time,'easeOutCirc');
			
}

/* Navigation */
$j(function(){

	
	
		time=500;
		//Colora La pagina in questione di rosso
		$j(".currentPg").css("backgroundColor","#9C1101");
	
	
		 $j("#navigation li").hover(function(){
		
			
			//n=$j(".b1").parent().get(0).attr("id");
			n=$j(this).attr("class").substring(1,2);
			colorBarNav(n);

		
		 },function(){
			 
			// n=$j(this).attr("class").substring(1,2);
		
			 resetBarNav(n);
			
		
			
		
		 })
		 
		 	/* Drop Down */
		
			 $j(".b3,.b2").mouseenter(function(){
				 cl=$j(this).attr("class");
				
				 showMenu(cl);
				 
				 
			 });
			 
			  $j(".b3,.b2").mouseleave(function(){
				  	 cl=$j(this).attr("class");
					 n=$j(this).attr("class").substring(1,2);
					 resetBarNav(n); 
					 hideMenu(cl);
			  });
			
	// Slide to


	$j(".goto").smoothScroll({
		offset:-60,
      easing: 'swing',
      speed: 1000
    });

	
	//catalogo
	$j(".stufeItem").hover(function(){
		$j(this).stop(false,true).switchClass('stufeStandard','stufeHover',300);
		},
		function(){
			$j(this).stop(false,true).switchClass('stufeHover','stufeStandard',300);
			});
	



});

