jQuery(function(){
	var setTimeOutId = 0;
	var setDelay = 400;
	jQuery("#xxlNavMain").find("li.root a.root").each(function(){
		jQuery(this).hover(
			function(){
				window.clearTimeout(setTimeOutId);
				jQuery(this).parent().find("ul").attr('style', 'left:0');
				jQuery("#xxlNavMain").find("li.submenu ul").not(jQuery(this).parent().find("ul")).attr('style', 'left:-9999px');
			},
			function(){
				var ulNode = jQuery(this);
				setTimeOutId = window.setTimeout(function() {
				  ulNode.parent().find("ul").attr('style', 'left:-9999px');
				}, setDelay);
			}
		);
		
		jQuery(this).parent().find("ul").hover(
			function(){
					window.clearTimeout(setTimeOutId);
				},
			function(){
				var currentNode = jQuery(this);
				setTimeOutId = window.setTimeout(function() {
				  currentNode.attr('style', 'left:-9999px');
				}, setDelay);
			}
		);
		
		jQuery(this).parent().find("div.NavBubble").hover(
			function(){
				window.clearTimeout(setTimeOutId);
			},
			function(){
				var currentNode = jQuery(this);
				setTimeOutId = window.setTimeout(function() {
				  //currentNode.attr('style', 'left:-9999px');
				  currentNode.parent().find("ul").attr('style', 'left:-9999px');
				}, setDelay);
			}
		);
	});
});