var inmenu=false;
var lastmenu=0;

function Menu(current)
{
	if(!document.getElementById) {
		return; }
		
	inmenu=true;
	oldmenu=lastmenu;
	lastmenu=current;
	
	if(oldmenu) Erase(oldmenu); {
		m=document.getElementById("menu-" + current); }

	box=document.getElementById(current);

	box.style.visibility = 'visible';
	m.style.cursor = 'default';


	// box.style.left= m.offsetLeft;
	// box.style.top= m.offsetTop + m.offsetHeight;
	// m.style.backgroundColor="Aqua";
	// box.style.backgroundColor="Aqua";
	// box.style.width="120px";

	/*

	// box.style.cursor = 'wait';

	Do not use onMouseOver to change the cursor.
	What you need to do is once the item has been
	created and given an ID, to then use JavaScript
	to set the cursor for that item:
		
	---------------------------------------------------------------
	
	<a href="apage.html" id="myLink">go somewhere</a>
	<img id="myPicture" src="picture.gif" width="16" height="16">
	<p id="myText">Some text</p>
	
	<span id="mySpan">Some text within a span tag</span> followed by text outside the span tags.
		
	<script language="JavaScript">
	
	if (document.all) {
    document.all("myLink").style.cursor = 'wait';
    document.all("myText").style.cursor = 'hand';
    document.all("myPicture").style.cursor = 'crosshair';
    document.all("mySpan").style.cursor = 'move'; }

	---------------------------------------------------------------

	The following cursors are available:

	auto | crosshair | default | hand | move
	e-resize | ne-resize | nw-resize | n-resize
	se-resize | sw-resize | s-resize | w-resize
	text | wait | help 
	*/
}

function Erase(current)
{
	if(!document.getElementById) {
		return; }
	
	if(inmenu && lastmenu==current) {
	  return; }
	  
	m=document.getElementById("menu-" + current);
	box=document.getElementById(current);
	box.style.visibility="hidden";
	// m.style.backgroundColor="Silver";
}

function Timeout(current)
{
	inmenu=false;
	window.setTimeout("Erase('" + current + "');",300);
}

function Highlight(menu,item)
{
	if(!document.getElementById) {
		return; }
	
	inmenu=true;
	lastmenu=menu;
	obj=document.getElementById(item);
	obj.style.backgroundColor="#ffffff";
}

function UnHighlight(menu,item)
{
	if (!document.getElementById) {
		return; }
	
	Timeout(menu);
	obj=document.getElementById(item);
	obj.style.backgroundColor="#eeeeee";
}
