// JavaScript Document

function showSubMenu(id)
{
	var subMenu = getObject(id);
	subMenu.style.display = "block";
	lastSubMenu = subMenu;
	setCatchAll();
}
function clearSubMenu()
{
	if(lastSubMenu)
	{
		lastSubMenu.style.display = "none";		
		lastSubMenu = null;
	}
	clearCatchAll();
}
function onMenuItemOver(obj, id)
{
	clearTimer();
	clearSubMenu();
	obj.style.color = "#ff0033";
	obj.style.backgroundColor = "#ccffff";	
	lastMenuItem = obj;
	if(id)
		showSubMenu(id);
}
function onMenuItemOut(obj)
{	
	setTimer();
	obj.style.color = "#333333";
	obj.style.backgroundColor = "#ffffff";	
}
function onSubMenuItemOut()
{
	clearItem(lastSubMenuItem);
	setTimer();
}
function onSubMenuItemOver(obj)
{	
	clearTimer();
	clearItem(lastSubMenuItem);
	obj.style.color = "#ff0033";
	obj.style.backgroundColor = "#ccffff";	
	lastSubMenuItem = obj;	
}
function setTimer()
{
	clearTimer();
	timerID = setTimeout("clearSubMenu()", 200);
}
function clearTimer()
{
	if(timerID)
		clearTimeout(timerID);		
	timerID = null;
}
function clearItem(obj)
{
	if(obj)
	{
		obj.style.color = "#333333";
		obj.style.backgroundColor = "#ffffff";		
		obj = null;
	}
}
function catchAll()
{
	clearItem(lastSubMenuItem);
	clearItem(lastMenuItem);
	clearSubMenu();
	clearTimer();
	catchAllTimerID = null;
}
function setCatchAll()
{
	if(IE || Opera) return;
	clearCatchAll();
	catchAllTimerID = setTimeout("catchAll()", 3500);
}
function clearCatchAll()
{
	if(catchAllTimerID)
		clearTimeout(catchAllTimerID);		
	catchAllTimerID = null;
}
var lastSubMenu = null;
var lastSubMenuItem = null;
var timerID = null;
var catchAllTimerID = null;
var lastMenuItem = null;