function menu_toggle_submenu(parent, display, highlight)
{
	var i;

	if (document.getElementById)
	{
		for (i = 0; i < parent.childNodes.length; i++)
		{
			if (parent.childNodes[i].nodeName == 'UL')
			{
				if (display == true)
				{
					parent.childNodes[i].style['display'] = 'block';
				}
				else
				{
					parent.childNodes[i].style['display'] = 'none';
				}
			}

			if (highlight == true)
			{
				if (display == true)
					parent.className = 'active';
				else
					parent.className = '';
			}
		}
	}
}

function menu_set_handlers(id)
{
	var menu;
	var i;
	var highlight;

	if (id)
	{
		if (document.getElementById)
		{
			menu = document.getElementById(id);
			if (menu)
			{
				for (i = 0; i < menu.childNodes.length; i++)
				{
					if (menu.childNodes[i].nodeName == 'LI')
					{
						if (menu.childNodes[i].className == 'active')
						{
							menu.childNodes[i].onmouseover = function() { menu_toggle_submenu(this, true, false); };
							menu.childNodes[i].onmouseout = function() { menu_toggle_submenu(this, false, false); };
						}
						else
						{
							menu.childNodes[i].onmouseover = function() { menu_toggle_submenu(this, true, true); };
							menu.childNodes[i].onmouseout = function() { menu_toggle_submenu(this, false, true); };
						}
					}
				}
			}
		}
	}
}