function ShowPopup(hoveritem,code,box)
{
	hp = document.getElementById("hoverpopup_" + code);
	it_box  = document.getElementById(box);

	// Set position of hover-over popup
	hp.style.top =  findPosY(it_box) + 98;
	hp.style.left = findPosX(it_box) + 110;
//	hp.style.left = findPosX(it_box) + 450;
	
	// Set popup to visible
	hp.style.visibility = "Visible";

	// it_box.style.backgroundColor = "#E2E1DD";
	it_box.style.backgroundColor = "#E9E3CA";
}

function HidePopup(code,box)
{
	it_box  = document.getElementById(box);

	hp = document.getElementById("hoverpopup_" + code);
	hp.style.visibility = "Hidden";
	
	it_box.style.backgroundColor = "#F3F3F3";
}

function findPosX(obj)
{
      var curleft = 0;
      if(obj.offsetParent)
	      	while(1) 
		{
			curleft += obj.offsetLeft;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
	else if(obj.x)
		curleft += obj.x;

	return curleft;
}
function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
			curtop += obj.offsetTop;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
	
	return curtop;
}
