window.onload = menu;

function menu(){
	var menu = document.getElementById("menu").getElementsByTagName("ul");
	for (i = 0; i < menu.length; i++) {
		menu[i].setAttribute("id", "menu" + i)
		if (menu[i].parentNode.nodeName == "LI") {
			menu[i].parentNode.onmouseover = function () {
				this.lastChild.style.display = "block";
				this.style.backgroundColor = "#0071bd";
			}
			menu[i].parentNode.onmouseout = function () {
				this.lastChild.style.display = "none";
				this.style.backgroundColor = "transparent";
			}
		}
	}
}
