function toonFilm(foto, film, thumbPos) {
	activateThumb(thumbPos);
	$('div.foto_groot').html('<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="615" height="365"><param name="movie" value="player.swf" /><param name="allowfullscreen" value="false" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="file='+film+'&image='+foto+'" /><embed	type="application/x-shockwave-flash" id="player2" name="player2" src="player.swf" width="615" height="365" allowscriptaccess="always" allowfullscreen="false" flashvars="file='+film+'&image='+foto+'" /></object>');

}

// array aanmaken, wordt gevuld vanuit slideshow.xslt
var fotos = new Array();
var fotoIndex = 2;

function slideshow() {
	toonFoto(fotos[fotoIndex], 1);
	fotoIndex++;
	if(fotoIndex == fotos.length) {
		fotoIndex = 1;
	}
	setTimeout("slideshow();", 5000);
}

function toonFoto(foto, thumbPos) {
	activateThumb(thumbPos);
	
	$('img.foto_groot_boven').fadeOut(1000, function() {changeSrc('img.foto_groot_boven', foto);});	
	return;
}

function changeSrc(imgClass, newSrc) {
	$(imgClass).attr('src', newSrc);
	$('img.foto_groot_boven').fadeIn(1000);
	return;
}

function activateThumb(thumbPos) {
	var thumbId = 'thumb_'+thumbPos;

	$('img.thumb').removeClass('active');
	$('img#'+thumbId).addClass('active');

	if( $('div.foto_groot').html().match('object') ) {
		$('div.foto_groot').html('<img class="foto_groot_boven" />');
	}
}
