//
// pat_main.js
//
// 05.04.18  äöü

/*
p_Main_Umfrage
p_Main_Popup_zu
p_Main_resize
p_Main_Snob
p_Main_Retour_zeigen
p_Main_Retour_zeigen2  (nicht verwendet)
p_Main_Confirm_PosNeu
p_Main_Bild_PosNeu
p_Main_obBundesplatz
p_Main_obRuetliwiese
p_Main_obForum
p_Main_obChat
p_Main_obJetzt
p_Main_obShop
p_Main_obBenefiz
p_Main_obPatist
p_Main_Menu_Taste_set
p_Main_Menu_Taste_auf
p_Main_Menu_Taste_weg
p_Main_MaxTextVolumen
p_Main_Daten_holen
f_Main_Lupe_1
p_Main_Trompete
p_Main_Hymne
p_Main_Bild               //shop ersetzen
p_Main_Bild_2             //turm ersetzen
p_Main_BildShop
p_Main_BildTurm
p_Main_BildVaria
p_Main_Bild_zeigen
p_Main_Separate
p_Main_Separate_Sub
p_Main_StatusFix
p_Main_Dummy              //nicht verwendet
*/


/////
/////
function p_Main_Umfrage(nWahl)
{

//Variablen leer
var nVonLinks,nVonOben;

//Variablen füllen


//verarbeiten
  if (nWahl!=0 && top.IsOnline=="ja")
    {
    nVonLinks=parseInt((screen.availWidth-nWinUmfrageBreit)/2);
    nVonOben =parseInt((screen.availHeight-nWinUmfrageHoch)/2);

    //window.open("./php/pat_Poll.php",
    top.oWinUmfrage=window.open("http:///poll/poll.php",
                                "WinUmfrage",
                                "height="+nWinUmfrageHoch+","+
                                "width ="+nWinUmfrageBreit+","+
                                "location=no,menubar=no,resizable=yes,"+
                                "status=no,toolbar=no,"+
                                "left="+nVonLinks+",top="+nVonOben);

//unten gesperrt wegen Popupblocker
//    top.oWinUmfrage.focus();
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Popup_zu()
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (top.oWinInfo!=null
      &&
      typeof top.oWinInfo.close!="undefined")
    {
    top.oWinInfo.close();
    }  //endIf

  if (top.oWinShop!=null
      &&
      typeof top.oWinShop.close!="undefined")
    {
    top.oWinShop.close();
    }  //endIf

  if (top.oWinZusatz!=null
      &&
      typeof top.oWinZusatz.close!="undefined")
    {
    top.oWinZusatz.close();
    }  //endIf

  if (top.oWinUmfrage!=null
      &&
      typeof top.oWinUmfrage.close!="undefined")
    {
    top.oWinUmfrage.close();
    }  //endIf

  if (top.oWinDummy!=null
      &&
      typeof top.oWinDummy.close!="undefined")
    {
    top.oWinDummy.close();
    }  //endIf

  if (top.oWinSeparat!=null
      &&
      typeof top.oWinSeparat.close!="undefined")
    {
    top.oWinSeparat.close();
    }  //endIf

  if (top.oWinBild!=null
      &&
      typeof top.oWinBild.close!="undefined")
    {
    top.oWinBild.close();
    }  //endIf

  if (top.oWinEnde!=null
      &&
      typeof top.oWinEnde.close!="undefined")
    {
    top.oWinEnde.close();
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_resize(cID)
{

//Variablen leer

//Variablen füllen


//verarbeiten
top.document.getElementById(cID).height=this.document.body.scrollHeight;

return;
}  //endProz


/////
/////
function p_Main_Snob()
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (this.document.body.scrollTop>0)  //braucht den Snob
    {
    top.document.getElementById("SnobLayer").style.posTop=
      this.document.body.scrollTop+top.document.body.offsetHeight-60;

    top.document.getElementById("SnobLayer").style.visibility="visible";
    }

  else  //kein Sprung nach oben nötig
    {
    top.document.getElementById("SnobLayer").style.visibility="hidden";
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Retour_zeigen()
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (top.aSystem[5]==1)
    {
    //solange Kopf sichtbar nicht laufen
      if (top.document.body.scrollTop<=125)  //+top.aSystem[6])
        {
        top.document.getElementById("RetourLayer").style.posTop=125;  //+top.aSystem[6];
        }
    //dann laufen
      else
        {
        top.document.getElementById("RetourLayer").style.posTop=
          top.document.body.scrollTop;
        }  //endIf

    top.document.getElementById("RetourLayer").style.visibility="visible";
    }

  else  //kein Rücksprung nötig
    {
    top.document.getElementById("RetourLayer").style.visibility="hidden";
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Retour_zeigen2()
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (top.aSystem[15]==1)
    {
    //solange Kopf sichtbar nicht laufen
      if (top.document.body.scrollTop<=115+top.aSystem[16])
        {
        top.document.getElementById("RetourLayer2").style.posTop=115+top.aSystem[16];
        }
    //dann laufen
      else
        {
        top.document.getElementById("RetourLayer2").style.posTop=
          top.document.body.scrollTop;
        }  //endIf

    top.document.getElementById("RetourLayer2").style.left=
      top.document.body.offsetWidth-90;

    top.document.getElementById("RetourLayer2").style.visibility="visible";
    }

  else  //kein Rücksprung nötig
    {
    top.document.getElementById("RetourLayer2").style.visibility="hidden";
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Confirm_PosNeu()
{

//Variablen leer

//Variablen füllen


//verarbeiten
    top.document.getElementById("ConfirmLayer").style.posTop=
      this.document.body.scrollTop+10;

return;
}  //endProz


/////
/////
function p_Main_Bild_PosNeu()
{

//Variablen leer

//Variablen füllen


//verarbeiten
top.document.getElementById("BildLayer").style.posTop=
  top.document.body.scrollTop+10;

return;
}  //endProz


/////
/////
function p_Main_obBundesplatz(cPfadZusatz)
{
  if (top.kMitBundesplatz=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/bundesplatz/bundesplatz_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/bundesplatz/bundesplatz_start.htm";
    }
  else
    {
    top.cWer ="Der Bundesplatz ist ab";
    top.cWann=top.kMitBundesplatz;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_obRuetliwiese(cPfadZusatz)
{
  if (top.kMitRuetliwiese=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/ruetli/ruetli_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/ruetli/ruetli_start.htm";
    }
  else
    {
    top.cWer ="Die Rütliwiese ist ab";
    top.cWann=top.kMitRuetliwiese;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_obForum(cPfadZusatz)
{
  if (top.kMitForum=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/bundesplatz/bundesplatz_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/morgarten/morgarten_start.htm";
    }
  else
    {
    top.cWer ="Das Forum ist ab";
    top.cWann=top.kMitForum;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_obChat(cPfadZusatz)
{
  if (top.kMitChat=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/bundesplatz/bundesplatz_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/bundesplatz/bundesplatz_start.htm";
    window.open("http://www.bigchat.ch");
    }
  else
    {
    top.cWer ="Der Chat ist ab";
    top.cWann=top.kMitChat;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_obJetzt(cPfadZusatz)
{
  if (top.kMitJetzt=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/bundesplatz/bundesplatz_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/jetzt/index.php";
    }
  else
    {
    top.cWer ='" Jetzt " ist ab';
    top.cWann=top.kMitJetzt;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_obShop(cPfadZusatz)
{
  if (top.kMitShop=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/shop/shop_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/shop/shop_start.htm";
    }
  else
    {
    top.cWer ="Der Shop ist ab";
    top.cWann=top.kMitShop;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_obBenefiz(cPfadZusatz)
{
  if (top.kMitBenefiz=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/bundesplatz/bundesplatz_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/bundesplatz/spende.htm";
    }
  else
    {
    top.cWer ='" Benefiz " ist ab';
    top.cWann=top.kMitBeneziz;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_obLeer(cPfadZusatz)
{
  if (top.kMitLeer=="ja")
    {
    top.iframe_menue.location.href="."+cPfadZusatz+"/leer/leer_menue.htm";
    top.iframe_start.location.href="."+cPfadZusatz+"/leer/leer_start.htm";
    }
  else
    {
    top.cWer ='" Leer " ist ab';
    top.cWann=top.kMitLeer;
    top.oWinInfo=window.open("./seiten/wegenzu_geschlossen.htm",
                         "oWinInfo",
                         "noresizable,"+
                         "scrollbars=0,"+
                         "width=580,height=240,"+
                         "left=220,top=280,"+
                         "dependent=yes");
    }  //endIf
}  //endProz


/////
/////
function p_Main_Menu_Taste_set(xTaste,nTaste)
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (top.aMenutaste[nTaste]==0)
    {
    xTaste.style.color="#000000";                //schwarz
    }
  else
    {
    xTaste.style.color="#FF9900";                //orange
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Menu_Taste_auf(xTaste,nBleibt)
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (nBleibt==0)
    {
    top.xTasteFarbRet=xTaste.style.color;
    }  //endIf
xTaste.style.color="#00FF00";  //FF0000=rot  00FF00=grün 0000FF=blau

return;
}  //endProz


/////
/////
function p_Main_Menu_Taste_weg(xTaste,nTaste,nBleibt)
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (nTaste!=0)
    {
      if (nBleibt==0)
        {
        xTaste.style.color=top.xTasteFarbRet;
        }
      else
        {
          if (top.aMenutaste[nTaste]==0)
            {
            xTaste.style.color="#000000";            //schwarz
            }
          else
            {
            xTaste.style.color="#FF9900";            //orange
            }  //endIf
        }  //endIf
    }
  else
    {
    xTaste.style.color="#000000";                    //schwarz
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_MaxTextVolumen(xTextArea,nMaxZeilen,nMaxKolonne)
{

//Variablen leer
var i,n;
var aDummy    =new Array();

//Variablen füllen
var nAnzahl   =0;
var cDummy    =xTextArea.value;
var nDummy    =parseInt(cDummy.length);


//verarbeiten
aDummy[0]=1;
  for (i=1; i<nDummy; i++)
    {
    //immer nach RETURN  (\n = chr(13)+chr(10) = %0D,%0A)
      if (cDummy.charCodeAt(i)==10 &&
          cDummy.charCodeAt(i-1)==13)
        {
        nAnzahl++;
        aDummy[nAnzahl]=i;
        }  //endIf
    }  //endFor


//nur nach Bedarf freigeben
  if (nMaxKolonne>0)
    {

    //erste Zeile beim ersten mal zu lang
      if (aDummy.length==1)
        {
          if (cDummy.length-aDummy[aDummy.length-1]>nMaxKolonne-1)
            {
            window.alert("1. Zeile zu lang, auf sichtbaren Bereich kürzen");
            }  //endIf
        }  //endIf

    //letzte Zeile zu lang (immer die aktuelle zu unterst)
      else
        {
          if (cDummy.length-aDummy[aDummy.length-1]>nMaxKolonne+1)
            {
            window.alert(aDummy.length+". Zeile zu lang, auf sichtbaren Bereich kürzen");
            }  //endIf
        }  //endIf

    //Zeile dazwischen zu lang, oder auch die erste nachträglich (Eintrag geändert)
      for (i=1; i<aDummy.length; i++)
        {

        //erste Zeilenlänge hat am Angang nicht \n
          if (i==1)
            {
              if (aDummy[i]-aDummy[i-1]>nMaxKolonne)
                {
                window.alert(i+". Zeile zu lang, auf sichtbaren Bereich kürzen");
                }  //endIf
            }

        //alle weiteren Zeilenlängen
          else
            {
              if (aDummy[i]-aDummy[i-1]>nMaxKolonne+2)
                {
                window.alert(i+". Zeile zu lang, auf sichtbaren Bereich kürzen");
                }  //endIf

            }  //endIf

        }  //endFor

    }  //endIf


//zuviele Zeilen
  if (nAnzahl>nMaxZeilen-1)
    {
    window.alert("Die anschliessend aktivierte Zeile liegt ausserhalb  \n\n"+
                 "der Auswertung und würde nicht verwendet/verarbeitet.  \n\n\n"+
                 "Bitte diese ganze Zeile entfernen/löschen !  ");
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Daten_holen(cDatei,cArtikel,nZeile)
{

//Variablen leer

//Variablen füllen
var cReferenz="Art_"+(parseInt(cArtikel)-1).toString();


//verarbeiten
//window.alert("x");
document.getElementById("Art_"+cArtikel+"_"+nZeile.toString()).value=
  f_Main_Lupe_1(cDatei,
                cReferenz,
                nZeile+1,
                "|",
                "");  //¦ |);

return;
}  //endProz


/////
/////
function f_Main_Lupe_1(cDatei,cReferenz,nAb,cTrenner,cBeiLeer)
{

//Variablen leer
var i,n,nDummy,nVon,nBis;

//Variablen füllen
var cResultat  =cBeiLeer;
var lTrenner   =true;
var lLang      =true;
var nMaxZeichen=eval(cDatei+".length;")


//verarbeiten
nDummy=eval(cDatei+".indexOf(cReferenz);");  //Beginn der Zeile

  for (i=1; i<=nAb+1; i++)
    {
    n    =1;
    lLang=true;
      while (lLang==true)
        {
          if (eval(cDatei+".substr(nDummy+n,1);")==cTrenner)
            {
            lLang =false;
            nDummy=nDummy+n;
            }  //endIf
        n++;
        //abbrechen, wenn Trenner nicht gefunden/falsch
          if (n>nMaxZeichen)
            {
            lTrenner=false;
            lLang   =false;
            }  //endIf
        }  //endWhile
      if (i==nAb)
        {
        nVon=nDummy+1;
        }  //endIf
      if (i==nAb+1)
        {
        nBis=nDummy;
        }  //endIf
    }  //endFor

//böser Hund
  if (lTrenner==false)
    {
    window.alert("Aktion nicht berücksichtigt\n\n"+
                 "Trenner nicht gefunden/falsch  >"+cTrenner+"<   ");
    }  //endIf

//Rückgabe vorbereiten
  if (nVon<=nBis)
    {
      if (eval(cDatei+".substring(nVon,nBis);")!="")
        {
        cResultat=eval(cDatei+".substring(nVon,nBis);");  //Normalfall
        }  //endIf
    }  //endIf

return (cResultat);
}  //endFunk


/////
/////
function p_Main_Trompete(nWahl)
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (nWahl!=0)
    {
    document.getElementById("sound_Index").src="./sound/trumpet_leise.wav";
    setTimeout('document.getElementById("sound_Index").src=""',20000);
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Hymne(cPfadZusatzA,cPfadZusatzB,cOrdnerZusatz)
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (top.aSystem[2]==0)
    {
    top.document.getElementById("sound_Hymne").src ="./sound/swissanthem-w2a.mp3";
    top.document.getElementById("sound_Hymne").loop="infinite";
    top.aSystem[2]=1;
    top.hymne_quer.src="."+cPfadZusatzA+"/grafik/hymneaus.gif";
    top.iframe_start.location.href="."+cOrdnerZusatz+"/hymne.htm";
    setTimeout("window.top.scrollTo(0,0)",10);
      if (top.aMenutaste[12]==1)
        {
        top.iframe_menue.hymne_sub.src="."+cPfadZusatzB+"/grafik/hymneaus.gif";
        }  //endIf
    }
  else
    {
    top.document.getElementById("sound_Hymne").src="";
    top.aSystem[2]=0;
    top.hymne_quer.src="."+cPfadZusatzA+"/grafik/hymne.gif";
      if (top.aMenutaste[12]==1)
        {
        top.iframe_menue.hymne_sub.src="."+cPfadZusatzB+"/grafik/hymne.gif";
        }  //endIf
    }  //endIf
return;
}  //endProz


/////
/////
function p_Main_Bild(cDateiName,cBildName)
{

//Variablen leer
var nWinBreit,nWinHoch,nVonLinks,nVonOben;

//Variablen füllen
var cPfadUndDatei ="";
var nMal          =0;
var nMalMax       =2000;
var nZuschlagBreit=16;
var nZuschlagHoch =42;


//verarbeiten
cPfadUndDatei="./bilder/"+cDateiName;

top.oWinBild=window.open("",
                         "WinBild",
                         "width     =100,"+
                         "height    =100,"+
                         "left      =400,"+
                         "top       =300,"+
                         "dependent =yes,"+
                         "location  =no,"+
                         "menubar   =no,resizable=yes,"+
                         "status    =no,"+
                         "toolbar   =no,"+
                         "scrollbars=no");

top.oWinBild.document.open();
top.oWinBild.document.write("<html>");
top.oWinBild.document.write("<head>");
top.oWinBild.document.write("<title>"+
                            cBildName+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "</title>");
top.oWinBild.document.write("</head>");
top.oWinBild.document.write("<body leftmargin  ='0' "+
                                  "topmargin   ='0' "+
                                  "margindwidth='0' "+
                                  "marginheight='0'>");
top.oWinBild.document.write("<table border     ='0' "+
                                   "width      ='100%' "+
                                   "cellspacing='0' "+
                                   "cellpadding='0'>");
top.oWinBild.document.write("<td id   ='mitBild' "+
                                "width='100%'>");
top.oWinBild.document.write("<img src  ="+cPfadUndDatei+" "+
                                 "name ='Bildself' "+
                                 "style='position:absolute;left:2px;top:2px;'>");
top.oWinBild.document.write("</td>");
top.oWinBild.document.write("</table>");
top.oWinBild.document.write("</body>");
top.oWinBild.document.write("</html>");
top.oWinBild.document.close();

  while(top.oWinBild.Bildself.complete==false && nMal<nMalMax)
    {
    nMal++;
    }  //endWihle

  if (nMal>=nMalMax)
    {
    window.alert("Bild konnte nicht geladen werden    \n\n"+
                 cPfadUndDatei+"   \n\n"+
                 nMal+"|"+top.oWinBild.Bildself.complete+"|"+
                 top.oWinBild.Bildself.width+"|"+top.oWinBild.Bildself.height);
    }
  else
    {
    nWinBreit=top.oWinBild.Bildself.width;
    nWinHoch =top.oWinBild.Bildself.height;

      if (nWinHoch>=600)
        {
        nWinBreit=600/nWinHoch*nWinBreit;
        nWinHoch =600;
        }  //endIf
      if (nWinBreit>=800)
        {
        nWinHoch =800/nWinBreit*nWinHoch;
        nWinBreit=800;
        }  //endIf

    nWinBreit=nWinBreit+nZuschlagBreit;
    nWinHoch =nWinHoch+nZuschlagHoch;

    nVonLinks=parseInt((screen.availWidth-nWinBreit)/2);
    nVonOben =parseInt((screen.availHeight-nWinHoch)/2);

    top.oWinBild.moveTo(nVonLinks,nVonOben);
    top.oWinBild.resizeTo(nWinBreit,nWinHoch);

    }  //endIf

window.defaultStatus=nMal;
top.oWinBild.document.focus();

top.document.getElementById("sound_Index").src="./sound/pat6.wav";

return;
}  //endProz


/////
/////
function p_Main_Bild_2(cLageDateiName,cBildName)
{

//Variablen leer
var nWinBreit,nWinHoch,nVonLinks,nVonOben;

//Variablen füllen
var cPfadUndDatei ="";
var nMal          =0;
var nMalMax       =2000;
var nZuschlagBreit=16;
var nZuschlagHoch =42;


//verarbeiten
cPfadUndDatei=cLageDateiName;

top.oWinBild=window.open("",
                         "WinBild",
                         "width     =100,"+
                         "height    =100,"+
                         "left      =400,"+
                         "top       =300,"+
                         "dependent =yes,"+
                         "location  =no,"+
                         "menubar   =no,resizable=yes,"+
                         "status    =no,"+
                         "toolbar   =no,"+
                         "scrollbars=no");

top.oWinBild.document.open();
top.oWinBild.document.write("<html>");
top.oWinBild.document.write("<head>");
top.oWinBild.document.write("<title>"+
                            cBildName+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
                            "</title>");
top.oWinBild.document.write("</head>");
top.oWinBild.document.write("<body leftmargin  ='0' "+
                                  "topmargin   ='0' "+
                                  "margindwidth='0' "+
                                  "marginheight='0'>");
top.oWinBild.document.write("<table border     ='0' "+
                                   "width      ='100%' "+
                                   "cellspacing='0' "+
                                   "cellpadding='0'>");
top.oWinBild.document.write("<td id   ='mitBild' "+
                                "width='100%'>");
top.oWinBild.document.write("<img src  ="+cPfadUndDatei+" "+
                                 "name ='Bildself' "+
                                 "style='position:absolute;left:2px;top:2px;'>");
top.oWinBild.document.write("</td>");
top.oWinBild.document.write("</table>");
top.oWinBild.document.write("</body>");
top.oWinBild.document.write("</html>");
top.oWinBild.document.close();

  while (top.oWinBild.Bildself.complete==false && nMal<nMalMax)
    {
    nMal++;
    }  //endWihle

  if (nMal>=nMalMax)
    {
    window.alert("Bild konnte nicht geladen werden    \n\n"+
                 cPfadUndDatei+"   \n\n"+
                 nMal+"|"+top.oWinBild.Bildself.complete+"|"+
                 top.oWinBild.Bildself.width+"|"+top.oWinBild.Bildself.height);
    }
  else
    {
    nWinBreit=top.oWinBild.Bildself.width;
    nWinHoch =top.oWinBild.Bildself.height;

      if (nWinHoch>=600)
        {
        nWinBreit=600/nWinHoch*nWinBreit;
        nWinHoch =600;
        }  //endIf
      if (nWinBreit>=800)
        {
        nWinHoch =800/nWinBreit*nWinHoch;
        nWinBreit=800;
        }  //endIf

    nWinBreit=nWinBreit+nZuschlagBreit;
    nWinHoch =nWinHoch+nZuschlagHoch;

    nVonLinks=parseInt((screen.availWidth-nWinBreit)/2);
    nVonOben =parseInt((screen.availHeight-nWinHoch)/2);

    top.oWinBild.moveTo(nVonLinks,nVonOben);
    top.oWinBild.resizeTo(nWinBreit,nWinHoch);

    }  //endIf

window.defaultStatus=nMal;
top.oWinBild.document.focus();

top.document.getElementById("sound_Index").src="./sound/pat6.wav";

return;
}  //endProz


/////
/////
function p_Main_BildShop(cDateiName,cBildName)
{

//Variablen leer

//Variablen füllen

//verarbeiten
top.document.getElementById("BildInhalt").src="./shop/bilder/"+cDateiName;
top.document.getElementById("BildTitel").innerText=" "+cBildName;

setTimeout("p_Main_Bild_zeigen()",3000);

return;
}  //endProz


/////
/////
function p_Main_BildTurm(cLageDatei,cBildName)
{

//Variablen leer

//Variablen füllen


//verarbeiten
top.document.getElementById("BildInhalt").src="./bundesplatz/"+cLageDatei;
top.document.getElementById("BildTitel").innerText=" "+cBildName;

setTimeout("p_Main_Bild_zeigen()",3000);

return;
}  //endProz


/////
/////
function p_Main_BildVaria(cLageDatei,cBildName)
{

//Variablen leer

//Variablen füllen


//verarbeiten
top.document.getElementById("BildInhalt").src=cLageDatei;
top.document.getElementById("BildTitel").innerText=" "+cBildName;

setTimeout("p_Main_Bild_zeigen()",3000);

return;
}  //endProz


/////
/////
function p_Main_Bild_zeigen()
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (top.document.getElementById("BildInhalt").height>500)
    {
    top.document.getElementById("BildInhalt").height=500;
    }  //endIf

top.document.getElementById("BildLayer").style.left=
  parseInt((screen.availWidth-top.document.getElementById("BildInhalt").width)/2);

top.document.getElementById("BildLayer").style.visibility=
  "visible";

top.document.getElementById("sound_Index").src="./sound/camera.wav";

}  //endProz


/////
/////
function p_Main_Separate(nTyp,cWWW)
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (nTyp==1)
    {
    top.document.getElementById("sound_Index").src="./sound/pat8.wav";
    }  //endIf
  if (nTyp==2)
    {
    top.document.getElementById("sound_Index").src="./sound/battle.wav";
    }  //endIf
  if (nTyp==3)
    {
    top.document.getElementById("sound_Index").src="./sound/woow.wav";
    }  //endIf
  if (nTyp==4)
    {
    top.document.getElementById("sound_Index").src="./sound/dingdong.wav";
    }  //endIf
  if (nTyp==5)
    {
    top.document.getElementById("sound_Index").src="./sound/beifall.wav";
    }  //endIf

top.oWinSeparat=window.open(cWWW,
                            "WinSeparat",
                            "width     ="+top.kWinBredu+","+
                            "height    ="+top.kWinHredu+","+
                            "left      =0,"+
                            "top       ="+top.kAbTop+","+
                            "menubar   =yes,"+
                            "location  =yes,"+
                            "resizable =yes,"+
                            "scrollbars=yes,"+
                            "status    =yes,"+
                            "toolbar   =yes");

return;
}  //endProz


/////
/////
function p_Main_Separate_Sub(nTyp,cWWW)
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (nTyp==1)
    {
    opener.top.document.getElementById("sound_Index").src="./sound/pat8.wav";
    }  //endIf
  if (nTyp==2)
    {
    opener.top.document.getElementById("sound_Index").src="./sound/battle.wav";
    }  //endIf
  if (nTyp==3)
    {
    opener.top.document.getElementById("sound_Index").src="./sound/woow.wav";
    }  //endIf
  if (nTyp==4)
    {
    opener.top.document.getElementById("sound_Index").src="./sound/dingdong.wav";
    }  //endIf
  if (nTyp==5)
    {
    opener.top.document.getElementById("sound_Index").src="./sound/beifall.wav";
    }  //endIf

opener.top.oWinDummy=window.open(cWWW,
                                 "WinDummy",
                                 "width     ="+opener.top.kWinBredu+","+
                                 "height    ="+(opener.top.kWinHredu-
                                                (opener.top.kAbTop*2+4))+","+
                                 "left      =0,"+
                                 "top       ="+(opener.top.kAbTop*2+4)+","+
                                 "menubar   =yes,"+
                                 "location  =yes,"+
                                 "resizable =yes,"+
                                 "scrollbars=yes,"+
                                 "status    =yes,"+
                                 "toolbar   =yes");

return;
}  //endProz


/////
/////
function p_Main_StatusFix()
{

//Variablen leer

//Variablen füllen


//verarbeiten
  if (top.aSystem[17]==1)
    {
    window.status="Popupblocker dauerhaft deaktivieren, Seite sonst eingeschränkt";
    setTimeout("p_Main_StatusFix()",500);
    }
  else
    {
    window.status="";
    }  //endIf

return;
}  //endProz


/////
/////
function p_Main_Dummy()
{

//Variablen leer

//Variablen füllen


//verarbeiten


return;
}  //endProz
