// Client-side Javascript used for console

//Function displays menu on mouse coordinates
function ShowMenu()
{
	// Set x and y coordinates of the absolutely positioned menu.
	if (!window.Event)
	{
		if (event.y<116)
		{
			var obj = document.getElementById("contextMenu");
			if (obj!=null)
			{
				obj.style.left = event.x;
				obj.style.top = event.y;
				obj.style.display = '';
				return false;
			}
		}
	}
}

//Hide Menu
function HideMenu()
{
	var obj = document.getElementById("contextMenu");
	if (obj!=null)
	{
		obj.style.display= 'none';
	}
}

// Selected menu selections on mousover.
function Selected(obj)
{
	obj.style.color = 'white';
	obj.style.background = 'highlight';
	obj.style.cursor =  'hand'; 
}

// UnSelected function is only used to undo the effects of the Selected function
// on mouseleave. 
function UnSelected(obj)
{
	obj.style.color  = 'menutext';
	obj.style.background  = 'white';
	obj.style.cursor =  'default'; 
}

document.onclick=HideMenu;
document.oncontextmenu=ShowMenu;


