


//Setup Instructions:
//-0) Modify this file then copy and paste it into the <head> of the webpage to use the banner ad script

/*---------------------------
1) add into your <head>:
 
<script language="javascript" src="bannerscript.js"></script>

<style>
<!--
#bannerAd{visibility:visible;}
-->
</style>
 
-----------------------------*/

/*----------------------------
2) add this code into your webpage where you want the banner ad to be displayed:

<!-- Banner Ad code -->
<div id="bannerAd">
<script language="JavaScript">
<!-- 
document.write(myCode)
// -->
</script>
</div>
<!-- End Banner Ad-->

-----------------------------*/

//-3) time between switching the ad, in milliseconds -\\
var refreshTime = 15000000; //- 5000 ms = 5 seconds -\\

//-4) number of ads to rotate -\\
var numAds = 8;

function makeAd() {
	this.width = ''
	this.height = ''
	this.src = ''
	this.href = ''
}

var ads = new Array()
for(var i = 1; i <= numAds; i++) { ads[i] = new makeAd() }

//- 5) 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;



/*-------------end banner definition-----------*/
     
ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=41772&mid=1035&gid=24278&aid=11958"  			       //image url
ads[i].href = "http://www.awin1.com/awclick.php?linkid=41772&mid=1035&gid=24278&id=11958"         
i++
/*------------begin banner definition----------*/

ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=23402&mid=829&gid=13561&aid=11958"		       //image url
ads[i].href = "http://www.awin1.com/awclick.php?linkid=23402&mid=829&gid=13561&id=11958"   
i++
/*-------------end banner definition-----------*/

ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=1939&mid=129&gid=882&aid=11958"  			       //image url
ads[i].href = href="http://www.awin1.com/awclick.php?linkid=1939&mid=129&gid=882&id=11958"        
i++

/*------------begin banner definition----------*/

ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=23269&mid=736&gid=13858&aid=11958" 			       //image url
ads[i].href = "http://www.awin1.com/awclick.php?linkid=23269&mid=736&gid=13858&id=11958"  
i++
/*-------------end banner definition-----------*/

ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=7100&mid=399&gid=4092&aid=11958" 			       //image url
ads[i].href = "http://www.awin1.com/awclick.php?linkid=7100&mid=399&gid=4092&id=11958" 
i++
/*-------------end banner definition-----------*/
ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=27000&mid=920&gid=16797&aid=11958"			       //image url
ads[i].href = "http://www.awin1.com/awclick.php?linkid=27000&mid=920&gid=16797&id=11958"  
i++
/*-------------end banner definition-----------*/

ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=18654&mid=732&gid=11108&aid=11958"			       //image url
ads[i].href = "http://www.awin1.com/awclick.php?linkid=18654&mid=732&gid=11108&id=11958" 
i++
/*-------------end banner definition-----------*/

ads[i].width = "468"                           //width of image
ads[i].height = "60"                           //height of image
ads[i].src = "http://www.awin1.com/show.php?linkid=18654&mid=732&gid=11108&aid=11958"			       //image url
ads[i].href = "http://www.awin1.com/awclick.php?linkid=18654&mid=732&gid=11108&id=11958" 


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 += ('target="_blank" > \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
	
}
