window.onload = function()
{
	freeFloatingArr = document.getElementById("top_nav_main").getElementsByTagName("DIV");
	freeFloatingChildArr = document.getElementById("top_nav_main").getElementsByTagName("LI");
	freeFloatingMenu();
}

function freeFloatingMenu()
{
	for (i = 0; i < freeFloatingArr.length; i++)
	{
		if (freeFloatingArr[i].className == "ffm_drop_wrapper")
		{
			freeFloatingArr[i].onmouseover = function()
			{
				if (typeof hideMenuTimeout != "undefined")
				{
					window.clearTimeout(hideMenuTimeout);
					menuHide.objRef = prevMenu;
					if (prevMenu != this.getElementsByTagName("li")[0])
					{
						menuHide();
					}
				}
				menuShow.objRef = this.getElementsByTagName("li")[0];
				showMenuTimeout = window.setTimeout("menuShow()",500);
			}
			freeFloatingArr[i].onmouseout = function()
			{
				if (typeof showMenuTimeout != "undefined")
				{
					window.clearTimeout(showMenuTimeout);
					menuHide.objRef = this.getElementsByTagName("li")[0];
					hideMenuTimeout = window.setTimeout("menuHide()",1000);
					prevMenu = this.getElementsByTagName("li")[0];
				}
			}
		}
	}
	for (i = 0; i < freeFloatingChildArr.length; i++)
	{
		if (freeFloatingChildArr[i].className == "child_element")
		{
			freeFloatingChildArr[i].onmouseover = function()
			{
				this.getElementsByTagName("ul")[0].style.visibility = "visible";
			}
			freeFloatingChildArr[i].onmouseout = function()
			{
				this.getElementsByTagName("ul")[0].style.visibility = "hidden";
			}
		}
	}
}

var menuShow = function()
{
	menuShow.objRef.style.visibility = "visible";
}

var menuHide = function()
{
	menuHide.objRef.style.visibility = "hidden";
}
