/* js menu (uses hoverintent) */

jQuery(document).ready(function($){
		   
var openmenu=null;

var config = {    
     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
     interval: 50, // number = milliseconds for onMouseOver polling interval    
     over: openMenu, // function = onMouseOver callback (REQUIRED)    
     timeout: 300, // number = milliseconds delay before onMouseOut    
     out: closeMenu // function = onMouseOut callback (REQUIRED)    
};


$("ul.mega").addClass("open").css('display','none');


function openMenu(){ 
		 
		if(openmenu!=null && openmenu!=this)$("ul.mega",openmenu).css('display','none');
		$("ul.mega",this).css('display','block');
		openmenu=this;		
}
		

function closeMenu(){
		
		$("ul.mega",this).css('display','none');
		
}

$("#navigation-primary-main ul > li:has('ul.mega')").hoverIntent(config);
$("span.close-panel").click(function(){
									
	$("ul.mega").fadeOut();
	
});

$("span.close-panel").hover(

	function(){$(this).parents("ul.mega").addClass("closing");},
	function(){$(this).parents("ul.mega").removeClass("closing");}
	
	);

});



