
// FUNCTION TO GENERATE A CENTERED POPUP WINDOW.
//
// Usage: fnPopWin(*STRING* Target URL , *INT* Popup Width , *INT* Popup Height)
//
// nb.	place 'onBlur="window.close();"' in the popup HTML's <BODY> if you
//		want the popup to disappear when it loses focus.
//

function fnPopWin(sTarget,iSizeX,iSizeY,iPosX,iPosY)
{
	var iLeft;
	var iTop; 
		
	if (!iPosX && !iPosY && (document.all || document.layers || document.getElementById))
	{
		iLeft = (screen.width / 2) - (iSizeX / 2);
		iTop = (screen.height / 2) - (iSizeY / 2);
	}
	else
	{
		iLeft = iPosX;
		iTop = iPosY;
	}
	
	oPopWin = window.open(sTarget,"POPWIN","scrollbars=yes,status=no,directories=no,location=no,toolbar=no,resizable=no,menubar=no,width="+iSizeX+",height="+iSizeY+",innerwidth="+iSizeX+",innerheight="+iSizeY+",top="+iTop+",left="+iLeft+",screenX="+iLeft+",screenY="+iTop);
	oPopWin.focus();
}

