/*----------------------------------------------------
||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 refreshTime3 = 3500; //- 5000 ms = 5 seconds -\\

//-4) number of ads to rotate -\\
var numAds3 = 2;

function makeAd3() {
	this.width = ''
	this.height = ''
	this.src = ''
	this.href = ''
	this.mouseover = ''
	this.sponsor = ''
}

var ads3 = new Array()
for(var k = 1; k <= numAds3; k++) { ads3[k] = new makeAd3() }

//- 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)
k = 1;

/*------------begin banner definition----------
ads3[k].width = "196"                           //width of image
ads3[k].height = "110"                           //height of image
ads3[k].src = "images/highlights/highlightbanner1.gif"      //image url
ads3[k].href = "http://www.passioncard.tv/"       //link url
ads3[k].mouseover = ""            //text to display when mouse moves over banner
ads3[k].sponsor = ""              //text to display for text link under banner
ads3[k].target = "_blank"
k++
-------------end banner definition-----------*/

ads3[k].width = "196"
ads3[k].height = "110"
ads3[k].src = "images/highlights/pa50.jpg"
ads3[k].href = "http://www.pa50.sg/"
ads3[k].mouseover = ""
ads3[k].sponsor = ""
ads3[k].target = "_blank"
k++

ads3[k].width = "196"
ads3[k].height = "110"
ads3[k].src = "images/highlights/ezr.jpg"
ads3[k].href = "http://www.ezrewards.com.sg/"
ads3[k].mouseover = ""
ads3[k].sponsor = ""
ads3[k].target = "_blank"
k++

var myCode3 = '';
do {
var n3= Math.floor(Math.random() * (numAds3 + 1) + 1);
} while(n3 > numAds3);
var current_ad3 = n3;
myCode3 = getCode3(n3);

// NB: currently this banner opens new window, remove the target line if not requires to open new window
function getCode3(adNumber3){
	var tempCode3 = ""
	tempCode3 += ('<a href="'+ ads3[adNumber3].href +'" \n')
	if (ads3[adNumber3].target != "")
	{
	    tempCode3 += ('target="=\''+ ads3[adNumber3].target +'\n')
	}
	tempCode3 += ('onMouseOver="status=\''+ ads3[adNumber3].mouseover +'\';return true" \n')
	tempCode3 += ('onMouseOut="status=\'\'"> \n')
	tempCode3 += ('<img src="' + ads3[adNumber3].src + '" width=' + ads3[adNumber3].width)
	tempCode3 += (' onload="setTimeout(\'newAd3();\',' + refreshTime3 + ');"')
	tempCode3 += ('\n height=' + ads3[adNumber3].height + ' border=0 >')
	tempCode3 += ('</a>')
	return tempCode3;
	}

function newAd3(){    
	current_ad3++;
	if (current_ad3 > numAds3)
		current_ad3 = 1;		
	write3(getCode3(current_ad3));
}

function write3(text){
    document.getElementById('highlightBannerAd').innerHTML  = getCode3(current_ad3);
}