window.onload = function()
{
	var ids = new Array("nav");

	for(var i = 0; i < ids.length; i++)
	{
		var sfEls = document.getElementById(ids[i]).getElementsByTagName("LI");
		for(var i = 0; i < sfEls.length; i++)
		{
			sfEls[i].oldClassName = sfEls[i].className ? sfEls[i].className : "";
			sfEls[i].onmouseover = function()
			{
				this.className = this.oldClassName + " hover";
			}
			sfEls[i].onmouseout = sfEls[i].onclick = function()
			{
				this.className = this.oldClassName;
			}

			var sfEls2 = sfEls[i].getElementsByTagName("A");
			for(var j = 0; j < sfEls2.length; j++)
			{
				sfEls2[j].classResetElement = sfEls[i];
				sfEls2[j].onclick = function()
				{
					if(this.href.substr(this.href.length-1) == "#")
						return false;

					this.classResetElement.className = this.classResetElement.oldClassName;
					if(this.className.match(/^(.*[ ]+)?newwindow([ ]+.*)?$/))
					{
						window.open(this.href);
						return false;
					}
				}
			}
		}
	}
}

function showMask()
{
	if(typeof isOldInternetExplorer !== 'undefined')
	{
		document.getElementById("mask").style.position = "absolute";
		document.getElementById("maskforeground").style.position = "absolute";
		window.onscroll = function()
		{
			var offset = 0;
			if(typeof(window.pageYOffset) == "number" )
				offset = window.pageYOffset;
			else if(document.body && (document.body.scrollLeft || document.body.scrollTop))
				offset = document.body.scrollTop;
			else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
				offset = document.documentElement.scrollTop;
			document.getElementById("mask").style.top = offset + "px";
			document.getElementById("maskforeground").style.top = offset + "px";
		}
		window.onresize = function()
		{
			var height = 0;
			if(typeof(window.innerWidth) == "number")
				height = window.innerHeight;
			else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
				height = document.documentElement.clientHeight;
			else if(document.body && (document.body.clientWidth || document.body.clientHeight))
				height = document.body.clientHeight;
			document.getElementById("mask").style.height = height + "px";
			document.getElementById("maskforeground").style.height = height + "px";
		}
		window.onscroll();
		window.onresize();
	}
	document.getElementById("mask").style.display = "block";
	document.getElementById("maskforeground").style.display = "block";
}

function hideMask()
{
	if(typeof isOldInternetExplorer !== 'undefined')
	{
		window.onscroll = null;
		window.onresize = null;
	}
	document.getElementById("mask").style.display = "none";
	document.getElementById("maskforeground").style.display = "none";
}

