/* PopUp Funktion */
var popupWin = null;
function openWindow(winPage, winName, winWidth, winHeight) {
  winWidth    = (winWidth==null) ? 300 : winWidth;
  winHeight   = (winHeight==null) ? 300 : winHeight;
  winLeft     = (window.outerWidth || screen.availWidth) ? (window.outerWidth - winWidth || screen.availWidth - winWidth ) / 2 : 100;
  winTop      = (window.outerHeight || screen.availHeight) ? (window.outerHeight - winHeight || screen.availHeight - winHeight) / 2 : 100;
  winSettings = "width=" + winWidth + ",height=" + winHeight + ",top=" + winTop + ",left=" + winLeft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
  if (popupWin) {
    if (popupWin.closed) {
      popupWin = window.open(winPage, winName, winSettings);
      popupWin.focus();
    } else {
      popupWin.focus();
    }
  } else {
    popupWin = window.open(winPage, winName, winSettings);
    popupWin.focus();
  }
}

