/*
$Header: //holrel/r2.0/hol/wwwroot/base/js/popup.js#1 $
+=============================================================================+
|  Copyright(c) 1999-2001 by Hilti Corp. All rights reserved.                 |
|                                                                             |
|  Hilti is a registered trademark of Hilti Corp.                             |
|  FL-9494 Schaan; Principality of Liechtenstein                              |
|                                                                             |
|  PRODUCT: HOL - Hilti Online                                                |
+=============================================================================+

PURPOSE:
  Client side functions to display a popup window.
*/

function openPopup(url, popupname, y, x) {
  if (window.popup) {
    if (!(popup.closed)) {
      popup.close();
    }
    openwin(url, popupname, y, x);
  }
  else {
    openwin(url, popupname, y, x);
  }
}

function openwin(url, popupname, y, _x) {
  
  var x = ((_x != "") && (_x != null))? _x : 610;
  popup = window.open(url, popupname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + x + ",height=" + y);
  if (navigator.appName == "Microsoft Internet Explorer") {
    popup.resizeTo((parseInt(x)+10),(parseInt(y)+50));
  }
  else {
    popup.resizeTo(x,y);
    if (navigator.userAgent.indexOf("Mozilla/3.0") != -1  || navigator.userAgent.indexOf("Mozilla/4.0") != -1) {
      popup.focus();
    }
  }
}
