function showPopup(map) 	{	document.getElementById('map_sg').style.display = 'none';	document.getElementById(map).style.display = 'block';	setPopUpPosition(document.getElementById('maploc'), 'popUpDiv');	document.getElementById('popUpDiv').style.display = "block";}function hidePopUp() {	document.getElementById('popUpDiv').style.display = "none";}// =======================================================================================// Function to determine Display Position of the Pop Up at the Required Element // =======================================================================================function setPopUpPosition(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 + 00 +  "px";	display.style.top = selectedPosY - scroll + 40 + "px";	display.style.display = "block";}  
