///////////////////////////////////////////////////////////
///////////  Array mit Men?eintr?gen
////////////////////////////////////////////////////////////
// Was bedeutet die Variable "KZ" (kennzeichen)
// kz = 1  >>> Ebene 1, weitere Punkte Ebene 1
// kz = 2  >>> Ebene 1, keine weitere Punkte Ebene 1
// kz = 3  >>> Ebene 2, weitere Punkte Ebene 2
// kz = 4  >>> Ebene 2, keine weitere Punkte Ebene 2
// kz = 5  >>> Ebene 1, keine weitere Punkte Ebene 1 aber Ebene 2
// kz = 6  >>> Ebene 2, keine weitere Punkte Ebene 1 keine weiteren Punkte Ebene 2
// kz = 7  >>> Ebene 3, wird nicht mehr angezeigt

// 1. String --> HTML-Datei oder Link
// 2. String --> Anzeige-Text
// 3. String --> KZ, siehe oben
// 4. String --> KZ für Untermenü, die Zahl die im Array gesetzt wird, muss in der HTML-Datei beim
//                anfang() mit angegeben werden
//                --> damit wird gesteuert, dass das Untermenü in der Pfarrei Aßmannshardt auch dann angezeigt
//                        wird wenn die "Hauptseite" der Pfarrei Aßmannshardt  angezeigt wird
var menu = new Array(
        "index.html", "Home", "1", "", "",
        "ueberUns.html", "Über uns", "1", "a", "",
        "zunftrat.html", "Zunftrat", "3", "a", "",
        "reglements.html", "Reglements", "3", "a", "",
        "zunftordnung.html", "Zunftordnung", "7", "a", "1",
        "zunftsatzung.html", "Zunftsatzung", "7", "a", "1",
        "punktesystem.html", "Punktesystem", "7", "a", "1",
        "laufbendel.html", "Laufbendel", "7", "a", "1",
        "termine.html", "Termine", "1", "b", "",
        "rueckschau.html", "Rückschau", "3", "b", "",
		"kontakt.html", "Kontakte", "1", "", "",
		"fotoalbum.html", "Fotoalbum", "1", "c", "",
		"frueher.html", "Früher", "3", "c", "",
		"chronik.html", "Chronik", "3", "c", "",
		"1985.html", "1985", "3", "c", "",
		"199293.html", "1992/1993", "3", "c", "",
		"199596.html", "1995/1996", "3", "c", "",
		"199697.html", "1996/1997", "3", "c", "",
		"199798.html", "1997/1998", "3", "c", "",
		"199900.html", "1999/2000", "3", "c", "",
		"200001.html", "2000/2001", "3", "c", "",
		"200102.html", "2001/2002", "3", "c", "",
		"200203.html", "2002/2003", "3", "c", "",
		"200304.html", "2003/2004", "3", "c", "",
		"200405.html", "2004/2005", "3", "c", "",
		"200506.html", "2005/2006", "3", "c", "",
		"200607.html", "2006/2007", "3", "c", "",
		"200708.html", "2007/2008", "3", "c", "",		
		"200809.html", "2008/2009", "3", "c", "",
		"200910.html", "2009/2010", "3", "c", "",
		"201011.html", "2010/2011", "3", "c", "",        
		"shop.html", "Shop", "3", "c", "",
		"links.html", "Links", "1", "", "",
		"gaestebuch.html", "Gästebuch", "1", "", "",
		"impressum.html", "Impressum", "1", "", "",
		"uebersicht.html", "Übersicht", "1", "", "",
		
		
/*
        "nikolaus.html", "Echte Nikol&auml;use zum Nikolaustag ", "7", "z", "1",
        "nikolaus02.html", "Der Nikolaus war da am 05.12.2008 / Bilder", "7", "z", "1",
        "nikolaus03.html", "Nikol&auml;use Holz 2m / Plakat", "7", "z", "1",
		"2009-nikolaus.html", "Nikolausaktion 2009", "3", "z", "",
		"2009-kukalender.html", "Kuschelkalender 2010", "3", "z", "",
        
        */
        "inMemory.html", "in Memory", "1","", ""
);

////////////////////////////////////////////////////////////
///////////  erzeugt erster Teil einer Seite  //////////////
////////////////////////////////////////////////////////////

// versendetet schl?ssel  s f k t l p u i h a b c
function anfang(a, logo, b){
  document.writeln('  <div id="main">');
  document.writeln('  <div id="top"><img src="images/logo-nz.gif"><img style="margin-bottom:20px;margin-left:40px;" src="images/banner.gif"><!-- #top oeffnen -->');
  document.writeln('   </div><!-- #top schliessen-->');
  document.writeln('      <div id="nest"><!-- #leftBox oeffnen-->');
  document.writeln('    <table border=0><tr><td>  <div id="list-menu"><!-- #leftBox oeffnen-->');
  document.writeln('<ul>');

  menuErstellen(menu, a, b)
  document.writeln('   </u>');
  
  document.writeln('   </div><!-- #list-menu schliessen --><div id="f1"><p class="sklein"><a href="#oben">&nbsp; nach oben</a><br />&copy; by NZ Mittelbiberach </p></div>');
  document.writeln('   <table border="0" cellspacing="0">');
  document.writeln('   <tr>');
  document.writeln('   <td width="140"><center><br><img src="http://webcounter.goweb.de/98413.GIF" border="0" vspace="0"> </center></td>');
  document.writeln('   </tr>  ');
  document.writeln('   </table>');
  
    document.writeln('   </td><td><div id="content"><!-- #content oeffnen-->');
}

////////////////////////////////////////////////////////////
///////////  erzeugt ende Teil einer Seite  ////////////////
////////////////////////////////////////////////////////////
function ende(e){
  if ( e > 0) lz(e);
  document.writeln('     <br style="clear:both;" />');
  document.writeln('   </td></tr></table></div><!-- #content schliessen -->'); 
  document.writeln('   <div id="footer"><!-- #footer oeffnen-->');
  document.writeln('     <table><tr><td width="900">');
  document.writeln('     <!--p class="sklein">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&copy; by Narrenzunft Mittelbiberach  </a>');
  changedate();
  document.writeln('     </p><td><p class="sklein"><a href="#oben">&nbsp; nach oben</a></p--></td></tr></table>');
  document.writeln('   </div><!-- #footer schliessen -->');
  document.writeln('   </div><!-- #nest schliessen -->');
   document.writeln('   </div><!-- #main schliessen -->');
}


////////////////////////////////////////////////////////////
///////////  erzeugt Anzahl von Leerzeilen /////////////////
////////////////////////////////////////////////////////////
function lz(z){
 var Ausgabe = "";

 for(var i = 1; i < z; i++)
   Ausgabe = Ausgabe + "<br />&nbsp;";

 Ausgabe = Ausgabe + "<br />";
 document.write(Ausgabe);
 }


////////////////////////////////////////////////////////////
///////////  erzeugt Anzahl von Leerpixel  /////////////////
////////////////////////////////////////////////////////////
function lb(z){
        document.write('<img src="medien/bilder/leer.jpg" width="1" height="' + z +'">');
}


////////////////////////////////////////////////////////////
///////////  Anzeige ?nderungsdatum in Fussnote unten rechts
////////////////////////////////////////////////////////////
function changedate(){
        lastmod = document.lastModified;
        lastmoddate = Date.parse(lastmod);
        now = new Date(lastmod);
        year = now.getYear();
        month = now.getMonth();
        month = month+1;
        day = now.getDate();

        if(year == 1900 || year == 100) {
          year=2000;
        }

        if (year < 30) {
          year += 2000;
        }
        else if (year < 1900) {
          year += 1900;
        }

        var heute = day + '.' + month + '.' + year;

        document.writeln(' - letzte &Auml;nderung: '  + heute );
}



////////////////////////////////////////////////////////////
///////////  Erstellt Men?punkt
////////////////////////////////////////////////////////////
function makeMenuPkt(link, text, ebene){

 if (ebene > 6 ) {
        document.writeln('<li><a class="me3" href=' + link + '> &nbsp;&nbsp; ' + text + '</a></li>');
  } else if (ebene > 2){
        document.writeln('<li><a class="me2" href=' + link + '> &nbsp; ' + text + '</a></li>');
  } else if (ebene < 3) {
        document.writeln('<li><a class="me1" href=' + link + '>' + text + '</a></li>');
  }
}


////////////////////////////////////////////////////////////
///////////  Erstellt Sidemap-Eintr?ge
////////////////////////////////////////////////////////////
function buildSidemap(pkt){

var j=0;
var link="";
var text="";
var kz="";

// der Arrayinhalt wird in Dreier-Schritten verarbeitet, da immer die drei Inhalte sich
// wieder holen
// wenn  1 = Link --> entsprechende aufbereitung wenn gef?llt#
//       2 / 3 = nur ?bernehmen
//
// in 3 --> KZ wie Eintrag in Sitemap dargestellt wird
//
//
for (var i=0; i < pkt.length; i++){
 j++;
 if (j == 1) {
 //document.writeln('link -->' + pkt[i]);
    if ( pkt[i].length > 0) link = '<a href="' + pkt[i] + '">';
    if ( pkt[i] == '') link = '';
   }
 if (j == 2) text = pkt[i];
 if (j == 3) kz = pkt[i];

 // Zeile f?r Sitemap eintrag erstellen
 if (j == 5 ){
    if (kz == 1)  document.writeln('&nbsp;<img src="medien/bilder/sm_zw0.gif" width="19" height="16" align="top" alt="" />' + link + ' ' + text  + '</a><br/>');
    if (kz == 2)  document.writeln('&nbsp;<img src="medien/bilder/sm_zwe0.gif" width="19" height="16" align="top" alt="" />' + link + ' ' + text  + '</a><br/>');
    if (kz == 3)  document.writeln('&nbsp;<img src="medien/bilder/sm_stamm-0.gif" width="19" height="16" align="top" alt="" />&nbsp;&nbsp;&nbsp;<img src="medien/bilder/sm_zw0.gif" width="19" height="16" align="top" alt="" />' + link + ' ' + text + '</a><br />');
    if (kz == 4)  document.writeln('&nbsp;<img src="medien/bilder/sm_stamm-0.gif" width="19" height="16" align="top" alt="" />&nbsp;&nbsp;&nbsp;<img src="medien/bilder/sm_zwe0.gif" width="19" height="16" align="top" alt="" />' + link + ' ' + text + '</a><br />');
    if (kz == 5)  document.writeln('&nbsp;<img src="medien/bilder/sm_leer.gif" width="19" height="16" align="top" alt="" />&nbsp;&nbsp;&nbsp;<img src="medien/bilder/sm_zw0.gif" width="19" height="16" align="top" alt="" />' + link + ' ' + text + '</a><br />');
    if (kz == 6)  document.writeln('&nbsp;<img src="medien/bilder/sm_leer.gif" width="19" height="16" align="top" alt="" />&nbsp;&nbsp;&nbsp;<img src="medien/bilder/sm_zwe0.gif" width="19" height="16" align="top" alt="" />' + link + ' ' + text + '</a><br />');
    j=0;
 }  // end if

 // neue Spalte in Tabelle beginnnen
 // z.Z. allles in 5-Schritten, da Array 5 Werte / Eintrag hat
 if ((i == 297) || (i == 507))  document.writeln('....<br /></td><td>....<br />');

} // end for


}

////////////////////////////////////////////////////////////
///////////  Erstellt Men?punkte
////////////////////////////////////////////////////////////
function menuErstellen(pkt, a, b){

var j=0;
var link="";
var text="";
var kz="";
var menukz = "";
var umenukz = "";

// der Arrayinhalt wird in Dreier-Schritten verarbeitet, da immer die drei Inhalte sich
// wieder holen
// wenn  1 = Link --> entsprechende aufbereitung wenn gef?llt
//       2 / 3 = nur ?bernehmen
//
// in 3 --> KZ wie Eintrag in Sitemap dargestellt wird
//
//


for (var i=0; i < pkt.length; i++){
 j++;
 if (j == 1) link = pkt[i];
 if (j == 2) text = pkt[i];
 if (j == 3) kz = pkt[i];
 if (j == 4) menukz = pkt[i];
 if (j == 5) umenukz = pkt[i];

 // Zeile f?r Sitemap eintrag erstellen
 if (j == 5 ){

  //document.write('>' +umenukz + ' - ' + a + ' - ' + b + ' --\n');

  if ((kz == 1) || (kz == 2)) {
    makeMenuPkt(link, text, kz)
  } else if (a == menukz  && umenukz == '')  {
        makeMenuPkt(link, text, kz)
  } else if (a == menukz  && b == umenukz) {
        makeMenuPkt(link, text, kz)
  }
  j=0;

 }  // end if
} // end for

}


