// Javascript instructions for hoverIntent

$(document).ready(function() {

	function hoverOver(){
		$(this).find(".sub, .sub-long, .sub-short").stop().fadeTo('fast', 1).show();		
	}
	
	function hoverOut(){ 
	  $(this).find(".sub, .sub-long, .sub-short").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}

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

	$("#nav ul li .sub, #nav ul li .sub-long").css({'opacity':'0'});
	$("#nav ul li").hoverIntent(config);
});
