var menu_items = new Array();

function makeMenuItem (id)
{
	menu_items.push(id);
	var targ = document.getElementById('sec_'+id);
	targ.onmouseover = function ()
	{
		this.className = "over";
		
		var sub_item = document.getElementById('sec_'+id+'_popup');
		sub_item.style.display = "block";
		sub_item.onmouseout = function ()
		{
			this.style.display = "none";
			targ.className = "";
		};
		sub_item.onmouseover = function ()
		{
			this.style.display = "block";
			targ.className = "over";
		}
		var _links = sub_item.getElementsByTagName('a');
		for (var x=0; x<_links.length; x++)
		{
			_links[x].onmouseover = function ()
			{
				this.parentNode.style.display = "block";
				targ.className = "over";
			};
		}
		hideAllBut(id);
	};
	
	targ.onmouseout = function ()
	{
		hideAllBut('-1');
		this.className = "";
	}
}

function hideAllBut (id)
{
	for (var i=0; i<menu_items.length; i++)
	{
		if (menu_items[i] != id)
			document.getElementById('sec_'+menu_items[i]+'_popup').style.display = "none";
	}
}
