// variabele blnNS4 is true if browser is Netscape 4+, otherwise false
  var blnNS4 = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4))
      || (navigator.appName == "Mozilla") || (navigator.appName == "Konqueror") || (navigator.appName == "Safari"));


//*** opens a popup window ***
//*** intWidth, intHeight optional; default: full size
//*** intLeft, intTop optional; default: in the middle of the screen
//*** blnScrollbars, blnResize, blnToolbar, blnLocation, blnDirectories, blnStatus, blnMenubar optional; default: all true

function openPopup(strUrl, strNaam, intWidth, intHeight, intLeft, intTop, blnScrollbars, blnResize, blnToolbar, blnLocation, blnDirectories, blnStatus, blnMenubar) {
  var intStartBarheight, intLeft, intTop, strAttrib;
  var popup;
 
  
  
  intStartBarHeight = 58; // Windows Start bar + title bar = 58px
  intBordersWidth = 10; //width borders popup window + scrollbar = 10px

  if ((intWidth == null) || (intWidth > screen.width - intBordersWidth ))
    intWidth = screen.width - intBordersWidth;
  if ((intHeight == null) || (intHeight > (screen.height - intStartBarHeight)))
    intHeight = screen.height - intStartBarHeight;

  if (intLeft == null) {
    intLeft = (screen.width - intWidth) / 2;
    if (intLeft < intBordersWidth) intLeft = 0;
  }
  if (intTop == null) {
    intTop = (screen.height - intHeight) / 2;
    if (intTop < intStartBarHeight) intTop = 0;
  }

  if (blnScrollbars == null) blnScrollbars = true;
  if (blnResize == null) blnResize = true;
  if (blnToolbar == null) blnToolbar = true;
  if (blnLocation == null) blnLocation = true;
  if (blnDirectories == null) blnDirectories = true;
  if (blnStatus == null) blnStatus = true;
  if (blnMenubar == null) blnMenubar = true;

  
  // Generate strAttrib: containing all attributes
  if (blnNS4) {
    strAttrib = "screenX=" + intLeft + ",screenY=" + intTop + ",";

    strAttrib += (blnToolbar) ? "toolbar=yes," : "";
    strAttrib += (blnLocation) ? "location=yes," : "";
    strAttrib += (blnDirectories) ? "directories=yes," : "";
    strAttrib += (blnStatus) ? "status=yes," : "";
    strAttrib += (blnMenubar) ? "menubar=yes," : "";
    strAttrib += (blnScrollbars) ? "scrollbars=yes," : "";
    strAttrib += (blnResize) ? "resizable=yes," : "";
  }
  else {
    strAttrib = "left=" + intLeft + ",top=" + intTop + ",";

    strAttrib += (blnToolbar) ? "toolbar=yes," : "toolbar=no,";
    strAttrib += (blnLocation) ? "location=yes," : "location=no,";
    strAttrib += (blnDirectories) ? "directories=yes," : "directories=no,";
    strAttrib += (blnStatus) ? "status=yes," : "status=no,";
    strAttrib += (blnMenubar) ? "menubar=yes," : "menubar=no,";
    strAttrib += (blnScrollbars) ? "scrollbars=yes," : "scrollbars=no,";
    strAttrib += (blnResize) ? "resizable=yes," : "resizable=no,";
  }

  strAttrib += "width=" + intWidth + ",height=" + intHeight;

  popup = window.open(strUrl, strNaam, strAttrib);
  popup.focus();
}