function showGlobalMenu( menuName, showLocation )
{
	var globalMenu = document.getElementById( menuName )
	var showLoc = document.getElementById( showLocation )

	
	globalMenu.style.top = getY( showLoc ) + showLoc.offsetHeight
	
	if ( globalMenu.offsetWidth > showLoc.offsetWidth )
	{
		globalMenu.style.left = getX( showLoc ) +  showLoc.offsetWidth - globalMenu.offsetWidth
	}
	else
	{
		globalMenu.style.left = getX( showLoc )
		globalMenu.style.width = showLoc.offsetWidth
	}

	clickedMenu = menuName
	
	
	// take over from doMenu
	document.onclick = unhighlightGlobalMenuTitle
	window.onresize = unhighlightGlobalMenuTitle
}

function menu_callback( theURL, theTarget )    
{
	if ( !pageLoaded )
 	{
		return
    }
	if ( __LeavePage == "" || ( eval( __LeavePage + "( '" + theURL + "', '" + theTarget + "')" ) ) )
	{
			openURL( theURL, theTarget )
	}
}

function unhighlightGlobalMenuTitle()
{
	var	menuWindow = getMenuWindow()
	var	menuShown = getMenuShown()


	if ( ( menuWindow == self.window ) && ( menuShown != clickedMenu ) && ( document.getElementById( menuShown + 'GlobalMenu' ) != null ) )
	{
		document.getElementById( menuShown + 'GlobalMenuImage' ).src = getArrowBlack()
		document.getElementById( menuShown + 'GlobalMenu' ).firstChild.nextSibling.style.color = "#05447e"
	}
	doMenu()
}

function setArrowBlack( id )
{	
	 if ( document.getElementById( id ).style.visibility != '' )
	 {
		 if ( document.getElementById( id ).style.visibility == 'hidden' )
		 {
			document.getElementById( id + 'GlobalMenu' ).firstChild.nextSibling.style.color = "#05447e"
			document.getElementById( id + 'GlobalMenuImage' ).src = getArrowBlack()
		}
	  }
	  else
	  {	
		 document.getElementById( id + 'GlobalMenu' ).firstChild.nextSibling.style.color = "#05447e"
		 document.getElementById( id + 'GlobalMenuImage' ).src = getArrowBlack()
	  }
}	

function setArrowRed( id )
{
	document.getElementById( id + 'GlobalMenu' ).firstChild.nextSibling.style.color = "#ff0000"
	document.getElementById( id + 'GlobalMenuImage' ).src = getArrowRed()
}
