function FotoSlider(url,fotos) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="225" align="right" style="margin: 5px">');
	document.write('  <param name="movie" value="' + url + 'swf/fotos.swf">');
        document.write('  <param name=quality value=high>');
        document.write('  <param name="allowScriptAccess" value="always" />');
        document.write('  <param name="wmode" value="transparent" /><param name="SCALE" value="exactfit">');
        document.write('  <param name="FlashVars" value="fotos=' + fotos + '">');
        document.write('  <embed wmode="transparent" flashvars="fotos=' + fotos + '" src="' + url + 'swf/fotos.swf" width="300" height="225" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>');
        document.write('</object>');
}

function veranderFoto(src, nr, klik) {
	if (klik) {
    		fotoPause();	
	}
	blendimage('foto', 'fotoinhoud', src, 1000);
  	huidigefoto = nr;
}

function volgendeFoto() {
	huidigefoto++;
	if (huidigefoto > fotos.length) {
		  huidigefoto = 1;
  	}
	veranderFoto(fotos[huidigefoto - 1], huidigefoto, 0);
}
function fotoNext() {
	huidigefoto++;
	if (huidigefoto > fotos.length) {
		  huidigefoto = 1;
  	}
	fotoPause();	
	veranderFoto(fotos[huidigefoto - 1], huidigefoto, 0);
}

function fotoBack() {
	huidigefoto--;
	if (huidigefoto == 0) {
		huidigefoto = 1;
 	}
	fotoPause();
	veranderFoto(fotos[huidigefoto - 1], huidigefoto, 0);
}

function fotoPause() {
	clearInterval(fototimer);
	document.getElementById('play1').style.display = 'block';
	document.getElementById('play2').style.display = 'none';
	document.getElementById('pause2').style.display = 'block';
	document.getElementById('pause1').style.display = 'none';		
}
function fotoPlay() {
	fotoPause();
	fototimer = setInterval('volgendeFoto()', 5000);
	document.getElementById('play1').style.display = 'none';
	document.getElementById('play2').style.display = 'block';
	document.getElementById('pause1').style.display = 'block';
	document.getElementById('pause2').style.display = 'none';		
}
function blendimage(divid, imageid, imagefile, millisec) { 
	var speed = Math.round(millisec / 100); 
        var timer = 0; 
	     
	//set the current image as background 
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
        
	//make image transparent 
	changeOpac(0, imageid); 
    
        //make new image 
	document.getElementById(imageid).src = imagefile; 
	//fade in image 
	for(i = 0; i <= 100; i++) { 
               setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
               timer++; 
        } 
}
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}
