var PopWin = null;
function Popup(URL, WinX, WinY, WinWidth, WinHeight, WinFeatures)
{	if(WinX.indexOf("%"))
   	{	ScreenWidth = screen.availWidth;
    	Percent = parseInt(WinX);
   		WinX = parseInt(Math.round((ScreenWidth / 100) * Percent));
        WinX -= parseInt(WinWidth / 2);
    }
   	if(WinY.indexOf("%"))
    {	ScreenHeight = screen.availHeight;
   		Percent = parseInt(WinY);
    	WinY = parseInt(Math.round((ScreenHeight / 100) * Percent));
        WinY -= parseInt(WinHeight / 2);
   	}

	if(!PopWin	|| PopWin.closed)
	{	PopWin = window.open(URL,"", "width="+WinWidth+",height="+WinHeight+","+WinFeatures);
	}
	else
	{	PopWin.location.href = URL;
	}
	PopWin.moveTo(WinX, WinY);
	PopWin.focus();
}
