
function popUp(event,table) {
	if (document.getElementById) {
		var tableWidth = getElWidth();
		tableElement = document.getElementById(table);
		tableStyle = tableElement.style;
		styleVis = tableStyle.visibility;
		if (tableElement.offsetWidth) elementWidth = tableElement.offsetWidth;
		else if (tableElement.clip.width) elementWidth = tableElement.clip.width;
		//make sure it's hidden
		if  (styleVis == "visible" || styleVis == "show") { tableStyle.visibility = "hidden"; } 
		else {tableTop = mouseY(event) + 20; tableLeft = mouseX(event) - (elementWidth/3);
			if (tableLeft< 2) tableLeft = 2;
			else if (tableLeft + elementWidth > tableWidth) tableLeft -= elementWidth/2; tableLeft += 'px';
			tableTop += 'px';
			tableStyle.left = tableLeft; tableStyle.top = tableTop 
			tableStyle.visibility = "visible";
			}
	}
}


function getElWidth() {
	return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
}; 

function mouseX(event) {
	return event.clientX ? event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) : event.pageX;
} 
function mouseY(event) {
	return event.clientY ? event.clientY + (document.documentElement.scrollTop || document.body.scrollTop) : event.pageY
}
 