<!--
/*
a good size for a lrg window is 690x480
scr, menu, stat, tool are set as either 0 (no) or 1 (yes)
name can be set to 0 as well unless you specifically need to have it named
*/
var win;
function openWin(file,w,h,scr,menu,stat,tool,name) 
{
	win = window.open(file,name,"scrollbars="+scr+",resizable=yes,menubar="+menu+",status="+stat+",toolbar="+tool+",width="+w+",height="+h+",screenx=0,screeny=0,top=0,left=0");
	win.focus();
}


/*
Three functions that allow the popup to be controlled as a percentage of
the screen resolution. 
"openWinWH" adjusts both dimensions,
"openWinW" adjusts the width while maintaining a fixed height,
"openWinH" adjusts the height while maintaining a fixed width.
*/
var winWH;
function openWinWH(file,wpct,hpct,scr,menu,stat,tool,name) 
{
  var aw = screen.availWidth * wpct;
  var ah = screen.availHeight * hpct;
	winWH = window.open(file,name,"scrollbars="+scr+",resizable=yes,menubar="+menu+",status="+stat+",toolbar="+tool+",width="+aw+",height="+ah+",screenx=0,screeny=0,top=0,left=0");
	winWH.focus();
}


var winW;
function openWinW(file,wpct,h,scr,menu,stat,tool,name) 
{
  var aw = screen.availWidth * wpct;
	winW = window.open(file,name,"scrollbars="+scr+",resizable=yes,menubar="+menu+",status="+stat+",toolbar="+tool+",width="+aw+",height="+h+",screenx=0,screeny=0,top=0,left=0");
	winW.focus();
}


var winH;
function openWinH(file,w,hpct,scr,menu,stat,tool,name) 
{
  var ah = screen.availHeight * hpct;
	winH = window.open(file,name,"scrollbars="+scr+",resizable=yes,menubar="+menu+",status="+stat+",toolbar="+tool+",width="+w+",height="+ah+",screenx=0,screeny=0,top=0,left=0");
	winH.focus();
}




/*
This code resizes the popup window to height and width defined by 
the available screen resolution. This can be a percentage of the screen
by using the aw, ah variables.
*/
var winRes;
function openWinRes(file,wpct,hpct,scr,menu,stat,tool,name) 
{

    var screenRes = getScreenRes(80);
    var width;
    var height;
    
    if ( screenRes == "1280x1024")
    {    
      width = 1200;   
      height = 500;    
    }
    else if ( screenRes == "1152x864")
    {
      width = 1072; 
      height = 500; 
    }
    else if ( screenRes == "1024x768")
    {
      width = 944; 
      height = 500; 
    }
    else
    {
      width = 740; 
      height = 500; 
    }
    
  var aw = screen.availWidth * wpct;
  var ah = screen.availHeight * hpct;
	winRes = window.open(file,name,"scrollbars="+scr+",resizable=yes,menubar="+menu+",status="+stat+",toolbar="+tool+",width="+width+",height="+height+",screenx=0,screeny=0,top=0,left=0");
	winRes.focus();
}


function getScreenRes(errorMargin)
{
    var screenX = screen.availWidth;

    if ( screenX >= (1280-errorMargin))
        return "1280x1024";

    if (screenX >= (1152-errorMargin))
        return "1152x864";

    if ( screenX >= (1024-errorMargin))
        return "1024x768";

    return "800x600";

}
//-->