/** Script settings  **/

var settings = {
	
	'force_size':			0,         		// 	if set to 1 all banners will be resized to the width and height in the next to settings
	'img_width':			181,			//	width to resize all banners to, only takes effect if above is 1
	'img_height':			181, 			// 	height to resize all banners to, only takes effect if above is 1
	
	'refresh_time':			8000,			//	the seconds between refreshs of the banners - use 0 to disable
	'refresh_max':			100,				//	maximum number of refreshs on each page load
	
	'duplicate_banners':	0,				//	keep as 0 to make sure the same banner won't show on the same page. will only take effect
											//  if show_banners(); is used more than once. You must make sure you have enough banners to fill
											//  all the slots else the browser may freeze or give a stack overflow error
	
	'location_prefix': 		'adLocation-',	//	The prefix of the IDs of the <div> which wraps the banners - this div is generated dynamically.
											//  a number will be added on the end of this string. adLocation- was used by default before version 1.4.x
											
	'location_class':		'swb',			//  A class to add to all of the <div>s which wrap the banners, ideal to use for styling banners - use .swb img in your CSS	
	
	'window': 				'_self',		//	Window to open links in, _self = current, _blank = new. Use _top if in a frame!		
	
	'default_ad_loc':		'default'		//	The default adLocation. This is assigned to any banners not given an adLocation in the below banner list
											//  There is no real reason to need to change this
}


/**
		Banners
**/
// banner list syntax: new banner(website_name, website_url, banner_url, show_until_date, adlocation),  DATE FORMAT: dd/mm/yyyy
// if you're not using adlocations just leave it empty like '' as in the last example here
// to make sure a banner is always rotating, just set the date far into the future, i.e. year 3000

var banners = [
// LEFT
	new banner('March Madness Blackjack Tournament', 'casino.html', 'home_images/MM2012_homepg.png', '10/04/2019', 'left'),
//	new banner('Ladies Steppin Out Weekend', 'entertainment.html', 'home_images/LSO_homebx.png', '10/04/2019', 'left'),
	new banner('Super Seniors', 'promotions.html#showroom', 'home_images/Super-Senior-Tues.jpg', '26/09/2012', 'left'),
	new banner('Bourbons 72!', 'promotions.html', 'home_images/F&B_B-72-roll.jpg', '30/04/2019', 'left'),
// MIDDLE/CENTER	
//tcc_Fall_Poker-roll.jpg
	new banner('Million Dollar Spin', 'promotions.html', 'home_images/MDS_homepage.png', '30/04/2019', 'center'),
	new banner('WIN a BMW 328i', 'promotions.html', 'home_images/classy-chassis-roll.png', '30/04/2019', 'center'),
//	new banner('Ring In The Season', 'promotions.html#', 'home_images/RITS_181x100.png', '26/09/2012', 'center'),	
//	new banner('Trick Or Treat Poker!', 'casino.html', 'home_images/tcc_Trick_or_treat-roll.png', '30/04/2019', 'center'),
		
// RIGHT
	new banner('Fab Fridays', 'promotions.html#vegas', 'home_images/fab_fridays_homepage.png', '10/04/2019', 'right'),
	new banner('Seasons Buffet', 'promotions.html#monday', 'home_images/Seasons.jpg', '10/04/2019', 'right'),
//	new banner('ATV Giveaway', 'entertainment.html', 'home_images/TTRLT_homepg.png', '10/04/2019', 'right'),

// BOTTOM - 600x300
	new banner('SnoX Championship Series', 'entertainment.html', 'home_images/SnoX2012_600x300.png', '06/08/2020', 'btm'),
	new banner('March Madness Blackjack Tournament', 'casino.html', 'home_images/MM2012_homepg.png', '06/08/2020', 'btm'),
	new banner('WIN a BMW 328i', 'promotions.html', 'home_images/classy-chassis600.png', '20/09/2018', 'btm'),
	new banner('New Poker Room', 'hs_poker.html', 'promotion_images/Poker_Room.png', '21/09/2018', 'btm'),
//	new banner('New Year Eve Bands', '', 'home_images/NYEBand_entertainmentbx.png', '21/08/2018', 'btm'),
//	new banner('Holiday Hot Seats', 'promotions.html', 'home_images/HHS_600x300.png', '21/08/2018', 'btm'),	
	new banner('Million Dollar Spin', 'promotions.html', 'home_images/MDS_600x300.png', '21/08/2018', 'btm'),
//	new banner('WIN a Pair of Red Wings tickets', '', 'home_images/RedWingTix600x300_12.30.11.png', '30/04/2019', 'btm'),
//	new banner('Ladies Steppin Out Weekend!', 'promotions.html', 'home_images/LSO_entertainmentbx.png', '30/04/2019', 'btm'),
	
]

//         				There is no need to edit below here
///////////////////////////////////////////////////////////////////////////////////
var used=0;var location_counter=0;var refresh_counter=1;var map=new Array();function banner(a,b,c,d,e){this.name=a;this.url=b;this.image=c;this.date=d;this.active=1;this.oid=0;if(e!=''){this.loc=e}else{this.loc=settings.default_ad_loc}}function show_banners(a){location_counter=location_counter+1;if(a!=''&&a!=undefined){map[location_counter]=a}else{map[location_counter]=settings.default_ad_loc}var b='<div id="'+settings.location_prefix+location_counter+'" class="'+settings.location_class+'"></div>';document.write(b);display_banners(location_counter)}function display_banners(a){var b=new Array();if(a==''||!a||a<0){return}var c=banners.length;if((c==used)&&settings.duplicate_banners==0){return}for(i=0;i<(banners.length);i++){banners[i].oid=i;if((banners[i].loc==map[a])&&(banners[i].active==1)){b.push(banners[i])}}var d=Math.floor(Math.random()*b.length);var e=b[d];var f=(settings.force_size==1)?' width="'+settings.img_width+'" height="'+settings.img_height+'"':'';var g='<a href="'+e.url+'" title="'+e.name+'" target="'+settings.window+'"><img border="0" src="'+e.image+'"'+f+' alt="'+e.name+'" /></a>';var h=new Date();var j=e.date;j=j.split('/',3);var k=new Date();k.setFullYear(parseInt(j[2]),parseInt(j[1])-1,parseInt(j[0]));if((h<k)&&e.active==1){var l=document.getElementById(settings.location_prefix+a);if(l==null){alert('spyka Webmaster banner rotator\nError: adLocation doesn\'t exist!')}else{l.innerHTML=g;if(settings.duplicate_banners==0){banners[e.oid].active=0;used++}return}}else{display_banners(a)}return}function refresh_banners(){if((refresh_counter==settings.refresh_max)||settings.refresh_time<1){clearInterval(banner_refresh)}used=0;for(j=0;j<(banners.length);j++){banners[j].active=1}for(j=1;j<(location_counter+1);j++){display_banners(j)}refresh_counter++}var banner_refresh=window.setInterval(refresh_banners,settings.refresh_time);
