function showMenuTop(elem, popup) {	setDisplayPosition(document.getElementById(elem), popup);	document.getElementById(popup).style.display = 'block';} function hideMenuTop(elem) {	document.getElementById(elem).style.display = 'none';} // =======================================================================================// Function to determine Display Position of the Pop Up at the Required Element // =======================================================================================function setDisplayPosition(elem, popup) {	var target = elem;	var selectedPosX = 0;    var selectedPosY = 0;    var scroll = 0;        if(!target)    	return;	// Get width and height of element	var targetHeight = target.offsetHeight;    var targetWidth = target.offsetWidth; // not used	// Go through DOM tree and obtain relative positions	// of all elements wrt their parent elements	while(target != null)	{	   	selectedPosX += target.offsetLeft;		selectedPosY += target.offsetTop;		// Get Scroll Offset of Any Elements that are not the Main Window				if ( target.offsetTop > 0 ) {		    scroll += target.scrollTop;		} 		target = target.offsetParent;	}	//scroll = scroll - document.scrollTop;	// Get the annotation span, set its position and display	display = document.getElementById(popup);	display.style.left = selectedPosX + 5 +  "px";	display.style.top = selectedPosY - scroll + targetHeight + 0 + "px";	display.style.display = "block";}    
