jQuery(function($)
{
	var overNav = false;
	// main navigation submenus
	$("#header #mainnav > li").not(".active").hover
	(
		function()
		{
			var sub = $("ul", this);
			if(sub.length > 0)
			{
				overNav = true;
				$("li ul", $(this).parent()).hide()
				$("ul", this).show();
			}
		},
		function()
		{
			var sub = $("ul", this);
			if(sub.length > 0)
			{
				overNav = false;
				var self = this;
				setTimeout(function()
				{
					if(!overNav)
					{
						$("ul", self).hide();
						$(".active ul", $(self).parent()).show();
					}
				}, 200);
			}
		}
	);
});
