
onload="bildtauschen1(1,2);"
onload="bildtauschen2(2,2);"

var zeit = 4500
var NumOfPic = 34 //Total number of pictures used
var fname2;
var fname3;
var fname1;
var fname4;
var fname5;
var welchezahl1 = 1;
var welchezahl2 = 2;
var welchezahl3 = 3;
var welchezahl4 = 4;
var welchezahl5 = 5;
var welchezahlneu;

var zaehler1 = 1;
var zaehler2 = 2;
var weitergeben1;
var weitergeben2;

var hgeinse = 1;

function bildtauschen1(tausch1,anzahl1)
{
weitergeben1 = anzahl1;
weitergebentausch1 = tausch1;

welchezahlbild1 = zaehler1;
fname1 = "images/bild_"+tausch1+"/bild_" + welchezahlbild1 + ".jpg"
document.img1.src = fname1;

zaehler1 = zaehler1+1;
if (zaehler1==anzahl1+1) { zaehler1=1; }

window.setTimeout("bildtauschen1(weitergebentausch1,weitergeben1);",zeit);
}


function bildtauschen2(tausch2,anzahl2)
{
weitergeben2 = anzahl2;
weitergebentausch2 = tausch2;

welchezahlbild2 = zaehler2;
fname2 = "images/bild_"+tausch2+"/bild_" + welchezahlbild2 + ".jpg"
document.img2.src = fname2;

zaehler2 = zaehler2+1;
if (zaehler2==anzahl2+1) { zaehler2=1; }

window.setTimeout("bildtauschen2(weitergebentausch2,weitergeben2);",zeit);
}

function anfang1()
{
welchezahlneu = Zufallbilder();
welchezahl1 = welchezahlneu;
fname1 = "intro/intro_" + welchezahl1 + ".jpg"
document.img.src = fname1;
window.setTimeout("anfang2();",0);
}


function anfang2()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1)
{
window.setTimeout("anfang2();",0);
}

else { welchezahl2 = welchezahlneu;
fname2 = "intro/intro_" + welchezahl2 + ".jpg"
document.img2.src = fname2;
window.setTimeout("anfang3();",0);
}
}

function anfang3()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2|| welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("anfang3();",0);
}

else { welchezahl3 = welchezahlneu;
fname3 = "intro/intro_" + welchezahl3 + ".jpg"
document.img3.src = fname3;
window.setTimeout("anfang4();",0);
}
}

function anfang4()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("anfang4();",0);
}

else { welchezahl4 = welchezahlneu;
fname4 = "intro/intro_" + welchezahl4 + ".jpg"
document.img4.src = fname4;
window.setTimeout("anfang5();",0);
}
}

function anfang5()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("anfang5();",0);
}

else { welchezahl5 = welchezahlneu;
fname5 = "intro/intro_" + welchezahl5 + ".jpg"
document.img5.src = fname5;
window.setTimeout("weiter();",0);
}
}


function weiter()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("weiter();",0);
}

else { welchezahl1 = welchezahlneu;
fname1 = "intro/intro_" + welchezahl1 + ".jpg"
document.img.src = fname1;
window.setTimeout("weiter1();",zeit);
}
}

function weiter1()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("weiter1();",0);
}

else { welchezahl2 = welchezahlneu;
fname2 = "intro/intro_" + welchezahl2 + ".jpg"
document.img2.src = fname2;
window.setTimeout("weiter2();",zeit);
}
}

function weiter2()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("weiter2();",0);
}

else { welchezahl3 = welchezahlneu;
fname3 = "intro/intro_" + welchezahl3 + ".jpg"
document.img3.src = fname3;
window.setTimeout("weiter();",zeit);
}
}

function weiter2()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("weiter2();",0);
}

else { welchezahl3 = welchezahlneu;
fname3 = "intro/intro_" + welchezahl3 + ".jpg"
document.img3.src = fname3;
window.setTimeout("weiter3();",zeit);
}
}

function weiter3()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("weiter3();",0);
}

else { welchezahl4 = welchezahlneu;
fname4 = "intro/intro_" + welchezahl4 + ".jpg"
document.img4.src = fname4;
window.setTimeout("weiter4();",zeit);
}
}

function weiter4()
{
welchezahlneu = Zufallbilder();
if (welchezahlneu == welchezahl1 || welchezahlneu == welchezahl2 || welchezahlneu == welchezahl3 || welchezahlneu == welchezahl4 || welchezahlneu == welchezahl5)
{
window.setTimeout("weiter4();",0);
}

else { welchezahl5 = welchezahlneu;
fname5 = "intro/intro_" + welchezahl5 + ".jpg"
document.img5.src = fname5;
window.setTimeout("weiter();",zeit);
}
}

function Zufallbilder()
{
     maxus=NumOfPic;
     today = new Date();
     num = today.getTime();
     num = Math.round(Math.abs(Math.sin (num)*100000)) % maxus;
     num=num+1;return num;
}








var leftMargin = 0;
var slideTime = 1200;
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);

function layerObject(id,left) {
if (ns6) {
this.obj = document.getElementById(id).style;
this.obj.left = left;
return this.obj;
}
else if(ie4) {
this.obj = document.all[id].style;
this.obj.left = left;
return this.obj;
}
else if(ns4) {
this.obj = document.layers[id];
this.obj.left = left;
return this.obj;
   }
}
function layerSetup() {
floatLyr = new layerObject('floatLayer',0);
window.setInterval("main()", 10)
}
function floatObject() {
if (ns4 || ns6) {
findHt = window.innerWidth;
} else if(ie4) {
findHt = document.body.clientWidth;
   }
}
function main() {
if (ns4) {
this.currentX = document.layers["floatLayer"].left;
this.scrollLeft = window.pageXOffset;
mainTrigger();
}
else if(ns6) {
this.currentX = parseInt(document.getElementById('floatLayer').style.left);
this.scrollLeft = scrollX;
mainTrigger();
}
else if(ie4) {
this.currentX = floatLayer.style.pixelLeft;
this.scrollLeft = document.body.scrollLeft;
mainTrigger();
   }
}
function mainTrigger() {
var newTargetX = this.scrollLeft + this.leftMargin;
if ( this.currentX != newTargetX ) {
if ( newTargetX != this.targetX ) {
this.targetX = newTargetX;
floatStart();
}
animator();
   }
}
function floatStart() {
var now = new Date();
this.A = this.targetX - this.currentX;
this.B = Math.PI / ( 2 * this.slideTime );
this.C = now.getTime();
if (Math.abs(this.A) > this.findHt) {
this.D = this.A > 0 ? this.targetX - this.findHt : this.targetX + this.findHt;
this.A = this.A > 0 ? this.findHt : -this.findHt;
}
else {
this.D = this.currentX;
   }
}
function animator() {
var now = new Date();
var newX = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
newX = Math.round(newX);
if (( this.A > 0 && newX > this.currentX ) || ( this.A < 0 && newX < this.currentX )) {
if ( ie4 )document.all.floatLayer.style.pixelLeft = newX;
if ( ns4 )document.layers["floatLayer"].left = newY;
if ( ns6 )document.getElementById('floatLayer').style.left = newX + "px";
   }
}

function start() {

if(ns6||ns4) {
pageWidth = innerWidth-14;
pageHeight = innerHeight;
leftMargin = pageWidth-300;
layerSetup();
floatObject();
}
else if(ie4) {
pageWidth = document.body.clientWidth;
pageHeight = document.body.clientHeight;
leftMargin = pageWidth-300;
layerSetup();
floatObject();
   }
}
function NeueKlasse(vorher,nachher)
{
  if (document.all)
  {
    for (i=0;i<document.all.length;i++)
    {
      if (document.all[i].className==vorher)
      {
      document.all[i].className=nachher;
      }
    }
  }

  if (document.getElementById && !document.all)
  {
    var elemente=document.getElementsByTagName("*");
    for (i=0;i<elemente.length;i++)
    {
      if (elemente[i].className==vorher)
      {
      elemente[i].className=nachher;
      }
    }
  }

}




function hgein() {

   if (hgeinse==4) {
   window.document.bgColor = "#96927A";

   }
   if (hgeinse==3) {
   window.document.bgColor = "#C8BB9D";

   }
   if (hgeinse==2) {
   window.document.bgColor = "#D8CFA5";

   }
   if (hgeinse==1) {
   window.document.bgColor = "#E9E5AF";

   }
   if (hgeinse==5) {
   window.document.bgColor = "#E1DDD9";

   }
   hgeinse=hgeinse+1;
   if(hgeinse==6) {hgeinse=1;}
   //alert(window.document.bgColor);

   //alert(hgeinse);
   }