/*
	The functions below are for IE only, they are needed because of the lack 
	of CSS1 and CSS2 support that IE has
*/

// This attachs events to the navigation
function activateMenu()
{
	var cListItem = document.getElementsByTagName("li");

	// Temp code, this assumes you the first LI is a menuitem, add for loop to check if it really is...
	for(var i=0; i<cListItem[0].childNodes.length; i++)
	{
		var node = cListItem[0];

		if(cListItem[0].childNodes[i].nodeName == "UL")
		{
			var menuNode = cListItem[0].childNodes[i];

			node.attachEvent("onmouseover",
				function()
				{
					menuNode.style.display = "block";
				}
			);

			node.attachEvent("onmouseout",
				function()
				{
					menuNode.style.display = "none";
				}
			);
		}
	}
}

// This switches the footer from position static to bottom, depeding on the window height
function initFooter()
{
	var windowHeight;

	if (document.documentElement.clientHeight)
	{
		windowHeight = document.documentElement.clientHeight;
	}
	else
	{
		if (document.body && document.body.clientHeight)
		{
			windowHeight = document.body.clientHeight;
		}
	}

	// tmp fix
	if(typeof(tmpFix) != "undefined")
	{
		document.getElementById("footer").style.position = "static";
	}
	else
	{
		document.getElementById("footer").style.position = (document.body.scrollHeight > windowHeight)? "static":"absolute";
	}
}

// If IE, then activate menues and position footer
if(document.documentElement.currentStyle)
{
	window.onload = function ()
	{
		initFooter();
		activateMenu();
	}

	window.onresize = initFooter;
}