// slideshow.js

function initializeSlideShow()
{
	// Bilder definieren
	arrImages = new Array();
	for(i = 0; i < imageCount; i ++) {
		image1 = new Image();
		image1.src = imagePath + imageRootName + (i+1) + ".jpg";
		image1.alt = "";
		image1.name = "img" + (i+1);
		arrImages.push(image1);
	}
	
	current = 0;
	currentImage = arrImages[current];
	document.images["imgSlideshow"].src = currentImage.src;
	new Effect.Appear(document.getElementById('divImgSlideshow'));
	window.setTimeout("getNextPic()", 3 * 1000);
}

function getNextPic() 
{
	//current = (current + 1) % arrImages.length;
	// pick random image
	do {
		rand = Math.floor(imageCount * Math.random());
	}	
	while(current == rand);
	current = rand;
	new Effect.Fade(document.getElementById('divImgSlideshow'));
	window.setTimeout("setNextPic()", 1000);
}

function setNextPic()
{
	currentImage = arrImages[current];
	document.images['imgSlideshow'].src = currentImage.src;
	new Effect.Appear(document.getElementById('divImgSlideshow'));
	window.setTimeout("getNextPic()", 3 * 1000);
}


