var popup = null;
function linkpopupwind(url) {
  setTimeout('window.open(\''+url+'\', "fastpass", "left=100,top=100,width=300,height=200,screenX=0,screenY=0,scrollbars=no,menubar=no,toolbar=no,resizable=yes,status=no,location=no")', 0);
}

function CreateWnd (file, width, height, resize)
{
  var doCenter = false;
  if((popup == null) || popup.closed)
  {
    attribs = "";
    if(resize) size = "yes"; else size = "no";
    for(var item in window)
    { if(item == "screen") { doCenter = true; break; } }

    if(doCenter)
    {	/*/ center the window /*/
      // if the screen is smaller than the window, override the resize setting
      if(screen.width <= width || screen.height <= height) size = "yes";
      WndTop  = (screen.height - height) / 2;
      WndLeft = (screen.width  - width)  / 2;
      // collect the attributes
      attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
      "status=no,toolbar=no,directories=no,menubar=no,location=no,top=" + WndTop + ",left=" + WndLeft;
    }
    else
    {
      if(navigator.appName=="Netscape" && navigator.javaEnabled())
      {	/*/ center the window /*/
        var toolkit = java.awt.Toolkit.getDefaultToolkit();
        var screen_size = toolkit.getScreenSize();

        // if the screen is smaller than the window, override the resize setting
        if(screen_size.width <= width || screen_size.height <= height) size = "yes";
        WndTop  = (screen_size.height - height) / 2;
        WndLeft = (screen_size.width  - width)  / 2;
        // collect the attributes
        attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
        "status=no,toolbar=no,directories=no,menubar=no,location=no,top=" + WndTop + ",left=" + WndLeft;
      }
      else
      {	/*/ use the default window position /*/

        // override the resize setting
        size = "yes";
        // collect the attributes
        attribs = "width=" + width + ",height=" + height + ",resizable=" + size + ",scrollbars=" + size + "," + 
        "status=no,toolbar=no,directories=no,menubar=no,location=no";
      }
    }

    // create the window
    popup = open(file, "", attribs);
  }
  else
  {
    DestroyWnd();
    CreateWnd(file, width, height, resize);
  }
}

function DestroyWnd ()
{
  // close the current window
  if(popup != null)
  {
    popup.close();
    popup = null;
  }
}

