/*
 * menu.js - Handles all those nifty dropdown menus.
 *
 * :tabSize=4:indentSize=4:noTabs=false:
 * :folding=explicit:collapseFolds=1:
 *
 */

/**
 * Displays a dropdown menu and left-aligns it with its parent element.
 *
 * @param menuid Element id of the menu to display.
 * @param parentid Element id of the menu's parent element.
 */
function showMenu(menuid, parentid)
{
	var menu   = document.getElementById(menuid);
	var parent = document.getElementById(parentid);

	if (navigator.appName == 'Netscape')
	{
		menu.style.left = parent.offsetLeft + 7 + 'px';
		menu.style.top  = parent.offsetTop + 116 + 'px';
	}
	else
	{
		menu.style.left = parent.offsetLeft + 7 + 'px';
		menu.style.top  = parent.offsetTop + 121 + 'px';
	}

	menu.style.display = 'block';
}

/**
 * Hides a dropdown menu.
 *
 * @param menuid Element id of the menu to hide.
 */
function hideMenu(menuid, parentid)
{
	var menu = document.getElementById(menuid);
	var parent = document.getElementById(parentid);
	
	menu.style.display = 'none';
}

/**
 * Turns on the hot-tracking background color on a menu button.
 *
 * @param buttonid Element id of the button.
 */
function hottrackOn(menuid)
{
	document.getElementById(menuid).style.backgroundColor = '#0066CC';
}

/**
 * Turns off the hot-tracking background color on a menu button.
 *
 * @param buttonid Element id of the button.
 */
function hottrackOff(menuid)
{
	document.getElementById(menuid).style.backgroundColor = '';
}
