// JavaScript Document
/*----------------------------------------------------
||Banner Ad Rotater v1.01                            ||
||                                                   ||
||Script by:                                         ||
||Anarchos                                           ||
||URL: http://www.xs.mw/anarchos                     ||
||E-mail: anarchos3@hotmail.com                      ||
||ICQ: 12007422                                      ||
||                                                   ||
||E-mail or ICQ me if you have any questions or need ||
||help setting up your banner ad rotator. Check out  ||
||my webpage every once in a while for updates to    ||
||this script.                                       ||
-----------------------------------------------------*/


//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 = 2500; //- 5000 ms = 5 seconds -\\

//-4) number of ads to rotate -\\
var numAds1 = 2;
var numAds2 = 2;

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

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

var ads1 = new Array()
for(var i = 1; i <= numAds1; i++) { ads1[i] = new makeAd1() }

var ads2 = new Array()
for(var x = 1; x <= numAds2; x++) { ads2[x] = new makeAd2() }

//- 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;
x = 1;

/*------------begin banner definition----------*/
ads1[i].width = "249"                           //width of image
ads1[i].height = "60"                           //height of image
ads1[i].src = "../images/ad_crain.jpg"  			
ads1[i].href = "http://www.crainveterinary.com"           	 
ads1[i].mouseover = "Crain Veterinary Center"            //text to display when mouse moves over banner
<!--ads[i].sponsor = "Sponsor" -->                    //text to display for text link under banner
i++
ads1[i].width = "249"    
ads1[i].height = "60"                  
ads1[i].src = "../images/ad_crain.jpg"  			
ads1[i].href = "http://www.crainveterinary.com"           	 
ads1[i].mouseover = "Crain Veterinary Center"       
<!--ads[i].sponsor = "Sponsor"-->                 
i++


ads2[x].width = "249"                           //width of image
ads2[x].height = "60"                           //height of image
ads2[x].src = "../images/ad_organural.jpg"  			       //image url
ads2[x].href = "http://www.organural.com"           	       //link url
ads2[x].mouseover = "Rediscovering Nature"            //text to display when mouse moves over banner
/*ads[i].sponsor = "Sponsor"*/                     //text to display for text link under banner
x++
ads2[x].width = "249"    
ads2[x].height = "60"                  
ads1[i].src = "../images/ad_crain.jpg"  			
ads1[i].href = "http://www.crainveterinary.com"           	 
ads1[i].mouseover = "Crain Veterinary Center"      
/*ads[i].sponsor = "Sponsor" */                
x++


var myCode1 = '';
do {
var n= Math.floor(Math.random() * (numAds1 + 1) + 1);
} while(n > numAds1);
var current_ad1 = n;
myCode1 = getCode1(n);

function getCode1(adNumber1){
	var tempCode1 = ""
	tempCode1 += ('<a href="'+ ads1[adNumber1].href +'" \n')
	tempCode1 += ('onMouseOver="status=\''+ ads1[adNumber1].mouseover +'\';return true" \n')
	tempCode1 += ('onMouseOut="status=\'\'"> \n')
	tempCode1 += ('<img src="../Scripts/' + ads1[adNumber1].src + '" width=' + ads1[adNumber1].width)
	tempCode1 += (' onLoad="setTimeout(\'newAd1();\',' + refreshTime + ');"')
	tempCode1 += ('\n height=' + ads1[adNumber1].height + ' border=0 >')
	
	tempCode1 += ('</a>')
	return tempCode1;
	}
	
	function newAd1(){
	current_ad1++;
	if (current_ad1 > numAds1)
		current_ad1 = 1;
	if (document.all){
	   write1(getCode1(current_ad1));
	   }
}

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


<!--code for 2nd group of ads-->	
var myCode2 = '';
do {
var w= Math.floor(Math.random() * (numAds2 + 1) + 1);
} while(w > numAds2);
var current_ad2 = w;
myCode2 = getCode2(w);

function getCode2(adNumber2){
	var tempCode2 = ""
	tempCode2 += ('<a href="'+ ads2[adNumber2].href +'"')
	tempCode2 += ('onMouseOver="status=\''+ ads2[adNumber2].mouseover +'\';return true"')
	tempCode2 += ('onMouseOut="status=\'\'">')
	tempCode2 += ('<img src="../Scripts/' + ads2[adNumber2].src + '" width=' + ads2[adNumber2].width)
	tempCode2 += (' onLoad="setTimeout(\'newAd2();\',' + refreshTime + ');"')
	tempCode2 += ('\w height=' + ads2[adNumber2].height + ' border=0 >')
	
	tempCode2 += ('</a>')
	return tempCode2;
	}
	
	function newAd2(){
	current_ad2++;
	if (current_ad2 > numAds2)
		current_ad2 = 1;
	if (document.all){
	   write(getCode2(current_ad2));
	   }
}

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

<!--end code for 2nd group of ads-->
