function CreateMenu(menu)
{
	if (document.all && document.getElementsByTagName)
	{
		var nodeList = menu != null ? menu.getElementsByTagName("ul") : document.getElementsByTagName("ul");
		for (var i = 0; i < nodeList.length; i++)
		{
			CreateMenuItem(nodeList[i]);
		}
	}
}

function CreateMenuItem(menu)
{
	var nodeList = menu.getElementsByTagName("li");
	for (var i = 0; i < nodeList.length; i++)
	{
		nodeList[i].newClassName = nodeList[i].className + " hover";
		nodeList[i].oldClassName = nodeList[i].className;
		nodeList[i].onmouseout = function()		{ this.className = this.oldClassName; }
		nodeList[i].onmouseover = function()	{ this.className = this.newClassName; }
	}
}

function StartMenu()
{
	if (document.all)
	{
		var menu = document.all["menu"];
		if (menu != null)
		{
			CreateMenu(menu);
		}
	}
}

if (window.addEventListener) window.addEventListener("load", StartMenu, false);
else if (window.attachEvent) window.attachEvent("onload", StartMenu);
