//
// Dateiname:     popup.js - JavaScript-Datei
// Beschreibung:  Zum Oeffnen von Popup-Fenstern
//
// Erstellt im April 1999 von Peter Bittner
//


//----
// Procedure: PopupWindow()
//
// Oeffnet ein neues Fenster der gewuenschten Groesse und zeigt
// die angegebene Datei darin an. Bei Weglassen des letzten
// Parameters (properties) werden default-Eigenschaften verwendet.
//-------------------
function PopupWindow(fileName, width, height, properties)
{
  var dateToday = new Date();				// aktuelle Zeit ermitteln
  var windowName = 'Popup' + dateToday.getTime();	// create unique name to open new window
  if (!properties)  properties = '';			// assign empty string if undefined
  if (properties.indexOf('directories') == -1)  properties += ',directories=no';
  if (properties.indexOf('location') == -1)     properties += ',location=no';
  if (properties.indexOf('menubar') == -1)      properties += ',menubar=no';
  if (properties.indexOf('resizable') == -1)    properties += ',resizable=no';
  if (properties.indexOf('scrollbars') == -1)   properties += ',scrollbars=yes';
  if (properties.indexOf('status') == -1)       properties += ',status=no';
  if (properties.indexOf('toolbar') == -1)      properties += ',toolbar=no';
  if (properties.indexOf(',') > 0)              properties = ',' + properties;
  window.open(fileName, windowName, 'width=' + width + ',height=' + height + properties);
} // end of PopupWindow()


//-- "popup.js" -------------------------------------------- EOF --
