
/***************************************************************************************
Copyright (C) 2001 ab_ditto
This script is made by and copyrighted to ab_ditto at back.to/ab or ab_ditto@hotmail.com
This may be used freely as long as this msg is intact!
date:2001-09-30
***************************************************************************************/
//*****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
function initpic() {
imges=new Array ('images/banner/B_Visiev-Rumst-dec-2010_N.gif', 'images/banner/Banner-BruggeCentraal_N.gif','images/banner/Transvisite-dec2010_N.gif', 'images/banner/Banner conferentie 17 mei 2011.gif');
links=new Array ('Page.aspx?Id=331&Lang=NL','Page.aspx?Id=332&Lang=NL','Page.aspx?Id=335&Lang=NL', 'http://www.toerismemarketing.com/index.php?page=programma');
//picleft=100; //set this to the left position of your pics to be shown on the page
picleft = document.getElementById('bannerstart').style.left;
pictop=55; //set this to the top position of your pics to be shown on the page

picwid=400; //set this to the width of your widest pic
pichei=104; //... and this to the height of your highest pic

<!--
if (document.addEventListener)
	{
		// tvda - Firefox - other top value
		pictop=55;
	}
	
	if (BrowserDetect.browser == "Explorer" && BrowserDetect.version == "7")
	{
		// tvda - Firefox - other top value
		
		pictop=55;
	}
//alert(BrowserDetect.browser + "   " + BrowserDetect.version);

backgr="#FFFFFF"; //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
sdur=4; //time to show a pic between fades in seconds
fdur=1.2; //duration of the complete fade in seconds
steps=20; //steps to fade from on pic to the next
startwhen=0;
// "startwhen" leave it at "null" to start the function by calling it from your page by link
// or set it to 1 to start the slide automatically as soon as the images are loaded
//*****nothing more to do, have fun :)
//**************************************************************************************
ftim=fdur*1000/steps;stim=sdur*1000;emax=imges.length;
for(e = 1; e <= emax; e++) {
	theid="img"+e;
	thesrc=imges[e-1];
	thelink=links[e-1];
	document.write("<div id='"+theid+"'><a href='"+thelink+"'><img src='"+thesrc+"' border='0'></img></a></div>");
	}
document.write("<style type='text/css'>");
for(b = 1; b <= emax; b++) {
	thestylid="img"+b;thez=3;thevis='hidden';
	if(b<=1) {thez=4; thevis='visible';}
	document.write("#"+thestylid+" {position:absolute; left:"+picleft+"px; top:"+pictop+"px; width:"+picwid+"px; height:"+pichei+"px; visibility:"+thevis+"; z-index:"+thez+";margin:0px; padding:0px; border:0px;}");
	}
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.display = "block";
	pnext.style.filter = "Alpha(Opacity=100)";
	pnext.style.MozOpacity = 1;
	//
	ptofade.style.filter = "Alpha(Opacity=100)";
	ptofade.style.MozOpacity = 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;
	//document.getElementById("menu").style.zIndex = 206;
	//	document.getElementById("menu").style.visibility = "visible";
	ptofade.style.filter = "Alpha(Opacity="+curralpha+")";
	ptofade.style.MozOpacity = curralpha/100;
	if(u<steps){window.setTimeout("slidenow()",ftim);}
	if(u>=steps && i<emax){
		ptofade.style.visibility = 'hidden';
		ptofade.style.zIndex = 3;
		pnext.style.zIndex = 4;
		//document.getElementById("menu").style.zIndex = 206;
		//document.getElementById("menu").style.visibility = "visible";
		i= parseInt(i)+1;u=0;
		//i= i+1;u=0;
		//alert("y " + i);
		window.setTimeout("slide(i)",stim);}
	if(u>=steps && i>=emax){
		ptofade.style.visibility = 'hidden';
		ptofade.style.zIndex = 3;
		pnext.style.zIndex = 4;
		//document.getElementById("menu").style.zIndex = 206;
		//document.getElementById("menu").style.visibility = "visible";
		i=1;u=0;
		window.setTimeout("slide(i)",stim);}
	}
function dostart(){window.setTimeout("myfade()",stim);}
