/*----------------------------------------------------
||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 = 20000; //- 5000 ms = 5 seconds -\\

//-4) number of ads to rotate -\\
var numAds = 9;
/* CURRENT ADS:
(1) Advertising - infinite
(2) Melbourne conference - September 11
(3) R*BY
(4)TAFE - September 10
(5) HT
(6) HT
(7) HT
(8) conf sponsor HQN
(9) 
(10)
(11)
(12)conf sponsor Baci - start July

*/

//function makeAd() {
	//this.width = '120'
	//this.height = '240'
	//this.src = 'http://www.romanceaustralia.com/TESTING/ads/'
	//this.href = ''
	//this.mouseover = ''
	//this.sponsor = ''
//} 
function makeAd() {
	this.width = ''
	this.height = ''
	this.src = ''
	this.href = ''
	this.mouseover = ''
}

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;




/*------------(1) begin banner definition----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/banner-ad.gif"  			       //image url
ads[i].href = "http://www.romanceaustralia.com/advertise.html"      	       //link url
ads[i].mouseover = "Your ad here!"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/

/*------------(2) begin banner conference MELBOURNE definition----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/banner-conf-mel.gif"  			       //image url
ads[i].href = "http://www.romanceaustralia.com/conference_melbourne.html"        	       //link url
ads[i].mouseover = "RWA National Conference 2011"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/
/*------------(3) begin banner R*BY definition----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/banner-rby.gif"  			       //image url
ads[i].href = "http://www.romanceaustralia.com/rby.html"        	       //link url
ads[i].mouseover = "Romantic Book of the Year"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/
/*------------(4) begin TAFE banner definition (until SEPTEMBER 2010----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/banner-tafe.gif"  			      //image url
ads[i].href = "http://www.oten.edu.au"         	    //link url
ads[i].mouseover = "Your ad here!"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/
/*------------(5) begin Hearts Talk 1 definition ongoing----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/HTAd1.jpg"  			       //image url
ads[i].href = "http://www.romanceaustralia.com/login.html"                //link url
ads[i].mouseover = "NEW in this month's Hearts Talk!"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/
/*------------(6) begin Hearts Talk 2 definition ongoing----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/HTAd2.jpg"  			       //image url
ads[i].href = "http://www.romanceaustralia.com/login.html"         	       //link url
ads[i].mouseover = "NEW in this month's Hearts Talk!"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/


/*------------(7) begin Hearts Talk 3 definition ongoing----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/HTAd3.jpg"  			       //image url
ads[i].href = "http://www.romanceaustralia.com/login.html"         	       //link url
ads[i].mouseover = "NEW in this month's Hearts Talk!"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/

/*------------(8) begin Conference Sponsor Harlequin banner definition----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/conf_gld_hqn.gif"  			       //image url
ads[i].href = "http://www.eharlequin.com"         	       //link url
ads[i].mouseover = "A Romance for Every Mood"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/
/*------------(12) begin Conference Sponsor Baci banner definition----------*/
ads[i].width = "120"                           //width of image
ads[i].height = "240"                           //height of image
ads[i].src = "http://www.romanceaustralia.com/ads/Conf_Baci.jpg"  			       //image url
ads[i].href = "http://www.europeanfoods.com.au/baci"         	       //link url
ads[i].mouseover = "Baci"            //text to display when mouse moves over banner
i++
/*-------------end banner definition-----------*/


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 += ('onMouseOver="status=\''+ ads[adNumber].mouseover +'\';return true" \n')
	tempCode += ('onMouseOut="status=\'\'"> \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
	
}