function NewWindow(mypage, myname, ratio, scroll) {
var w;
var h;
var winl;
var wint;
if (ratio > 1.0) {ratio = 1.0;}
if (ratio <= 0.1){ratio = 0.1;}
if (parseInt(navigator.appVersion) >= 4)
{
   w=screen.availWidth*ratio;
   h=screen.availHeight*ratio;
   winl =(screen.width - w) / 2;
   wint =(screen.availHeight - h) / 2;
}
else
{
   w=screen.width*ratio;
   h=screen.height*ratio*0.9;
   winl = (screen.width - w) / 2;
   wint = (screen.height - h) / 2;
}
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function NewWindowToolbar(mypage, myname, ratio, scroll) {
var w;
var h;
var winl;
var wint;
if (ratio > 1.0) {ratio = 1.0;}
if (ratio <= 0.1){ratio = 0.1;}
if (parseInt(navigator.appVersion) >= 4)
{
   w=screen.availWidth*ratio;
   h=screen.availHeight*ratio;
   winl =(screen.width - w) / 2;
   wint =(screen.availHeight - h) / 2;
}
else
{
   w=screen.width*ratio;
   h=screen.height*ratio*0.9;
   winl = (screen.width - w) / 2;
   wint = (screen.height - h) / 2;
}
// Since there is a toolbar we need to shift the window up since w and h refer to the content part, which will
// otherwise be positioned too far down the screen. 
wint = wint - 40;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'+',toolbar=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

