function SlideShow(name){
	this.name = name;
	this.slideShowSpeed = 5000;
	this.crossFadeDuration = 2;
	this.j = 0;
	this.p = 0;
	this.preLoad = new Array();
	this.add = function(src,alt,url,target){
		var pos = this.preLoad.length;
		this.preLoad[pos] = new Array();
		this.preLoad[pos][0] = new Image();
		this.preLoad[pos][0].src = src;
		this.preLoad[pos][1] = alt;
		this.preLoad[pos][2] = url;
		this.preLoad[pos][3] = target;
		this.p++;
		// Indien meer dan 10 Images wil ik niet steeds dezelfde starterimage zien.
		if (this.p > 10){
			this.j = Math.floor(Math.random()* (this.p));
		}
	}

	this.setCrossFadeDuration = function(crossFadeDuration){
		this.crossFadeDuration = crossFadeDuration;
	}
	this.setSlideShowSpeed = function(slideShowSpeed){
		this.slideShowSpeed = slideShowSpeed;
	}
	this.slide = function(){
		var img = document.getElementById(this.name+'_I');
		var a = document.getElementById(this.name+'_A');
		if (document.all) {
			img.style.filter="blendTrans(duration="+this.crossFadeDuration+")";
			img.filters.blendTrans.Apply();
		}
		img.src = this.preLoad[this.j][0].src;
		img.alt = this.preLoad[this.j][1];
		a.title = this.preLoad[this.j][1];
		a.href = this.preLoad[this.j][2];
		a.target = this.preLoad[this.j][3];
		if (document.all) {
			img.filters.blendTrans.Play();
		}
		
		// Indien meer dan 10 Images gaan we random.
		
		if (this.p > 10){
			this.j = Math.floor(Math.random()* (this.p));
			
		}else{
			this.j++;
			if (this.j > (this.p - 1)) this.j = 0;
		}
		var t = setTimeout(this.name+'.slide()', this.slideShowSpeed);
		this.c = "uitgevoerd";
	}
}
