/*<![CDATA[*/ 
$(document).ready(function() {
	//On Hover Over
	function megaHoverOver(){
		$(this).find(".top_sub_navigation").stop().fadeTo('fast', 1).show(); //Find sub navigation and fade it in
		(function($) {
		//Function to calculate total width of all ul's
		jQuery.fn.calcSubWidth = function() {
			rowWidth = 0;
			//Calculate row
			$(this).find("ul").each(function() { //for each ul...
			rowWidth += $(this).width(); //Add each ul's width together
			});
		};
		})(jQuery);
	}
	//On Hover Out
	function megaHoverOut(){
	  $(this).find(".top_sub_navigation").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
		  $(this).hide();  //after fading, hide it
	  });
	}
	
	//Set Customer Configuration & Trigger Function
	var config = {
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
		 interval: 10, // number = milliseconds for onMouseOver polling interval
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
		 timeout: 100, // number = milliseconds delay before onMouseOut
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)
	};
	
	$("ul.top_navigation li .top_sub_navigation").css({'opacity':'0'}); //Fade sub navigation to 0 opacity on default
	$("ul.top_navigation li").hoverIntent(config); //Trigger Hover intent with custom configurations
	//$("ul li").hoverIntent( megaHoverOver ,megaHoverOut);
		
});
/*]]>*/ 
