/****************************************************************
"bretteleben.de JavaScript Slideshow" - Version 20081101
License: http://www.gnu.org/copyleft/gpl.html
Author: Andreas Berger
Copyright (c) 2008 Andreas Berger - andreas_berger@bretteleben.de
Project page and Demo at http://www.bretteleben.de
Last update: 2008-11-01
*****************************************************************/
//*****parameters to set*****
//into this array insert the paths of your pics.
//if there are only 2 images, set them two times i.e. 1/2/1/2
//imges=new Array ('pic01.jpg', 'pic02.jpg', 'pic03.jpg', 'pic04.jpg', 'pic05.jpg');
divid="picture-slides-container"; //the id of the div container that will hold the slideshow
if ( homepage == 1 ) {
	imges=new Array ('images/nieuw/home_loop_1a.gif', 'images/nieuw/home_loop_2a.gif', 'images/nieuw/home_loop_3a.gif', 'images/nieuw/home_loop_4a_ani.gif');
	picwid=310; //set this to the width of your widest pic
	pichei=405; //... and this to the height of your highest pic
	loopshow = false;
	sdur=1; //time to show a pic between fades in seconds
}
backgr="transparent"; //set this to the background color you want to use for the slide-area
//(for example the body-background-color) if your pics are of different size
fdur=0.5; //duration of the complete fade in seconds
steps=20; //steps to fade from on pic to the next
startwhen=1;
// "startwhen" leave it at "null" to start the function by calling it from your page by link
//(sample: <a href="javascript:myfade();">slide</a>)
// or set it to 1 to start the slide automatically as soon as the page is loaded
//*****nothing more to do, have fun :)
//starts with random picture: for(i=0;i<=Math.floor(Math.random()*imges.length);i++){imges.push(imges.shift());}
//****************************************************************
ftim=fdur*1000/steps;stim=sdur*1000;emax=imges.length;
tp="<div style='position:absolute;'>";
for(e=1;e<=emax;e++){
	theid="img"+e;thesrc=imges[e-1];
	tp=tp+"<div id='"+theid+"'><img src='"+thesrc+"' border='0' usemap='#picture-slides-imageMap' /></div>";
	}
	if ( homepage == 1 ) {
tp += '<map name="picture-slides-imageMap" id="picture-slides-imageMap"><area shape="rect" coords="86,125,102,140" href="/schiphol-airport" alt="Schiphol Airport" /><area shape="rect" coords="61,114,117,126" href="/schiphol-airport" alt="Schiphol Airport" /><area shape="rect" coords="62,139,101,151" href="/leiden" alt="Leiden" /><area shape="rect" coords="45,153,98,165" href="/the-hague" alt="The Hague" /><area shape="rect" coords="19,164,63,176" href="/rijswijk" alt="Rijswijk" /><area shape="rect" coords="73,164,131,175" href="/zoetermeer" alt="Zoetermeer" /><area shape="rect" coords="11,175,59,187" href="/westland" alt="Westland" /><area shape="rect" coords="90,174,160,187" href="/lansingerland" alt="Lansingerland" /><area shape="rect" coords="58,175,88,185" href="/delft" alt="Delft" /><area shape="rect" coords="62,199,115,210" href="/rotterdam-the-hague-airport" alt="Rotterdam The Hague Airport" /><area shape="rect" coords="62,184,81,200" href="/rotterdam-the-hague-airport" alt="Rotterdam The Hague Airport" /></map>';
	}
tp=tp+"</div>";
document.write("<style type='text/css'>");
for(b=1;b<=emax;b++){
	thestylid="img"+b;thez=1;thevis='hidden';
	if(b<=1) {thez=2; thevis='visible';}
	document.write("#"+thestylid+" {position:absolute;left:0;top:0;width:"+picwid+"px;height:"+pichei+"px;background-color:"+backgr+";visibility:"+thevis+";z-index:"+thez+";}");
	}
document.write("</style>");
function myfade(){
	parr = new Array();
	for(a=1;a<=emax;a++){
		idakt="img"+a;paktidakt=document.getElementById(idakt);
    ie5exep=new Array(paktidakt);parr=parr.concat(ie5exep);}
 		i=1;u=0;slide (i);
		}
function slide(numa){
	ptofade=parr[numa-1];
	if(numa<=emax){pnext=parr[numa];}
	if(numa==emax){pnext=parr[0];}
	pnext.style.visibility="visible";
	pnext.style.filter="Alpha(Opacity=100)";
	pnext.style.MozOpacity=1;
	pnext.style.opacity=1;
	ptofade.style.filter="Alpha(Opacity=100)";
	ptofade.style.MozOpacity=1;
	ptofade.style.opacity=1;
	factor=100/steps;
	slidenow();
	}
function slidenow(){
	check1=ptofade.style.MozOpacity;
	maxalpha=(100-factor*u)/100*105;
	if(check1<=maxalpha/100){u=u+1;}
	curralpha=100-factor*u;
	ptofade.style.filter="Alpha(Opacity="+curralpha+")";
	ptofade.style.MozOpacity=curralpha/100;
	ptofade.style.opacity=curralpha/100;
	if(u<steps){window.setTimeout("slidenow()",ftim);}
	if(u>=steps&&i<emax){
		ptofade.style.visibility="hidden";
		ptofade.style.zIndex=1;
		pnext.style.zIndex=2;
		i=i+1;u=0;
		if ( i == emax && loopshow == false ) {
			// pass
		} else {
			window.setTimeout("slide(i)",stim);
		}
	}
	if ( loopshow ) {
		if(u>=steps&&i>=emax){
			ptofade.style.visibility="hidden";
			ptofade.style.zIndex=1;
			pnext.style.zIndex=2;
			i=1;u=0;
			window.setTimeout("slide(i)",stim);}
		}
	}
function shownow(){
	var myEl = document.getElementById(divid);
	if ( myEl ) {
		myEl.innerHTML=tp;
		if(startwhen){window.setTimeout("myfade()",stim);}
	}
}
onload=shownow;
