
var refreshTime = 5000; //- 5000 ms = 5 seconds -

var numAds = 6;

function makeAd() {
	this.width = ''
	this.height = ''
	this.src = ''
	this.href = ''
	this.mouseover = ''
	this.sponsor = ''
}

var ads = new Array()
for(var i = 1; i <= numAds; i++) { ads[i] = new makeAd() }

i = 1;


/*------------begin banner definition----------*/
ads[i].width = "400"								//width of image
ads[i].height = "45"								//height of image
ads[i].src = "http://www.kunstinhuis.be/Media/banners/1/banner_contact.gif"  								//image url
ads[i].href = "http://www.kunstinhuis.be/Content/filialenenopeningstijden/1/index.html"				//link url
ads[i].mouseover = "Nieuws"	//text to display when mouse moves over banner
ads[i].sponsor = ""							//text to display for text link under banner
i++
/*-------------end banner definition-----------*/


ads[i].width = "400"    
ads[i].height = "45"                  
ads[i].src = "http://www.kunstinhuis.be/Media/banners/1/banner_werking.gif"  			
ads[i].href = "http://www.kunstinhuis.be/Content/kunstenaarswerking/belangkunstenaar/1/index.html"           	 
ads[i].mouseover = "Nieuws"       
ads[i].sponsor = ""                 
i++

ads[i].width = "400"    
ads[i].height = "45"                  
ads[i].src = "http://www.kunstinhuis.be/Media/banners/1/banner_kunstopkot.gif"  			
ads[i].href = "http://www.kunstinhuis.be/Content/kunstlenenalsstudent/1/index.html"           	 
ads[i].mouseover = "Nieuws"       
ads[i].sponsor = ""                 
i++

ads[i].width = "400"    
ads[i].height = "45"                  
ads[i].src = "http://www.kunstinhuis.be/Media/banners/1/banner_nieuws.gif"  			
ads[i].href = "http://www.kunstinhuis.be/Content/nieuws/1/index.html"           	 
ads[i].mouseover = "Nieuws"       
ads[i].sponsor = ""                 
i++

ads[i].width = "400"    
ads[i].height = "45"                  
ads[i].src = "http://www.kunstinhuis.be/Media/banners/1/banner_partners.gif"  			
ads[i].href = "http://www.kunstinhuis.be/Content/partners/1/index.html"           	 
ads[i].mouseover = "Nieuws"       
ads[i].sponsor = ""                 
i++

ads[i].width = "400"    
ads[i].height = "45"                  
ads[i].src = "http://www.kunstinhuis.be/Media/banners/1/banner_cadeau.gif"  			
ads[i].href = "http://www.kunstinhuis.be/Content/kunstalscadeau/1/index.html"           	 
ads[i].mouseover = "Nieuws"       
ads[i].sponsor = ""                 
i++



var myCode = '';
do {
var n= Math.floor(Math.random() * (numAds + 1) + 1);
} while(n > numAds);
var current_ad = n;
myCode = getCode(n);

function getCode(adNumber){
	var tempCode = ""
	tempCode += ('<a href="'+ ads[adNumber].href +'" \n')
	tempCode += ('onMouseOver="status=\''+ ads[adNumber].mouseover +'\';return true" \n')
	tempCode += ('onMouseOut="status=\'\'"> \n')
	tempCode += ('<img src="' + ads[adNumber].src + '" width=' + ads[adNumber].width)
	tempCode += (' onLoad="setTimeout(\'newAd();\',' + refreshTime + ');"')
	tempCode += ('\n height=' + ads[adNumber].height + ' border=0 >')
	tempCode += ('</a>')
	return tempCode;
	}

function newAd(){
	current_ad++;
	if (current_ad > numAds)
		current_ad = 1;
	if (document.all){
	   write(getCode(current_ad));
	   }
}

function write(text){
	if (document.layers) {
		document.bannerAd.document.write(text)
		document.bannerAd.document.close();
		}
	else
		if (document.all)
			document.all.bannerAd.innerHTML = text
	
}