// General PLA site support functions

function platipHide() {
    document.getElementById('platip').style.display = "none";
}

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function platipShow(obj) {
	//obtain mouse position relative to document
	var posX = 0;
	var posY = 0;

	posX = findPosX(obj);
	posY = findPosY(obj);

	posX -= 200;
	posY += 10;

	if (document.getElementById('platip').style.display != "inline") {
		document.getElementById('platip').style.left = posX + "px";
		document.getElementById('platip').style.top = posY + "px";
		document.getElementById('platip').style.display = "inline"
	}
}

function OpenHelpWindow(sURL) {
	window.open (sURL, 'Help', 'toolbar=0,menubar=0,scrollbars=1,width=530,height=550,screenX=0,screenY=0,left=0,top=0');
}

function OpenPrintWindow(sURL) {
	window.open (sURL, 'Help', 'toolbar=1,menubar=1,scrollbars=1,width=720,height=550,screenX=0,screenY=0,left=0,top=0');
}