jQuery(document).ready(function(){
    	firstBlock = jQuery("#first");
		Block = jQuery(".panel");
		active = jQuery(".active");
    	maxWidth = 585;	
		minWidth = 165;	
		jQuery("#pannelli li").not("#first").mouseover(
			function(){
				// mette a zero il primo pannello
        		jQuery(firstBlock).animate({width:0}, { queue:false, duration:400 });
				// animazione pannelli
				jQuery(Block).animate({width: minWidth+"px" }, { queue:false, duration:400 });
				jQuery(this).animate({width: maxWidth+"px" }, { queue:false, duration:400 });
				jQuery(this).children("a").animate({width: maxWidth+"px" }, { queue:false, duration:400 });
      		}
		);
		jQuery("#pannelli li").not("#first").mouseout(
			function(){
				// riapertura primo pannello al mouseout
				jQuery(firstBlock).animate({width: 420}, { queue:false, duration:400 });
				jQuery(this).animate({width: minWidth+"px" }, { queue:false, duration:400 });
				jQuery(this).children("a").animate({width: minWidth+"px" }, { queue:false, duration:400 });
			}
    	);
		// incompiuto: parte per l'apertura nella sezione
		//jQuery("#pannelli li").not("#first").load(
		//	function(){
		//		jQuery(active).animate({width: maxWidth+"px" }, { queue:false, duration:400 });
		//	}
    	//);
});
