var Seite=1;
var Anfang=true;
var Ende=false;
var IsInitGalerie=false;
var MaxSeiten=6;

var INAHLT;
var VORZURUECK;
var ANSCHRIFT;

function nimmObjHTML(name) {

 if(document.getElementById) {
  this.element=document.getElementById(name);
 } else if(document.all) {
  this.element=document.all[name];
 } else if(document.layers) {
  this.element=document.layers[name];
 }
}

function initGalerie() {
  INHALT=new nimmObjHTML('bildcontainer');
  VORZURUECK=new nimmObjHTML('bildknoepfe');
  ANSCHRIFT=new nimmObjHTML('anschrift');
}

function wechselbilder(Richtung) {
  if(IsInitGalerie==false) {
    initGalerie();
    IsInitGalerie=true;
  }
  if(Richtung==1) {
    if(Ende==false) {
      Seite += 1;
      Anfang=false;
      if(Seite >= MaxSeiten){
        Ende=true;
      }
    } else {
      return;
    }
  }

  if(Richtung==-1) {
    if(Anfang==false) {
      Seite -= 1;
      Ende=false;
      if(Seite <= 1){
        Anfang=true;
      }
    } else {
      return;
    }
  }

  var VorZurueckInhalt="";
  if(Ende==false && Anfang==false) {
    VorZurueckInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
    VorZurueckInhalt += "  <tr>";
    VorZurueckInhalt += "    <td width='23'>";
    VorZurueckInhalt += "      <a href='javascript:wechselbilder(-1)'><img src='../javascript/bilder/pfeil_links.gif' border='0' alt='Pfeil'></a>";
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "    <td>";
    VorZurueckInhalt +=     Seite + " / " + MaxSeiten;
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "    <td width='23'>";
    VorZurueckInhalt += "      <a href='javascript:wechselbilder(+1)'><img src='../javascript/bilder/pfeil_rechts.gif' border='0' alt='Pfeil'></a>";
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "  </tr>";
    VorZurueckInhalt += "</table>";
  }
  if(Ende==true && Anfang==false) {
    VorZurueckInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
    VorZurueckInhalt += "  <tr>";
    VorZurueckInhalt += "    <td width='23'>";
    VorZurueckInhalt += "      <a href='javascript:wechselbilder(-1)'><img src='../javascript/bilder/pfeil_links.gif' border='0' alt='Pfeil'></a>";
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "    <td>";
    VorZurueckInhalt +=     Seite + " / " + MaxSeiten;
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "    <td width='23'>";
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "  </tr>";
    VorZurueckInhalt += "</table>";
  }
  if(Ende==false && Anfang==true) {
    VorZurueckInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
    VorZurueckInhalt += "  <tr>";
    VorZurueckInhalt += "    <td width='23'>";
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "    <td>";
    VorZurueckInhalt +=     Seite + " / " + MaxSeiten;
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "    <td width='23'>";
    VorZurueckInhalt += "      <a href='javascript:wechselbilder(+1)'><img src='../javascript/bilder/pfeil_rechts.gif' border='0' alt='Pfeil'></a>";
    VorZurueckInhalt += "    </td>";
    VorZurueckInhalt += "  </tr>";
    VorZurueckInhalt += "</table>";
  }
  VORZURUECK.element.innerHTML=VorZurueckInhalt;

  var SeitenInhalt="";
  switch(Seite) {
    case 1:
      SeitenInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
      SeitenInhalt += "  <tr>";
      SeitenInhalt += "    <td width='430' height='306'><img src='./bilder/aktuell1.jpg' border='0' alt='Aktuell1'></td>";
      SeitenInhalt += "  </tr>";
      SeitenInhalt += "</table>";

      INHALT.element.innerHTML=SeitenInhalt;
      ANSCHRIFT.element.style.visibility = 'hidden';
      break;


    case 2:
      SeitenInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
      SeitenInhalt += "  <tr>";
      SeitenInhalt += "    <td width='430' height='306'><img src='./bilder/aktuell2.jpg' border='0' alt='Aktuell2'></td>";
      SeitenInhalt += "  </tr>";
      SeitenInhalt += "</table>";

      INHALT.element.innerHTML=SeitenInhalt;
      ANSCHRIFT.element.style.visibility = 'hidden';
      break;

    case 3:
      SeitenInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
      SeitenInhalt += "  <tr>";
      SeitenInhalt += "    <td width='430' height='306'><img src='./bilder/aktuell3.jpg' border='0' alt='Aktuell3'></td>";
      SeitenInhalt += "  </tr>";
      SeitenInhalt += "</table>";

      INHALT.element.innerHTML=SeitenInhalt;
      ANSCHRIFT.element.style.visibility = 'hidden';
      break;

    case 4:
      SeitenInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
      SeitenInhalt += "  <tr>";
      SeitenInhalt += "    <td width='430' height='306'><img src='./bilder/aktuell4.jpg' border='0' alt='Aktuell4'></td>";
      SeitenInhalt += "  </tr>";
      SeitenInhalt += "</table>";

      INHALT.element.innerHTML=SeitenInhalt;
      ANSCHRIFT.element.style.visibility = 'hidden';
      break;

    case 5:
      SeitenInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
      SeitenInhalt += "  <tr>";
      SeitenInhalt += "    <td width='430' height='306'><img src='./bilder/aktuell5.jpg' border='0' alt='Aktuell5'></td>";
      SeitenInhalt += "  </tr>";
      SeitenInhalt += "</table>";

      INHALT.element.innerHTML=SeitenInhalt;
      ANSCHRIFT.element.style.visibility = 'hidden';
      break;

    case 6:
      SeitenInhalt += "<table border='0' cellspacing='0' cellpadding='0' style='text-align: left; margin: 0px; padding: 0px;'>";
      SeitenInhalt += "  <tr>";
      SeitenInhalt += "    <td width='430' height='306'><img src='./bilder/aktuell6.jpg' border='0' alt='Aktuell6'></td>";
      SeitenInhalt += "  </tr>";
      SeitenInhalt += "</table>";

      INHALT.element.innerHTML=SeitenInhalt;
      ANSCHRIFT.element.style.visibility = 'hidden';
      break;

  }
}




