//- time between switching the ad, in milliseconds -\\
var refreshTime = 5000; //- 5000 ms = 5 seconds -\\

//- number of ads to rotate -\\
var numAds = 4;

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

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

//- Copy and paste the lines between the banner definition for 
//each banner you want to rotate and be sure to change numAds to 
//the number of banners (look about 15 lines up for numAds)
i = 1;


/*------------begin banner definition----------*/
ads[i].width = "480"
ads[i].height = "60"
ads[i].src = "sitework_v2/mods/dawn_of_skirmish.jpg"
ads[i].href = "http://forums.revora.net/index.php?showforum=478"
ads[i].mouseover = "Dawn of War:Winter Assault Advanced Skirmish AI"
i++

ads[i].width = "480"    
ads[i].height = "60"                  
ads[i].src = "sitework_v2/mods/Survival_mode.jpg"  			
ads[i].href = "http://p2.forumforfree.com/argonaut.html"           	 
ads[i].mouseover = "Survival Mode"               
i++

ads[i].width = "480"    
ads[i].height = "60"                  
ads[i].src = "sitework_v2/mods/paintermod.jpg"  			
ads[i].href = "http://wh40k.ei8ht.net/mods1.htm"           	 
ads[i].mouseover = "Mods Page downloads"              
i++

ads[i].width = "480"    
ads[i].height = "60"                  
ads[i].src = "sitework_v2/mods/SkinsAtHWT_480x60.jpg"  			
ads[i].href = "http://skins.hiveworldterra.co.uk/"           	 
ads[i].mouseover = "Skins at Hiveworld Terra"              
i++

/*-------------end banner definition-----------*/

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
	
}