	function showRightMenu(){
		// Test for absolute mouse position
		var testTop = document.body.scrollTop + event.clientY;
		var testLeft = document.body.scrollLeft + event.clientX;

// Choose where the menu has to be placed. If we click to
// much on the right side, the menu could be only displayed
// half. So we have to display it LEFT from the cursor
var tooltipAbsLft = (testLeft > document.body.scrollLeft + document.body.width - rightmenu.style.width) ? testLeft - rightmenu.style.width : testLeft;

// Same for bottom of page
var tooltipAbsTop = (testTop > document.body.scrollTop + document.height - rightmenu.style.height) ? testTop - rightmenu.style.height : testTop;
		
		// Place menu at specified position and make it visible
rightmenu.style.posLeft = tooltipAbsLft;
		rightmenu.style.posTop = tooltipAbsTop;
		rightmenu.style.visibility = "visible";
		return (false);
	}

	// function used for hiding the custom right menu
	function hideRightMenu(){
		rightmenu.style.visibility = "hidden";
	}

	// When we ask for the context menu, show our custom menu
	document.oncontextmenu = showRightMenu;
	// If we click anywhere else on the document: hide menu
	document.onclick = hideRightMenu;


