var refreshTime = 15000;

var numAds = 8;

function makeAd() {
	this.width = ''
	this.height = ''
	this.src = ''
}

var ads = new Array()
for(var i = 1; i <= numAds; i++) { ads[i] = new makeAd() }

i = 1;

ads[i].width = "820"                           
ads[i].height = "200"                           
ads[i].src = "../../headerimages/1.png"  			       
i++

ads[i].width = "820"                           
ads[i].height = "200"                 
ads[i].src = "../../headerimages/2.png"  			
i++

ads[i].width = "820"                           
ads[i].height = "200"                   
ads[i].src = "../../headerimages/3.png"  			
i++

ads[i].width = "820"                           
ads[i].height = "200"                
ads[i].src = "../../headerimages/4.png"  			
i++

ads[i].width = "820"                           
ads[i].height = "200"            
ads[i].src = "../../headerimages/5.png"  			
i++

ads[i].width = "820"                           
ads[i].height = "200"            
ads[i].src = "../../headerimages/6.png"  			
i++

ads[i].width = "820"                           
ads[i].height = "200"            
ads[i].src = "../../headerimages/7.png"  			
i++

ads[i].width = "820"                           
ads[i].height = "200"            
ads[i].src = "../../headerimages/8.png"  			
i++


var myCodenew = '';
do {
var n= Math.floor(Math.random() * (numAds + 1) + 1);
} while(n > numAds);
var current_ad = n;
myCodenew = getCode(n);


function getCode(adNumber){
	var tempCode = ""
	tempCode += ('<img src="' + ads[adNumber].src + '" width=' + ads[adNumber].width)
	//tempCode += (' onLoad="setTimeout(\'newAd();\',' + refreshTime + ');"')
	tempCode += ('\n height=' + ads[adNumber].height + ' border=0 >')
	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
	
}