// JavaScript Document
var attribWithoutAll="location=no,menubar=no,toolbar=no,status=no";
attribWithoutAll+=",resizable=yes,scrollbars=yes,width=1000,height=800";

var subwindow=0;
  /* Initialisierung der Variablen, die spaeter mal auf das Fensterobjekt verweist */

function ClosePopUp()
/* diese Funktion schliesst (so geoeffnet) das Popup-Fenster */
{
  if (!subwindow)          /* wenn noch nicht geoeffnet */
    return;                /* nix zu tun, Abbruch */
  if (subwindow.closed)    /* wenn schon zugemacht */
    return;                /* nix zu tun, Abbruch */
  subwindow.close();       /* mach zu */
}

function PopUp(site)
{
  ClosePopUp();          /* erstmal bisher geoeffnetes Popup zumachen */
  subwindow=window.open(site,"PfarreAnger",attribWithoutAll);
  subwindow.moveTo(10,50); /* Fenster nach links oben schieben */
}

/*########################################################################*/
var WindowObjectReference = null; // global variable
var PreviousUrl; /* global variable which will store the
                    url currently in the secondary window */

function openRequestedSinglePopup(strUrl)
{
  if(WindowObjectReference == null || WindowObjectReference.closed)
  {
   WindowObjectReference = window.open(strUrl, "SingleSecondaryWindowName",
         "resizable=yes,scrollbars=yes,status=yes");
  }
  else if(previousUrl != strUrl)
  {
   WindowObjectReference = window.open(strUrl, "SingleSecondaryWindowName",
      "resizable=yes,scrollbars=yes,status=yes");
    /* if the resource to load is different,
       then we load it in the already opened secondary window and then
       we bring such window back on top/in front of its parent window. */
   WindowObjectReference.focus();
  }
  else
  {
    WindowObjectReference.focus();
  };
  PreviousUrl = strUrl;
  /* explanation: we store the current url in order to compare url
     in the event of another call of this function. */
}
