
var Browser;
browserWeiche();

var xPfad;
pfadErmitteln();

/* if (Browser=='IE' || Browser=='OP') {  // Notzugang zur Sitemap
 document.writeln('<div style="position:absolute; top:2px; right: 5px; color: #EFEFEF; cursor:pointer;"');
 document.writeln('onMousedown=parent.window.location.href="'+ xPfad + 'sitemap/navigation.html"');
 document.writeln(' >SITEMAP</div>');
} */

var fensterBreite=0;
var fensterHoehe=0;;
var OPbreite=0;

var ohneLogo = (window.location.search=="?ohneLogo") ?true :false;
var ohneLogo2 = (ohneLogo==true) ?"?ohneLogo" :"";

function breite() {
  if( screen.width>= 820) document.getElementById('hf').style.width='820';
  else document.getElementById('hf').style.width='100%';
  if (Browser=='OP') {
    if(document.body.offsetWidth) OPbreite =document.body.offsetWidth;
    if(window.innerWidth)         OPbreite=window.innerWidth;
    OPbreite=(OPbreite>820) ?(OPbreite-820)/2 :0;
    document.getElementById('hf').style.marginLeft=OPbreite;
  }
  return;
}


function startSeite() {

  if(document.body.offsetWidth) {
    fensterHoehe =document.body.offsetHeight;
    fensterBreite=document.body.offsetWidth;
  }
  if(window.innerWidth) {
    fensterHoehe =window.innerHeight;
    fensterBreite=window.innerWidth;
  }
  document.getElementById('hf').style.marginTop = (fensterHoehe-490)/2 + "px";
  document.getElementById('vpLogo').style.width = "640px";
  document.getElementById('Logo').style.padding = "63px 0px 63px 0px";
  document.getElementById('tdLogo').style.textAlign = "center";
}



function LogoLaden(suchen) {

document.writeln('<center>');  // Ränder und Schatten
  if(Browser=='IE')
 {
document.writeln('<table class=hauptTabelle id=hf border=0 ');
document.writeln('       cellspacing=0 cellpadding=0 ');
document.writeln('       style="width: 820px;  ">');
document.writeln('<colgroup><col width="39"><col width="100%"><col width="17"></colgroup>');
document.writeln('<tr>');
document.writeln(' <td class=obenlinks></td>');
document.writeln(' <td class=obenmitte></td>');
document.writeln(' <td class=obenrechts></td>');
document.writeln('</tr>');
document.writeln('<tr>');
//
document.writeln('  <td class=mittelinks></td>');
document.writeln('  <td valign=top align=center ');
document.writeln('      style="padding:0px 20px 0px 30px;">');
  }
  else
  {
document.writeln('<table class=hauptTabelle id=hf border=0 ');
document.writeln('       cellspacing=0 cellpadding=0 ');
document.writeln(' style="width: 820px;');
document.writeln(' border-right: 3px solid #9F9F9F;')
document.writeln(' border-bottom: 3px solid #9F9F9F;">');

document.writeln('<colgroup><col width="100%"></colgroup>');
document.writeln('<tr><td><br><br></td></tr>');
document.writeln('  <td valign=top align=center ');
document.writeln('      style="padding:0px 20px 0px 30px;">');
  }

//                --------   Suchen  ------------
document.writeln('<table id=logo cellpadding=0 cellspacing=0 border=0 width=100% >');
document.writeln('<tr>');
 if (!suchen && ohneLogo==false ) {
 document.writeln('<td id= search align=left  valign=middle>');
 document.writeln('<form id=suchForm name="suchen" action="'+xPfad+'suchen/suchen.html">');
 document.writeln('  <span >&nbsp;Suchen<br></span>');
 document.writeln('  <input class=suchen type="text" id=suchFeld name="query" size="30" >');
 document.writeln('  <input class=button type="submit" value="Go" title="Hompage durchsuchen">');
 document.writeln(' <img src="'+xPfad+'all_images/telefon.png" width="29" height="24" border="0" alt="Telefonbuch durchsuchen" onClick=telefonbuchAufrufen(); style="position:relative; top:3px; left:5px;cursor:pointer;"> ');
 document.writeln('</form></td>');
 }
//                --------   LOGO   -------------
if (!ohneLogo) {
  document.writeln('<td  id=tdLogo align=right >');
  document.writeln('<img id=vpLogo src="'+ xPfad +'all_images/oevp_logo3.png" width="380" ');
  document.writeln('     border="0" alt="" style="z-index:10;">');
}
document.writeln('</td></tr></table>');
}

function NavigationLaden() {

if (ohneLogo==true) return;
if (Browser == 'NS' || Browser == '') { miniNavLaden(); return;}

document.writeln('<table width=100% cellpadding=0 cellspacing=0 border=0 ');
document.writeln('       style="position: absolute; z-index:100;">');
document.writeln('<tr>');
document.writeln('  <td bgcolor="#6F6F6F" align=left width=100% height=21px>');



                 //  Navigation einlesen und erzeugen
  var position=0;

  for (var i=0; i < m.length; i++) {
    anzeigen=m[i]['anz'];
    if (anzeigen==1) {
      if (m[i].length > 0) var adresse=' href="javascript:einblendenUntermenue(' +i+ ')"';
      else var adresse=' href="javascript:parent.location=&quot;' +xPfad+ m[i]['adr'] + '&quot;"';

  //    document.writeln('<a class=nav id=m' +i+ ' href=' + adresse + ' target="_top" ');
       document.writeln('<a class=nav id=m' +i + adresse);
      if (m[i].length > 0) {
        document.writeln(' onMouseout="ausblendenUntermenue(' +i+ ')" ');
        document.writeln(' onMouseover="einblendenUntermenue(' +i+ ')" ');
      }
      document.writeln(' style="left:' + position +'px; width:' + m[i]['br'] +'"');
      document.writeln('>'+m[i]['txt']+'</a>');
      position=position + m[i]['br'];
    }
  }
                //  Untermenues einlesen und erzeugen
  var position=0;

  for (var i=0; i < m.length; i++) {

    if (m[i].length > 0) {
      if (position + m[i]['br'] > 760) var pos=position + m[i]['br'] - m[i][0]['br']-5;
      else pos=position;
      document.writeln('<div  class=um id=um' +i+ '  style="left:' + pos  + 'px;"');
      document.writeln(' onMouseout="ausblendenUntermenue(' +i+ ')" ');
      document.writeln(' onMouseover="einblendenUntermenue(' +i+ ')" >');
      document.writeln('<div class=umi >');
      oben=0;
      for (var j=0; j < m[i].length; j++) {
        anzeigen=m[i][j]['anz'];
        var bez = i + '_' + j;
        if (anzeigen==1) {

          var seitenAdr= xPfad + m[i][j]['adr'];
          if (m[i][j]['adr'].substring(0,7)=='http://') {
             seitenAdr='javascript:frageVerlassen('+i+','+j+')';
             }
          if (m[i][j].length > 0) var seitenAdr='"javascript:einblendenUUntermenue(&quot;' +bez+ '&quot;)"';

          document.writeln('<a class=umi href=' + seitenAdr   + ' target="_top" ');
          document.writeln('id=m'+bez);
          document.writeln(' onMouseout=ausblendenUUntermenue("' +bez+ '") ');
          document.writeln(' onMouseover=einblendenUUntermenue("' +bez+ '") ');
          document.writeln(' style="top:' + oben + 'px; width:' + m[i][0]['br'] +'"');
          document.writeln('>'+m[i][j]['txt']+'</a><br>');
          oben=oben+18;
        }
      }
      document.writeln('</div></div>');
    }
    position= (m[i]['anz']==1) ? position + m[i]['br'] : position;
  }
                //  Unter- Untermenues einlesen und erzeugen
  var position=0;

  for (var i=0; i < m.length; i++) {
    if (m[i].length > 0) {
      for (var j=0; j < m[i].length; j++) {
        if ( m[i][j].length >0) {
          var links=document.getElementById('um'+i).style.left;
          links =parseInt( links.substring(0,links.length-2) );
          var breit=parseInt(m[i][0]['br']);
          var uBreit=parseInt(m[i][j][0]['br']);
          links=links+breit;
          links = ( links+uBreit > 730) ? links-breit-uBreit : links;
          var bez = i + '_' + j;
          oben=20 + (18*j) ;
          if (oben>20) oben=oben+2;
          document.writeln('<div class=um id=um' +bez );
          document.writeln('    style="left:' +links+ 'px; top:'+oben+'"');
          document.writeln(' onMouseout=ausblendenUUntermenue("' +bez+ '") ');
          document.writeln(' onMouseover=einblendenUUntermenue("' +bez+ '") >');
          document.writeln('<div class=umi >');
          ob=oben;
          for (var k=0; k < m[i][j].length; k++) {
            anzeigen=m[i][j][k]['anz'];
            if (anzeigen==1) {
                var seitenAdr= xPfad + m[i][j][k]['adr'];
                if (m[i][j][k]['adr'].indexOf('http://')>-1) {
                   seitenAdr='javascript:frageVerlassen('+i+','+j+','+k+')';
                }
     document.writeln('<a  class=umi    href="' + seitenAdr +'"' + ' target="_top" ' );
     document.writeln(' onMouseout=ausblendenUUntermenue("' +bez+ '") ');
     document.writeln(' onMouseover=einblendenUUntermenue("' +bez+ '") ');
     document.writeln(' style="top:' + oben + 'px; width:' + m[i][j][0]['br'] +'"');
     document.writeln('>'+m[i][j][k]['txt']+'</a><br>');
     ob=ob+18;
             }
           }

        }
        document.writeln('</div></div>');
      }
    }
  }

document.writeln('  </td></tr>');
document.writeln('</table>');
document.writeln('<table width=100% ><tr><td></td></tr></table>');
}
function miniNavLaden() {
  document.writeln('<table width=100% cellpadding=0 cellspacing=0 border=0 ');
  document.writeln(' style="table-layout:fixed>"');
  document.writeln('<tr>');
  document.writeln('<td align=left valign=top bgcolor="#5F5F5F" ');
  document.writeln(' style="height=26px; ">');
    var adress = xPfad + 'startseite/seite1.html';
  document.writeln('<a class=navNS href='+adress+'>Startseite</a>');
    var adress = xPfad + 'sitemap/navigation.html';
  document.writeln('<a class=navNS href='+adress+'>Sitemap</a>');
    var adress = xPfad + 'gaestebuch/g_index.html';
  document.writeln('<a class=navNS href='+adress+'>Gästebuch</a></td></tr>');
  document.writeln('</table>');
  }



function SeitenendeLaden(impressum) {
if(!impressum && ohneLogo==false) {   // Impressum kann unterdrückt werden
  document.writeln('<p>&nbsp;</p>');
  document.writeln('<table width=100% cellpadding=0 cellspacing=0 border=0 >');
  document.writeln('<tr><td align=center valign=bottom bgcolor="#5F5F5F" style="padding: 5px;">');
  document.writeln('  <span style="color:white; padding: 5px;">');
  document.writeln('  <h5>VP-Hennersdorf, Hauptstrasse 29 / 32, 2332 Hennersdorf, ');
  document.writeln('    Tel.: 02235 / 817 76&nbsp;&nbsp;&nbsp; ');
  email_impr();
//  document.writeln('    <nobr><h6> e-mail:&nbsp;&nbsp; <a href="mailto:vp@hennersdorf.at">');
//  document.writeln('    <h5 text-decoration: underline"><font color="#FFFF00">vp@hennersdorf.at</font></nobr></a> </span>');
  document.writeln('</td></tr>');
  document.writeln('</table>');
// Impressum und 'nach oben'
  document.writeln('<table width=100% cellpadding=0 cellspacing=0 border=0 >');
  document.writeln('<tr><td align=left valign=bottom style="padding: 5px;">');
  document.writeln('<a href=' + xPfad + 'impressum/impressum.html >');
  document.writeln('<h6>Impressum</h6></a><br><br class=mini>');
  document.writeln('</td><td align=right valign=bottom style="padding: 5px;">');
  document.writeln('<a href=# style="  text-decoration: none;"><h6>nach oben</a><br><br class=mini>');
  document.writeln('</td></tr>');
  document.writeln('</table>');
}
document.writeln('</td>'); // das ist der untere Teil des Blattes
  if(Browser=='IE') {
document.writeln('  <td class=mitterechts></td>');
document.writeln('</tr>');
document.writeln('<tr height=30>');
document.writeln('  <td class=untenlinks></td>');
document.writeln('  <td class=untenmitte></td>');
document.writeln('  <td class=untenrechts></td>');
  }
document.writeln('</tr>');
document.writeln('</table>');

document.writeln('</center>');
}

function ausblendenUntermenue(nr) {
  if(!document.getElementById('um'+nr)) return;
  document.getElementById('m'+nr).style.backgroundColor='#5F5F5F';
  document.getElementById('m'+nr).style.color='#FFFFFF';
  document.getElementById('um'+nr).style.display='none'
}
function ausblendenUUntermenue(nr) {
  if(!document.getElementById('um'+nr)) return;
  document.getElementById('um'+nr).style.display='none';

  document.getElementById('m'+nr).style.backgroundColor='#CCCCCC';
  document.getElementById('m'+nr).style.color='#000000';

  var a=nr.split('_');
  ausblendenUntermenue(a[0]);
}

function einblendenUntermenue(nr) {
  if(!document.getElementById('um'+nr)) return;
  document.getElementById('um'+nr).style.display='block';
  document.getElementById('m'+nr).style.backgroundColor='#CCCCCC';
  document.getElementById('m'+nr).style.color='#000000';
}
function einblendenUUntermenue(nr) {
  if(!document.getElementById('um'+nr)) return;
  document.getElementById('um'+nr).style.display='block';

  document.getElementById('m'+nr).style.backgroundColor='#5F5F5F';
  document.getElementById('m'+nr).style.color='#ffffff';

  var a=nr.split('_');
  einblendenUntermenue(a[0]);
}

function telefonbuch() {
document.getElementById('suchForm').action=xPfad+"service/telefonbuch/telefonbuch.html";
}

function cz() {  // Counter anzeigen

  document.writeln('<div id=blende style="display:inline; width:100px; height:13px;');
  document.writeln('      background-color: white; z-index:10;border:solid 1px #FFFFFF;');
  document.writeln('      position:relative; top:-57px; left: -85px;"');
  document.writeln('onClick=window.setTimeout("cAnzeigen()",100)>');
}
function cAnzeigen() { document.getElementById("blende").style.visibility="hidden"}

function nachricht(xname) {
  var m ="&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
  var m1="&#46;&#118;&#112;&#64;"
  document.writeln('<img src="'+xPfad+'all_images/mail.png" width="30" height="15">');
  document.writeln('<a href="' + m + xname +m1 + 'hennersdorf.at" >');
  document.writeln(xname + m1 + 'hennersdorf.at </a>');
  if(ohneLogo) {
    document.writeln('<br>');
    document.writeln('<img src="'+xPfad+'all_images/home.png" width="19" height="20"  style="margin-right:11px">');
    document.writeln('<a href="http://vp.hennersdorf.at/" >');
  document.writeln('http://vp.hennersdorf.at </a>');
  }
}

function mail_2(xname,xadr,synonym) {

  var m ="&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
  var m1="&#46;&#118;&#112;&#64;"
  if (synonym) {
  document.writeln('<a href="' + m + synonym + '&lt;'+ xname +'&#64;' + xadr + '&gt;" >');
  }
  else {
  document.writeln('<a href="' + m + xname +'&#64;' + xadr + '" >');
  }
  document.writeln('<img src="'+xPfad+'all_images/mail.png"  border=0></a>');

}

function email_impr() {
  var m ="&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
  var m1="&#118;&#112;&#64;"
  document.writeln('e-mail:&nbsp;&nbsp;');
  document.writeln('   <a href="' + m  +m1 + 'hennersdorf.at" style="color:yellow !important">');
  document.writeln(m1 + 'hennersdorf.at </a>');
}


function browserWeiche() {
  Browser=navigator.userAgent.toLowerCase();
  Browser='NS'; return;
  if (Browser.indexOf('opera')   > -1) {Browser='OP'; return;}
  if (Browser.indexOf('netscape')> -1) {Browser='NS'; return;}
  if (Browser.indexOf('gecko')   > -1) {Browser='NS'; return;}
  if (Browser.indexOf('mozilla') >- 1) {Browser='IE'; return;}
  Browser='';
}

function pfadErmitteln() {
    var Pfad = document.title;
    Pfad= Pfad.split('-'); // Dokument-Titel nach Bindestrichen durchsuchen
    if (Pfad[3]) { xPfad='../../../'; return;}
    if (Pfad[2]) { xPfad='../../'; return;}
    if (Pfad[1]) { xPfad='../'; return;}
    if (Pfad[0]) { xPfad=''; return;}
}

function telefonbuchAufrufen() {
  var SuchText=document.getElementById('suchFeld').value
  if (SuchText) SuchText='?querry='+SuchText;
  var adr= xPfad+"service/telefonbuch/telefonbuch.html"+SuchText;
  document.location.href=adr;
}


function frageVerlassen(i,j,k)
 {
 if (i) var adr=m[i]['adr'];
 if (j) var adr=m[i][j]['adr'];
 if (k) var adr=m[i][j][k]['adr'];
/* if (i) var zus=m[i]['zus'];
 if (j) var zus=m[i][j]['zus'];
 if (k) var zus=m[i][j][k]['zus'];
 if (!zus) zus=''; else zus = zus +'\n\n'
 var a='Die von Ihnen aufgerufene Seite ist kein Bestandteil \nder Homepage der VP-Hennersdorf\n\n' + zus + 'Internetadresse:\n' + adr;
 var check =confirm(a);
 if (!check) return;*/
 window.open(adr);
}

function seiteAnzeigen(adresse) {
  alert(adresse);
}

function showImage(adresse) {
pict=window.open("../img_anzeigen.php?adresse="+adresse,"bild","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100, left=100, WIDTH=480,HEIGHT=520");
}
function zeigeBild(adresse) {
pict=window.open(adresse,"bild","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100, left=100, WIDTH=620,HEIGHT=470");
}

function zeigeBildX(adresse) {
pict=window.open(adresse,"bild","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100, left=100, WIDTH=470,HEIGHT=640");
}