function showPopup(objAnchor, strPopup, objEvent)
{
	if (!objAnchor || !strPopup || !objEvent)
		return;

	var objPopup = document.getElementById(strPopup);

	if (!objPopup || objPopup.style.visibility == "visible")
		return;

	var numLeft = 0;
	var numTop = objAnchor.offsetHeight;
	var objParent = objAnchor;

	while (objParent)
	{
		numLeft += objParent.offsetLeft;
		numTop += objParent.offsetTop;
		objParent = objParent.offsetParent;
	}

	objPopup.style.left = String(numLeft) + "px";
	objPopup.style.top = String(numTop) + "px";
	objPopup.style.visibility = "visible";
	objEvent.cancelBubble = true;
}

function hidePopups()
{
	var numCounter = 1;

	while (true)
	{
		var strPopup = "popup" + String(numCounter);
		var objPopup = document.getElementById(strPopup);

		if (!objPopup)
			break;

		if (objPopup.style.visibility == "visible")
			objPopup.style.visibility = "hidden";

		numCounter++;
	}
}
