/**
* Set a javascript variable with the value of the href attribute of the base tag. This is used so
* that e.g. calls to swfobject which need to pass in the path to a resource as a flashvar (e.g. an .FLV
* or flash video player skin) can prepend this javascript variable and thus create a complete URL.
*
* Note that this is outside of the document.ready block below. If it's within the block, then all Flash embeds
* using swfobject must be wrapped in document.ready callbacks or baseHref will not be defined. Wrapping them
* in these blocks makes the Flash not begin to load until after the DOM is ready.
*/
baseHref = $("base").attr("href");

$(function()
{
	var timeoutId;

/**
* Product menu hover over/out callback functions
*We use setTimeout calls to induce a slight delay before the menu is shown so that
* users can easily navigate to the items in the menu below the product menu.
*/
	$("div.productMenu").hover(
		function()
		{
			var element = this;
			
			timeoutId = setTimeout(function() 
			{
				$(element).addClass("hover");
   	      //if main nav item div contains no children then it returns null, assume that there are no sub links. Do nothing
   	      if($(element).children("div").children().html() != null){
   	      	//there is data in the main nav items div children so show what there is there
   	      	$(element).children("div").show();
	      	}
			}, 380);
			
			
		},
		function()
		{
			clearTimeout(timeoutId);
			$(this).removeClass("hover");
			$(this).children('div').hide();
		}
	);
});
