/*----------------------------------------------------
||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 = 15000; //- 5000 ms = 5 seconds -\\

//-4) number of ads to rotate -\\
var numPhotos = 13;
var banner_width = "602"
var banner_height = "135"

var photos = new Array()

//- 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;
photos[i++] = "/images/banner_photo_01.jpg"
photos[i++] = "/images/banner_photo_02.jpg"
photos[i++] = "/images/banner_photo_03.jpg"
photos[i++] = "/images/banner_photo_04.jpg"
photos[i++] = "/images/banner_photo_05.jpg"
photos[i++] = "/images/banner_photo_06.jpg"
photos[i++] = "/images/banner_photo_07.jpg"
photos[i++] = "/images/banner_photo_08.jpg"
photos[i++] = "/images/banner_photo_09.jpg"
photos[i++] = "/images/banner_photo_10.jpg"
photos[i++] = "/images/banner_photo_11.jpg"
photos[i++] = "/images/banner_photo_12.jpg"
photos[i++] = "/images/banner_photo_13.jpg"


var myCode = '';
do {
var n= Math.floor(Math.random() * (numPhotos + 1) + 1);
} while(n > numPhotos);
var current_photo = n;
myCode = getCode(n);

function getCode(photoNumber){
	var tempCode = ""
	tempCode += ('<img src="' + photos[photoNumber] + '" width=' + banner_width)
	tempCode += (' onLoad="setTimeout(\'newPhoto();\',' + refreshTime + ');"')
	tempCode += ('\n height=' + banner_height + ' align="bottom">')
	return tempCode;
	}

function newPhoto(){
	current_photo++;
	if (current_photo > numPhotos)
		current_photo = 1;
	if (document.all){
	   write(getCode(current_photo));
	   }
}

function write(text){
	if (document.layers) {
		document.bannerPhoto.document.write(text)
		document.bannerPhoto.document.close();
		}
	else
		if (document.all)
			document.all.bannerPhoto.innerHTML = text
	
}