var popupWindow = false;
var NS4      = (document.layers);
var IE4      = (document.all);
var isMac    = (navigator.appVersion.indexOf("Mac")!=-1);

function konsole(url,width,height,screenX,screenY) {

  if (NS4 && !isMac) {                                            // use this script for Netscape4+ on a PC
    if(popupWindow && popupWindow.open && !popupWindow.closed) {  // prueft, ob konsole noch nicht geoeffnet, bzw. schon wieder geschlossen wurde
      popupWindow.close();
      popupWindow = window.open('','popupWindow','width=' + width + ',height=' + height + ',screenX=' + screenX + ',screenY=' + screenY + ', resizable=no, scrollbars=yes, toolbar=no, menubar=no, location=no, dependent=yes');
    }
    else
      popupWindow = window.open('','popupWindow','width=' + width + ',height=' + height + ',screenX=' + screenX + ',screenY=' + screenY + ', resizable=no, scrollbars=yes, toolbar=no, menubar=no, location=no, dependent=yes');
  }
  
  else if (IE4 && isMac) {                                        // use this script for InternetExplorer4+ on a Mac
    if(popupWindow && popupWindow.open && !popupWindow.closed) {  // prueft, ob konsole noch nicht geoeffnet, bzw. schon wieder geschlossen wurde
      popupWindow.close();
    }
    popupWindow = window.open('','popupWindow','width=' + width + ',height=' + height + ',top=' + screenX + ',left=' + screenY + ', resizable=no, scrollbars=yes, toolbar=no, menubar=no, location=no, dependent=yes');
  }
  
  else if (NS4 && isMac) {                                        // use this script for Netscape4+ on a Mac
    if(popupWindow && popupWindow.open && !popupWindow.closed) {  // prueft, ob konsole noch nicht geoeffnet, bzw. schon wieder geschlossen wurde
      popupWindow.close();
    // alert('hello');
    }
    popupWindow = window.open('','popupWindow','width=' + width + ',height=' + height + ',screenX=' + screenX + ',screenY=' + screenY + ', resizable=no, scrollbars=yes, toolbar=no, menubar=no, location=no, dependent=yes');
  }
  
  else {                                                          // use this script for InternetExplorer4+ on a PC and anything else
    if(popupWindow && popupWindow.open && !popupWindow.closed)    // prueft, ob konsole noch nicht geoeffnet, bzw. schon wieder geschlossen wurde
      popupWindow.resizeTo(width,height+20);
    else
      popupWindow = window.open('','popupWindow','width=' + width + ',height=' + height + ',top=' + screenX + ',left=' + screenY + ', resizable=no, scrollbars=yes, toolbar=no, menubar=no, location=no, dependent=yes');
  }
  
  if (popupWindow != null) {                                    // 'null' falls es nicht erstellt/geoeffnet werden kann (due to low memory, for example). 
    popupWindow.location.href = url;
    popupWindow.focus();                                 // holt das erzeugte Fenster in den Vordergrund
  }

}

/* Aufruf im [a href tag] 
<a href="Pfad" class="Wert des style sheets" onmouseover="status='Statuszeilentext';return true" onmouseout="status='';return true" onclick="konsole('Pfad_der_konsole.html',500,350,0,0);" onfocus="blur();">Geltungsbereich</a><br>
*/


/* **** wenn man vom Popup auf eine andere Seite springen will ****************
################ in den <head> einzubinden - (in das Javascript) ##############################

function go_kontakt() {
  window.opener.location.href="../kontakt.html";
  window.close();
}

Aufruf erfolgt dann im [a href tag] 
<a href="javascript:go_kontakt()" onmouseover="status='zum Kontaktformular';return true" onmouseout="status='';return true">
*/



/* **** wenn man das POPUP separat schlieszen will ****************
################ in den <head> einzubinden - in das Javascript ##############################

<a href="javascript:window.close()">
*/



