var refreshTime = 1800;

var numAds = 5;

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;

ads[i].width = "150"
ads[i].height = "119"
ads[i].src = "http://radio.moose216.org/img/moose150x119cxd.png"
ads[i].href = "http://www.moose216.org"
ads[i].mouseover = "Moose216.org"
ads[i].sponsor = "Moose216.org" 
i++

ads[i].width = "150"    
ads[i].height = "119"                  
ads[i].src = "http://moose216.org/img/radio152x125.jpg"  			
ads[i].href = "http://www.mooseradio.net"           	 
ads[i].mouseover = "MooseRadio.net"       
ads[i].sponsor = "MooseRadio.net"                 
i++

ads[i].width = "150"    
ads[i].height = "119"                  
ads[i].src = "http://radio.moose216.org/img/njmoose150x119.png"  			
ads[i].href = "http://www.njmoose.org"           	 
ads[i].mouseover = "NJMoose.org"       
ads[i].sponsor = "NJMoose.org"                 
i++

ads[i].width = "150"    
ads[i].height = "119"                  
ads[i].src = "http://riders.moose216.org/images/acrc149x119.jpg"  			
ads[i].href = "http://acriders.org"           	 
ads[i].mouseover = "ACRiders.org"       
ads[i].sponsor = "ACRiders.org"                 
i++

ads[i].width = "150"    
ads[i].height = "119"                  
ads[i].src = "http://SocialQuarters.moose216.org/img/socialquarters150x119.jpg"  			
ads[i].href = "http://socialquarters.com"           	 
ads[i].mouseover = "SocialQuarters.com"       
ads[i].sponsor = "SocialQuarters.com"                 
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 += ('<br><font face=Vrinda size=-2 color=#000020><b>' + ads[adNumber].sponsor + '</b></font>') //
	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
	
}