function ShowPopup(hoverid,id, e)
{
    
    hp = document.getElementById(id);
    // Set popup to visible

    oScreenWidth = document.body.clientWidth;
    oScreenHeight = document.body.clientHeight;

    xCoord = e.clientX + document.body.scrollLeft +
	document.documentElement.scrollLeft + 15;
    yCoord = e.clientY + document.body.scrollTop +
	document.documentElement.scrollTop + 15;

    div = document.getElementById("contentArea");

    hpWidth= hp.offsetWidth; 
    hpHeight = hp.offsetHeight; 

    //if (e.clientX + 200 + 5 > oScreenWidth)
    //{ xCoord = xCoord - 225; }
    //if (e.clientY + 120 + 15 > oScreenHeight)
    //{ yCoord = yCoord - 150; }
    
    if (e.clientX + hpWidth + 25 > oScreenWidth) { 
	xCoord = xCoord - hpWidth - 200;
	if (xCoord < 0) {
	    xCoord = 0;
	}
    }
    if (e.clientY + hpHeight + 25 > oScreenHeight) { 
	yCoord = yCoord - hpHeight; 
	if (yCoord < 0) {
	    yCoord = 0;
	}
    }

    hp.style.top = yCoord + "px";
    hp.style.left = xCoord +"px";
    
    // hp.style.top = hoverid.offsetTop + 5;
    //hp.style.left = hoverid.offsetLeft + 20;

    hp.style.visibility = "Visible";

    hp.style.zIndex = 999;
}

    function NewShowPopup(hoverid,id, e)
    {
	hp = document.getElementById(id);

	xCoord = e.clientX;
	yCoord = e.clientY;
	
	//alert("X " + xCoord + " Y " + yCoord);
	hp.style.position = "absolute";
	hp.style.top = yCoord + "px";
	hp.style.left = xCoord + "px";

	//hp.style.top = (hoverid.offsetTop + 5) +"px";
	//hp.style.left = (hoverid.offsetLeft + 20)+"px";

	hp = document.getElementById(id);
	hp.style.visibility = "Visible";
    }

    function HidePopup(id)
    {
	hp = document.getElementById(id);
	hp.style.visibility = "Hidden";	
    }
