function loadBanners(settings) {



	// parameters

	this.block = document.getElementById(settings.block);

	this.mapping = settings.mapping;

	this.numbanners = this.mapping.length;

	this.numlayers = settings.numlayers;

	this.marginbottom = settings.marginbottom;

	this.interval = settings.interval;

	this.direction = settings.direction;

	

	// maak banner container

	bannermask = document.createElement('div');

	bannermask.style.width = "1000000px";
	bannermask.style.zIndex = 0;
	bannermask.style.position = "relative";

	bannermask.id = this.id + "mask";

	this.block.appendChild(bannermask);

		

	// plaats de eerste banners

	for (x=0; x<this.numlayers; x++)

	{

		banner = document.createElement('div');

		if (this.direction == "bottom")

		{

			banner.style.marginBottom = this.marginbottom + "px";

		}

		else

		{

			banner.style.marginRight = this.marginbottom + "px";

			banner.style.float = 'left';

			banner.style.width = "auto";

			banner.style.display = 'inline';

		}

		ahref = document.createElement('a');

		ahref.href = '/php/banner.php?action=click&id=' + this.mapping[x+1][0];

		image = document.createElement('img');

		image.src = this.mapping[x+1][1];

		if (this.mapping[x+1][2] != '') {

			var mouseimg = new Image();

			mouseimg.src = this.mapping[x+1][2];

			var mouseout = new Image();

			mouseout.src = this.mapping[x+1][1];

			image.onmouseover = function() { this.src=mouseimg.src};

			image.onmouseout = function() { this.src=mouseout.src};

		}

		image.border = 0;

		ahref.appendChild(image);

		banner.appendChild(ahref);

		bannermask.appendChild(banner);

	}

	

	// meet de hoogte van de eerste banners

	maskheight = 0;

	for (x=0; x<this.numlayers; x++)

	{

		var edim = Element.getDimensions(bannermask.childNodes[x]);	

		maskheight = (maskheight+edim.height) + this.marginbottom;

	}



	// dynamisch banners bijplaatsen

	bannermask.current = 0;

	bannermask.marginbottom = this.marginbottom;

	bannermask.numbanners = this.numbanners;

	this.block.style.overflow = "hidden";
	this.block.style.position = "relative";

	if (this.direction == "bottom")

	{

		this.block.style.height = Math.max(maskheight,180) + "px";

	}

	else

	{

		this.block.style.width = "100%";

		this.block.style.height = "100%";

	}

	current = x;

	timer = setInterval(function() {

		x = 1+ x % (this.numbanners-1);

		banner = document.createElement('div');

		if (this.direction == "bottom")

		{

			banner.style.marginBottom = this.marginbottom + "px";

		}

		else

		{

			banner.style.marginRight = this.marginbottom + "px";

			banner.style.float = 'left';

			banner.style.width = "auto";

			banner.style.display = 'inline';

			banner.style.top = "0px";

		}

		ahref = document.createElement('a');

		ahref.href = '/php/banner.php?action=click&id=' + this.mapping[x][0];

		image = document.createElement('img');

		image.src = this.mapping[x][1];

		if (this.mapping[x][2] != '') {

			var mouseimg = new Image();

			mouseimg.src = this.mapping[x][2];

			var mouseout = new Image();

			mouseout.src = this.mapping[x][1];

			image.onmouseover = function() { this.src=mouseimg.src};

			image.onmouseout = function() { this.src=mouseout.src};

		}

		image.border = 0;

		ahref.appendChild(image);

		banner.appendChild(ahref);

		bannermask.appendChild(banner);

		if (this.direction == "bottom")

		{

			bannermask.scrollBannerUp();

		}

		else

		{

			bannermask.scrollBannerLeft();

		}

		

	}, this.interval);

	

	bannermask.scrollBannerUp = function() {

				

		var cdim = Element.getDimensions(this.childNodes[this.current]);	

		this.current++;

		new Effect.Move(this, { x: 0, y: -(cdim.height+this.marginbottom), duration: 1.5} );

	}

	

	bannermask.scrollBannerLeft = function() {

				

		var cdim = Element.getDimensions(this.childNodes[this.current]);	

		this.current++;

		new Effect.Move(this, { x: -(cdim.width+this.marginbottom), y: 0, duration: 1.5} );

	}



}


