// JavaScript Document

$(document).ready(function() {

//On Hover Over
function megaHoverOver(){

	$(this).css({ 'background' : '#e7e7e9' });
	$(this).find('a:first').css({ 'color' : '#68696a' }); //Add background color + image on hovered list item
//	$(this).find("ul").show(); //Show the subnav
	$(this).find("ul").stop().fadeTo('fast', 0.9).show(); //Find sub and fade it in


}
//On Hover Out
function megaHoverOut(){


	$(this).css({ 'background' : 'none'}); //Ditch the background
	$(this).find('a:first').css({ 'color' : '#ffffff' });
//	$(this).find("ul").hide(); //Hide the subnav
	$(this).find("ul").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
		$(this).hide();  //after fading, hide it
	});


}





//Set custom configurations
var config = {
     sensitivity: 8, // number = sensitivity threshold (must be 1 or higher)
     interval: 100, // number = milliseconds for onMouseOver polling interval
     over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
     timeout: 500, // number = milliseconds delay before onMouseOut
     out: megaHoverOut // function = onMouseOut callback (REQUIRED)
};

$("#nav_14623 li ul").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
$("#nav_14623 > li").hoverIntent(config); //Trigger Hover intent with custom configurations
	
});


