var formLoaded     = "N";
var adminapplet    = "N";
var documentLayers = (document.layers) ? "Y":"N";
var documentAll    = (document.all)    ? "Y":"N";
var netscapeGecko  = (navigator.appName=="Netscape" && parseInt(navigator.appVersion) >= 5.0) ? "Y":"N";
function onLoad()
{
  formLoaded = "Y";
  setHandleSize('loadsize');
}
function onPrint()
{
  window.print();
}
function resize()
{
  setHandleSize('resize');
}
function setHandleSize(cookieName)
{
  winWidth  = 1024;
  winHeight = 768;
  if( typeof( window.innerWidth ) == 'number' )
  {
    //Non-IE
    winWidth  = window.innerWidth;
    winHeight = window.innerHeight;
  }
  else 
  if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight )) 
  { 
    //IE 6+ in 'standards compliant mode' 
    winWidth  = document.documentElement.clientWidth; 
    winHeight = document.documentElement.clientHeight; 
  }  
  else 
  if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )  
  { 
    //IE 4 compatible 
    winWidth  = document.body.clientWidth; 
    winHeight = document.body.clientHeight; 
  }  
  setCookie (cookieName, winWidth+"x"+winHeight );
  setFrameSize ( winWidth, winHeight );
  setAppletSize ( winWidth, winHeight );
}
function setFrameSize(winWidth, winHeight)
{ 
}
function setAppletSize(winWidth, winHeight)
{ 
  if ( adminapplet == "Y" )
  {
    x  =  winWidth-44;
    if ( x < 800 )
      x = 800;
    y  =  winHeight-140;
    if ( y < 500 )
      y = 500;
    setObjectWidth("admapplet",x);
    setObjectHeight("admapplet",y);
  }
}
function setCookie(name, value)
{ 
  var coo = name + "=" + escape(value);
  document.cookie = coo;
} 
function setObjectHeight(id,height)
{
  if ( id             == ""  ) return;
  if ( formLoaded     == "N" ) return;
  if ( netscapeGecko  == "Y" )
    document.getElementById(id).style.height=height;
  else
  if ( documentAll    == "Y" )
    document.all[id].style.height=height;
  else
  if ( documentLayers == "Y" )
    document.layers[id].height=height;
}
function setObjectWidth(id,width)
{
  if ( id             == ""  ) return;
  if ( formLoaded     == "N" ) return;
  if ( netscapeGecko  == "Y" )
    document.getElementById(id).style.width=width;
  else
  if ( documentAll    == "Y" )
    document.all[id].style.width=width;
  else
  if ( documentLayers == "Y" )
    document.layers[id].width=width;
}

