
setMenu = {
	ul_id: "nav",
	
	initialize: function() {

		var i,j,node,a,navRoot;
		setMenu.navRoot=navRoot = document.getElementById(setMenu.ul_id);
		if (!navRoot) return;
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				for (j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].nodeName=="A") {
						a=node.childNodes[j];
						a.onclick=function(){setMenu.click(this)};
					}
				}
			}
		}
	},
	
	click: function(a)
	{
		var navRoot,i,node,ul;
		navRoot=setMenu.navRoot;
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				ul=node.getElementsByTagName("ul");
				if (ul && ul.length>0) {
					ul[0].style.display=(node==a.parentNode)? "block":"none";
				}
			}
		}
	}
}

addEvent(window,"load",setMenu.initialize);

