// =========================================================================================*
//   Globale Variablen
// =========================================================================================*
   var vScreenWidth = screen.availWidth;
   var vScreenHeight = screen.availHeight;
   var vNewWin = null;
   var vTimeOut = 0;
// =========================================================================================*
//   Funktion - PopUp Fenster &ouml;ffnen
// =========================================================================================*
   function PopUp(pClose,pUrl,pWinName,pWidth,pHeight,pScroll,pPos,pTime)
    { vClose = pClose;
      vUrl = pUrl;
      vWinName = pWinName;
      vWidth = pWidth;
      vHeight = pHeight;
      vScroll = pScroll;
      vPosXY = pPos;
      vPosX = 160;
      vPosY = 0;
      vTime = pTime;
// ------------------------------------------------------------------------------------------*
//   Parameterpr&uuml;fung
// ------------------------------------------------------------------------------------------*
      if ((vClose != 0) && (vClose != 1) && (vClose != 2)) { vClose = 0; }
      if ((vScroll != 0) && (vScroll != 1)) { vScroll = 0; }
      if ((vPosXY != 0) && (vPosXY != 1) && (vPosXY != 2)) { vPosXY = 0; }
      vScroll == 0 ? vScroll = "no" : vScroll = "yes";
      if (vTime < 6) { vTime = 0; }
      vTime == 0 ? vTimeOut = 5000 : vTimeOut = (vTime * 1000);
// ------------------------------------------------------------------------------------------*
//   Scrollbalken notwendig ?
// ------------------------------------------------------------------------------------------*
      if(vHeight > vScreenHeight) {vHeight = vScreenHeight; vWidth = (vWidth + 20); vScroll = "yes"; }
// ------------------------------------------------------------------------------------------*
//   Fenster zentrieren
// ------------------------------------------------------------------------------------------*
      if (vPosXY == 1) { vPosX = (vScreenWidth/2)-(vWidth/2); vPosY = (vScreenHeight/2)-(vHeight/2); }
      if (vPosXY == 2) { vPosY = (vScreenHeight - vHeight + 5); }
// ------------------------------------------------------------------------------------------*
//   Fenstereigenschaften definieren
// ------------------------------------------------------------------------------------------*
      vWinProp = "width=" + vWidth + ",height=" + vHeight;
      vWinProp = vWinProp +  ",top=" + vPosY + ",left=" + vPosX;
      vWinProp = vWinProp +  ",scrollbars=" + vScroll;
      vWinProp = vWinProp + ",resizable=no,toolbar=no,menubar=no,location=no,copyhistory=no,directories=no";
// ------------------------------------------------------------------------------------------*
//   Altes Fenster schlie&szlig;en
// ------------------------------------------------------------------------------------------*
      if (vNewWin && !vNewWin.closed) { vNewWin.close(); }
// ------------------------------------------------------------------------------------------*
//   Neues Fenster &ouml;ffnen
// ------------------------------------------------------------------------------------------*
      vNewWin = window.open(vUrl,vWinName,vWinProp);
      vNewWin.focus();
// ------------------------------------------------------------------------------------------*
//   Fenster zeitgesteuert schlie&szlig;en
// ------------------------------------------------------------------------------------------*
      if (vClose == 2) { window.setTimeout( "WinClose()", vTimeOut ); }
      return;
    }
// =========================================================================================*
//   Funktion - PopUp Fenster schlie&szlig;en (Zeitsteuerung)
// =========================================================================================*
   function WinClose()
     { vNewWin.close(); }
// =========================================================================================*
//   Funktion - Fenstergr&ouml;&szlig;e ermitteln
// =========================================================================================*
   function PopUpSize()
    { vWinWidth = document.getElementById("Tabelle").offsetWidth;
      vWinHeight = document.getElementById("Tabelle").offsetHeight;
      document.getElementById("Fenstergroesse").style.fontStyle = "italic";
      document.getElementById("Fenstergroesse").innerHTML = (vWinWidth + "/" + vWinHeight);
    }
// ================================================================================================*
//    Absolute Position "X" (vom linken Fensterrand) ermitteln
//   (parm "pRelative" im Aufruf auf "true" setzen f&uuml;r relative Position zum vorhergehenden Element)
// ================================================================================================*
function getPosX(pObj,pRelative)
   { vPosX = 0;
     if (typeof(pObj) == "object" && document.getElementById)
        { vPosX = pObj.offsetLeft;
          if (pObj.offsetParent && !pRelative) { vPosX += getPosX(pObj.offsetParent); }
          return vPosX;
       }
     else  { return false; }
   }
// ================================================================================================*
//    Absolute Position "Y" (vom oberen Fensterrand) ermitteln
//   (parm "pRelative" im Aufruf auf "true" setzen f&uuml;r relative Position zum vorhergehenden Element)
// ================================================================================================*
function getPosY(pObj,pRelative)
    { vPosY = 0;
      if (typeof(pObj) == "object" && document.getElementById)
         { vPosY = pObj.offsetTop;
           if (pObj.offsetParent && !pRelative) { vPosY += getPosY(pObj.offsetParent); }
           return vPosY;
         }
      else  { return false; }
    }
//=========================================================================================*
//   Funktion - Empfehlung des Monats
//=========================================================================================*
  function BrauMon()
   { window.open("http://www.drei-kronen.de", "brauerei"); }

  function GastMon()
   { window.open("http://www.zoiglstube.net", "gastronomie"); }

  function BuchMon()
   { window.open("http://www.arsvivendi.com/programm?page=shop.product_details&amp;flypage=flypage2.tpl&amp;product_id=963&amp;category_id=155", "literatur"); }

  function MusmMon()
   { window.open("http://museum.bamberg.de/historisches-museum-bamberg/ausstellungsdetail/news/vom-himmel-hoch-boehmische-krippenlandschaften.html", "museum"); }
// =========================================================================================*
//   Funktion - PopUp Fenster "LagePlan" &ouml;ffnen
// =========================================================================================*
 function LagePlan(pName)
   { vName = pName;
     vPath = "../karten/";
     vSuffix = ".html";
     vFullName = (vPath+vName+vSuffix);
     PopUp(0,vFullName,"ML00",625,519,0,0,0);
     return;
    }
//=========================================================================================*
//   PopUp Fenster - Navigationsleiste
//=========================================================================================*
  function nsBockBier(pUrl)
   { PopUp(0,pUrl,"BB00",575,3150,0,0,0); }

  function nsBockBierKal(pUrl)
   { PopUp(0,pUrl,"BB01",575,3150,0,0,0); }

  function nsLandPartie(pUrl)
   { PopUp(0,pUrl,"LP00",620,732,0,0,0); }

  function nsInfoBlatt(pUrl)
   { PopUp(0,pUrl,"IB00",402,461,0,0,0); }

  function nsInfoLink(pUrl)
   { PopUp(0,pUrl,"IL00",410,640,0,0,0); }
//=========================================================================================*
//   PopUp Fenster - Fr&auml;nkische Brauereien
//=========================================================================================*
  function BrauFilz(pRb)
   { vRb = ("braufilze.html?B=" + pRb); PopUp(0,vRb,"BF00",345,380,0,0,0); }

  function fbStern(pUrl)
   { PopUp(2,pUrl,"IF00",410,152,0,0,20); }

  function fbAlaska(pUrl)
   { PopUp(0,pUrl,"PU54",610,350,0,0,0); }

  function PlanOm01()
   { PopUp(0,"../karten/om01.html","OM01",625,519,0,0,0); }
//=========================================================================================*
//   PopUp Fenster - Bierkompendium
//=========================================================================================*

//=========================================================================================*
//   PopUp Fenster - Braunb&auml;r Bruno (Archiv)
//=========================================================================================*
  function BrunoRoute()
   { PopUp(0,"brunoroute.html","BR00",640,480,0,0,0); }
  function BrunoShirt()
   { PopUp(2,"brunoshirt.html","BS00",440,305,0,0,20); }
  function BrunoKlamm()
   { PopUp(2,"brunoklamm.html","BK00",500,650,0,0,20); }
  function BaerAustria()
   { PopUp(2,"baerenaustria.html","BA00",460,525,0,0,20); }
  function BrunoProst()
   { PopUp(2,"brunoprost.html","BP00",320,250,0,0,20); }
//=========================================================================================*
//   PopUp Fenster - Ende
//=========================================================================================*
