// JavaScript Document

var timeout = 5;				//	Seconden tussen overvloeien
var duration= 2.0;				//	Duur van de wissel effecten

var counter = 1;				//	Start counter images
var imgcount= 1;				//	Start counter images array

function slideshow() {

	Effect.Fade('im' + counter, {
		duration: duration,
		from: 1.0,
		to: 0.0,
		delay: 0.5
	});
	
	imgcount++;
	counter++;
	
	if(counter > 2) {
		counter = 1;	
	}
	
	var tmpi = new Image();
	tmpi.src = path + images[(imgcount - 1)];

	$('im' + counter).src = tmpi.src;
	
	Effect.Appear('im' + counter, {
		duration: duration,
		from: 0.0,
		to: 1.0,
		delay: 0.5
	});
	
	if(imgcount > (images.length - 1)) {
		imgcount = 0;
	}
	
	window.setTimeout('slideshow();', (timeout < 3 ? 3 : timeout) * 1000);
	
}

window.onload = function() {
	if(images.length > 1) {
		window.setTimeout('slideshow();', (timeout < 3 ? 3 : timeout) * 1000);
	}
}
