function ShowPopup(hoveritem, popupname)
{
hp = document.getElementById(popupname);

// Set position of hover-over popup
hp.style.top = (getElementY(hoveritem) - 300) + 'px';
hp.style.left = (getElementX(hoveritem) - 100) + 'px';

// Set popup to visible
hp.style.visibility = "Visible";
}

function getElementX(element)
{
	var coords = getPageCoords(element);
	var result = coords.x;

	return result;
}

function getElementY(element)
{
	var coords = getPageCoords(element);
	var result = coords.y;
	
	return result;
}

function getPageCoords (element) 
{ 
	var coords = {x: 0, y: 0} 
	while (element) 
	{
		coords.x += element.offsetLeft; 
		coords.y += element.offsetTop; 
		element = element.offsetParent; 
	} 

	return coords; 
} 
	
function HidePopup(popupname)
{
hp = document.getElementById(popupname);
hp.style.visibility = "Hidden";
}

