var i = 0;
var urls = new Array();
urls[i++] = "photos/pub/DSC_0110.JPG";
urls[i++] = "photos/pub/IMG_0581.JPG";
urls[i++] = "photos/pub/IMG_0635.JPG";
urls[i++] = "photos/stpatrickday2009/P3173873.JPG";
urls[i++] = "photos/stpatrickday2009/P3173875.JPG";
urls[i++] = "photos/stpatrickday2009/P3173805.JPG";
urls[i++] = "photos/session20090104/IMG_0599.JPG";
urls[i++] = "photos/session20090104/IMG_0600.JPG";
urls[i++] = "photos/session20090104/IMG_0657.JPG";
urls[i++] = "photos/stpatricksession2009/P3173846.JPG";
urls[i++] = "photos/stpatricksession2009/P3183950.JPG";
urls[i++] = "photos/whiskeyseminar2009/IMG_0844.JPG";

// hier die zeit zwischen dem ändern der bilder in Sekunden einstellen
var sekunden = 6;


///////////////////////////////////////////////
// nix mehr ändern, wie immer ;o)
var lastimage;
var newurl;
var theimg;

function newimage2()
{
  lastimage = theimg.src;  
  do
  {
  newurl = urls[Math.floor(Math.random()*urls.length)];
  }
  while (newurl == lastimage);
  lastimage = newurl;
  theimg.src = newurl;
  setTimeout('newimage3()',1000);
}

function newimage3() {
  new Effect.Appear("randomimage", { duration: 2.0, from: 0.05, to: 1.0 });
  setTimeout("newimage()",sekunden*1000);
}

function newimage() {
  new Effect.Fade("randomimage", { duration: 2.0, from: 1.0, to: 0.05 });
  setTimeout('newimage2()',2000);
}

function check4js()
{
  document.getElementById("Hinweis").style.display="none";
}

function newimagetest()
{
  theimg.src = "pics/logo.png";
  lastimage = theimg.src;  
  do
  {
  newurl = urls[Math.floor(Math.random()*urls.length)];
  }
  while (newurl == lastimage);
  lastimage = newurl;
  theimg.src = newurl;
}

function start()
{
  theimg=document.getElementById? document.getElementById("randomimage") : document.all.randomimage;
  check4js();
//  window.setInterval("newimage()",sekunden*1000);
  setTimeout("newimage()",sekunden*1000);
}


