/**
* 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");
       	        		$(element).children("div").show();
       	         		if($.browser.safari)
				{
       	                		$("#hiddenFlashImg").show();
        	               		$("#flashBox").hide();
        	        	}
			}, 380);
		},
		function()
		{
			clearTimeout(timeoutId);
			$(this).removeClass("hover");
			$(this).children('div').hide();
			if($.browser.safari) { 
				$("#hiddenFlashImg").hide();
				$("#flashBox").show();
			}
		}
	);
	//Following functon is used to toggle smallEnthusiast club form on all pages
	
	$("a#smallFormToggle").click(function(){
		$(this).next('#smallEnthusiastClubForm').slideToggle('normal');
		$(this).toggleClass("showShortEcForm");
		$(this).toggleClass("hideShortEcForm");
		return false;
	});
});
