/*----------------------------------------------------
||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 refreshTime2 = 3500; //- 5000 ms = 5 seconds -\\

//-4) number of ads to rotate -\\
var numAds2 = 3;

function makeAd2() {
	this.width = ''
	this.height = ''
	this.src = ''
	this.href = ''
	this.mouseover = ''
	this.sponsor = ''
}

var ads2 = new Array()
for(var j = 1; j <= numAds2; j++) { ads2[j] = 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)
j = 1;

/*------------begin banner definition----------*/
ads2[j].width = "196"                           //width of image
ads2[j].height = "110"                           //height of image
ads2[j].src = "images/quizbanner/artsclub.gif"      //image url
ads2[j].href = "artsclub/quizhome.aspx?cid=4"       //link url
ads2[j].mouseover = ""            //text to display when mouse moves over banner
ads2[j].sponsor = ""              //text to display for text link under banner
ads2[j].target = "_blank"
j++
/*-------------end banner definition-----------*/

ads2[j].width = "196"
ads2[j].height = "110"
ads2[j].src = "images/quizbanner/movieclub.gif"
ads2[j].href = "movieclub/quizhome.aspx?cid=2"
ads2[j].mouseover = ""
ads2[j].sponsor = ""
ads2[j].target = "_blank"
j++


ads2[j].width = "196"
ads2[j].height = "110"
ads2[j].src = "images/quizbanner/passion.gif"
ads2[j].href = "quizhome.aspx"
ads2[j].mouseover = ""
ads2[j].sponsor = ""
ads2[j].target = "_blank"
j++


var myCode2 = '';
do {
var n2= Math.floor(Math.random() * (numAds2 + 1) + 1);
} while(n2 > numAds2);
var current_ad2 = n2;
myCode2 = getCode2(n2);

// NB: currently this banner opens new window, remove the target line if not requires to open new window
function getCode2(adNumber2){
	var tempCode2 = ""
	tempCode2 += ('<a href="'+ ads2[adNumber2].href +'" \n')
	if (ads2[adNumber2].target != "")
	{
	    tempCode2 += ('target="=\''+ ads2[adNumber2].target +'\n')
	}
	tempCode2 += ('onMouseOver="status=\''+ ads2[adNumber2].mouseover +'\';return true" \n')
	tempCode2 += ('onMouseOut="status=\'\'"> \n')
	tempCode2 += ('<img src="' + ads2[adNumber2].src + '" width=' + ads2[adNumber2].width)
	tempCode2 += (' onload="setTimeout(\'newAd2();\',' + refreshTime2 + ');"')
	tempCode2 += ('\n height=' + ads2[adNumber2].height + ' border=0 >')
	tempCode2 += ('</a>')
	return tempCode2;
	}

function newAd2(){    
	current_ad2++;
	if (current_ad2 > numAds2)
		current_ad2 = 1;		
	write2(getCode2(current_ad2));
}

function write2(text){
    document.getElementById('quizBannerAd').innerHTML  = getCode2(current_ad2);
}