var timer;
var menuitems = new Array();

// menuitems are in the form of
// negative x-coord offset    menu name           menu items (in the form: menu name=url)
//                    |         |          +--------|
//                    |         |          |
menuitems[0] = Array(360, 'Services', 'PFT=aboutUs.html', 'The Group=theGroup.html');

function menuOn(menu)
{
	// cancel the menu from hiding
	clearTimeout(timer);

	menuObj = document.getElementById("menu");
	center = document.body.clientWidth / 2;
	// position the menu
	menuObj.style.left = (center - menuitems[menu][0]) + 'px';
	
	// populate the menu
	menuContent = "<div id=\"menuTop\">&nbsp;</div>";
		menuContent += "<div id=\"menuContent\">";
		for(i=2; i<menuitems[menu].length; i++)
		{
			temp = menuitems[menu][i].split('=');
			menuContent += "<a href=\"" + temp[1] + "\" onmouseover=\"menuOn(" + menu + ")\" onmouseout=\"menuOff()\">" + temp[0] + "</a>";
		}
		menuContent += "</div>";
	menuContent += "<div id=\"menuBottom\">&nbsp;</div>";
	
	menuObj.innerHTML = menuContent;

	// display the menu
	menuObj.style.display = 'block';
}

function menuOff()
{
	timer = setTimeout('hideMenu()', 1000);
}

function hideMenu()
{
	menuObj = document.getElementById("menu");
	menuObj.style.display = 'none';
}