function initPage()
{
	initInputs();
	initNav();
}
function initInputs()
{
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++)
	{
		if (inputs[i].type == "text" && (inputs[i].name == "search" || inputs[i].name == "keywords"))
		{
			inputs[i].onfocus = function ()
			{
				if (this.value == "Search the site..." || this.value == "Relevant words to narrow your search")
					this.value = "";
			}
			inputs[i].onblur = function ()
			{
				if (this.value == "" && this.name == "search") this.value = "Search the site...";
				if (this.value == "" && this.name == "keywords") this.value = "Relevant words to narrow your search";
			}
		}
	}
}
function initNav() 
{
	if (typeof document.body.style.maxHeight == 'undefined') 
	{
		var nav = document.getElementById("top-buttons"),
			lis = nav.getElementsByTagName("li"),
			_nav = document.getElementById("main-nav"),
			_lis = _nav.getElementsByTagName("li");
			
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				this.className += " hover";
			}
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
				
			}
		}
		for (var i=0; i<_lis.length; i++)
		{
			_lis[i].onmouseover = function()
			{
				this.className += " hover";
				
				var selects = document.getElementsByTagName('select');
				for (var i=0;i<selects.length;i++)
				{
					selects[i].style.visibility = 'hidden';
				}
			}
			_lis[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
				var selects = document.getElementsByTagName('select');
				for (var i=0;i<selects.length;i++)
				{
					selects[i].style.visibility = 'visible';
				}
			}
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", initPage, false);
else if (window.attachEvent)
	window.attachEvent("onload", initPage);

