var num_photos=4;  // <---- number of photos (/images/slideshow?.jpg)
var photo_delay=3; // <---- photo delay in seconds

var cur_photo=1;
var last_photo=4;
var next_photo=2;

flip=1;

var image1=0;
var image2=0;

function nextPhoto()
    {
      if (cur_photo==num_photos) {next_photo=1;} else {next_photo=cur_photo+1;}

      image1 = document.getElementById("image1");
      image2 = document.getElementById("photoholder");

	  if (flip==0)
	  	{
	    // image1.style.visibility='hidden';
	    Effect.Fade(image1);
	    window.setTimeout("image1.src='fileadmin/images/Header" + next_photo + "a.jpg';",1000);
     	flip=1;
     	}
	  else
	  	{
	    // image1.style.visibility='visible';
	    Effect.Appear(image1);
	    setTimeout("image2.style.background='url(fileadmin/images/Header" + next_photo + "a.jpg)';",3000);
	    flip=0;
		}	  	
     
      last_photo=cur_photo;
      cur_photo=next_photo;
      window.setTimeout("nextPhoto()", 3000 * photo_delay);
}

window.setTimeout("nextPhoto()", 1000 * photo_delay);
