
//Function displays menu on mouse coordinates
function ShowMenu()
{
	var menu = document.getElementById("contextMenu");
	if(menu != null) {
		// Set x and y coordinates of the absolutely positioned menu.
		contextMenu.style.left = event.clientX + document.documentElement.scrollLeft;
		contextMenu.style.top = event.clientY + document.documentElement.scrollTop;
		contextMenu.style.display = '';
		//I know very high but hey its just in case anyone puts some other elements in better than coming back to edit this!
		contextMenu.style.zIndex="10000";
    }
    return false;
}

//Hide Menu
function HideMenu()
{
	var menu = document.getElementById("contextMenu");
	if(menu != null) {
		contextMenu.style.display= 'none';
	}
}

// Selected menu selections on mousover.
function Selected(obj)
{
	obj.style.color = 'white';
	obj.style.background = 'highlight';
}

// 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';
}


//NOTE: these lines are now injected progmatically - only when NOT on www
//document.onclick = HideMenu;
//document.oncontextmenu = ShowMenu;

