function PopUpJavaScriptCode($Width, $Height, $Top, $Left, $Extras = "resizable=1,status=0,menubar=0,toolbar=0,scrollbars=1,location=0,directories=0")
{
// Outputs the needed Javascript functions to create pop-up windows
// $WidthPercent : The pop-up window will be this percentage of the total width of the clients screen
// $HeightPercent: The pop-up window will be this percentage of the total height of the clients screen
$Width = intval($Width);
$Height = intval($Height);
$Top = intval($Top);
$Left = intval($Left);
if ($Extras) $Extras = "," . $Extras;
?>
<SCRIPT language="JavaScript" type="text/javascript">
var newwindow = '';
var width = <? print $Width; ?>;
var height = <? print $Height; ?>;
function popup(url)
{
if (newwindow.location && !newwindow.closed)
{
newwindow.location.href = url;
newwindow.focus();
}
else
{
newwindow=window.open(url,'PopUpWindow','width='+width+',height='+height+',top=<? print $Top; ?>,left=<? print $Left; ?><? print $Extras; ?>');
}
if (newwindow.opener == null) newwindow.opener = self;
}
function tidy()
{
if (newwindow.location && !newwindow.closed)
{
newwindow.close();
}
}
</SCRIPT>
<BODY onUnload="tidy()">
<?
}