// Set slideShowSpeed (milliseconds)
var slideShowSpeedAds = 5000

// Duration of crossfade (seconds)
var crossFadeDurationAds = 3

// Specify the image files and destination urls.
var ads 	= new Array()
var adsUrl 	= new Array()
ads[0]  	= '../images/reclamebutton_1_woningaanbod.jpg';      adsUrl[0]  	= '/search.asp';
ads[1]  	= '../images/reclamebutton_2_taxatierapport.jpg';    adsUrl[1]  	= '/taxaties.asp';
ads[2]  	= '../images/reclamebutton_3_aankoopmakelaar.jpg';   adsUrl[2]  	= '/aankoop.asp';

var x
var y = 0
var z = ads.length

// Preload images.
var preLoadAds = new Array()
for (w = 0; w < z; w++){
   preLoadAds[w] = new Image()
   preLoadAds[w].src = ads[w]
}

function RotateAds()
{
	if (document.all)
	{
		// Nice effect!
		document.images.SlideShow.style.filter="blendTrans(duration=2)";
	    document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDurationAds)";
	    document.images.SlideShow.filters.blendTrans.Apply()  ;    
	}
	// New image.
	document.images.SlideShow.src = preLoadAds[y].src;
	document.images.SlideShow.alt = adsUrl[y];
	// New link destination.
	document.getElementById('TheLink').href=adsUrl[y];
	
	if (document.all)
	{
		document.images.SlideShow.filters.blendTrans.Play()
	}
	y = y + 1
	if (y > (z-1)) y=0
	
	// Come back later.
	x = setTimeout('RotateAds()', slideShowSpeedAds)
}
