////////////////////////////////////////////////////////////////////////////////
// BEGIN
//

	var menuTimeout;

	function menuOver( obj )
	{		
		obj.className = "menuItem menuItemOver";
	}
	
	function menuOut( obj )
	{
		obj.className = "menuItem";	
	}
	
	function submenuOver( obj )
	{
		obj.style.backgroundColor = "#c6d6e9";	
	}
	
	function submenuOut( obj )
	{
		obj.style.backgroundColor = "#FFFFFF";
	}
		
	function showMenu( obj, mnu )
	{
		hideMenu();
		
		var menu = document.getElementById( mnu );
		var x = findPosX( obj );
		var y = findPosY( obj );
		
		menu.style.left = (x-13) + "px";
		//menu.style.top = (y + 26) + "px";
		menu.style.top = "8px";
		menu.style.visibility = "visible";
	}
	
	function hideMenu()
	{
		var menus = new Array( 'generalInfoMenu', 'liveRacingMenu', 'schedulesMenu', 'horsemansMenu', 'wageringMenu', 'sponsorsMenu' );
		
		for( var i = 0; i < menus.length; i++ )
		{
			var elem = document.getElementById( menus[i] );
				elem.style.visibility = "hidden";
		}
		
		clearTimeout( menuTimeout );
	}
	
	function startHideMenu()
	{
		menuTimeout = setTimeout( "hideMenu()", 2000 );
	}
	
	function startFastHideMenu()
	{
		clearTimeout( menuTimeout );
		//menuTimeout = setTimeout( "hideMenu()", 100 );
		hideMenu();
	}
	
	function clearHideMenu()
	{
		clearTimeout( menuTimeout );
	}
	
	function loadPage( page )
	{
		window.open( page, "_self" );	
	}
	
	function findPosX(obj)
	{
		var curleft = 0;
		if(obj.offsetParent)
			while(1) 
			{
			  curleft += obj.offsetLeft;
			  if(!obj.offsetParent)
				break;
			  obj = obj.offsetParent;
			}
		else if(obj.x)
			curleft += obj.x;
		return curleft;
	}
	
	function findPosY(obj)
	{
		var curtop = 0;
		if(obj.offsetParent)
			while(1)
			{
			  curtop += obj.offsetTop;
			  if(!obj.offsetParent)
				break;
			  obj = obj.offsetParent;
			}
		else if(obj.y)
			curtop += obj.y;
		return curtop;
	}

//
// END
////////////////////////////////////////////////////////////////////////////////