/**
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

	--------------------------------------------------------------------
	
	Simple banner rotator. Version: 1.4.0
	Download and support: http://www.spyka.net 
	(c) Copyright 2008, 2009 spyka Web Group
	

	For full documentation:  http://www.spyka.net/docs/simple-banner-rotator
	For support:			 http://www.spyka.net/forums


**/

//								EDIT FROM HERE
///////////////////////////////////////////////////////////////////////////////////

/**
		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':			468,			//	width to resize all banners to, only takes effect if above is 1
	'img_height':			60, 			// 	height to resize all banners to, only takes effect if above is 1
	
	'refresh_time':			0,			//	the seconds between refreshs of the banners - use 0 to disable
	'refresh_max':			10,				//	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': 				'_blank',		//	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 = [
	new banner('BestBuy.com',			'http://www.anrdoezrs.net/click-3802709-10563305', 			'http://www.awltovhc.com/image-3802709-10563305', 	'30/04/2019',	''),
	new banner('Sees.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=187839.10000005&type=4&subid=0', 			'http://www.sees.com/affiliate/SeesBanner_125x125_Logo.gif', 	'27/10/2010',	''),
	new banner('Josbank.com',	'http://www.anrdoezrs.net/click-3802709-10357426', 		'http://www.ftjcfx.com/image-3802709-10357426',		'10/04/2019',	''),
	new banner('Ulta.com', 				'http://www.tkqlhce.com/click-3802709-10552792', 	'http://www.lduhtrp.net/image-3802709-10552792',		'30/04/2019',	''),
	new banner('Soccer.com', 			'http://www.kqzyfj.com/click-3802709-10475109', 	'http://www.tqlkg.com/image-3802709-10475109', 	'10/04/2019',	''),
	new banner('Mozy.com', 			'http://www.anrdoezrs.net/click-3802709-10430939', 	'http://www.awltovhc.com/image-3802709-10430939', 	'10/04/2019',	''),
	new banner('Target.com', 			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000028533551&pubid=21000000000252140', 'http://clickserve.cc-dt.com/link/tplimage?lid=41000000028533551&pubid=21000000000252140', 	'30/04/2019',	''),
	new banner('Netflix.com', 			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000030310782&pubid=21000000000252140', 	'http://clickserve.cc-dt.com/link/tplimage?lid=41000000030310782&pubid=21000000000252140', 	'10/04/2019',	''),
	new banner('CircuitCity.com',			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000028423301&pubid=21000000000252140', 			'http://clickserve.cc-dt.com/link/tplimage?lid=41000000028423301&pubid=21000000000252140', 	'30/04/2019',	''),
	new banner('FTD.com',			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000030325167&pubid=21000000000252140', 			'http://clickserve.cc-dt.com/link/tplimage?lid=41000000030325167&pubid=21000000000252140', 	'30/04/2019',	''),
	new banner('Stamps.com',			'http://www.kqzyfj.com/click-3802709-10394299', 			'http://www.lduhtrp.net/image-3802709-10394299', 	'30/04/2019',	''),
	new banner('Walmart.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=183959.10002056&type=4&subid=0', 			'http://i.walmart.com/i/email/nl/122209/125X125_affiliate.gif', 	'30/04/2019',	'HomeTop'),
	new banner('Buy.com',			'http://affiliate.buy.com/gateway.aspx?adid=17662&aid=10393994&pid=3802709&sURL=http%3A%2F%2Fwww%2Ebuy%2Ecom%2Fspecialty%5Fstore%5F6%2Fweekly%5Fdeals%2F62329%2Ehtml', 			'http://www.afcyhf.com/image-3802709-10393994', 	'30/04/2019',	''),
	new banner('PetsMart.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=170445.10000135&type=4&subid=0', 			'http://affiliates.petsmart.com/images/banners/090109/shipping-125x125.gif', 	'09/09/2011',	'HomeTop'),
	new banner('BestBuy.com',			'http://www.jdoqocy.com/click-3739559-10549758', 			'http://www.lduhtrp.net/image-3739559-10549758', 	'09/09/2019',	'HomeTop'),
	new banner('Kohls.com',			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000013903507&pubid=21000000000252140', 			'http://clickserve.cc-dt.com/link/tplimage?lid=41000000013903507&pubid=21000000000252140', 	'09/09/2019',	'HomeTop'),
	new banner('Buydig.com',			'http://www.dpbolvw.net/click-3739559-10606355', 			'http://www.awltovhc.com/image-3739559-10606355', 	'09/09/2019',	'HomeTop'),
	new banner('eBags.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=160881.10000078&subid=0&type=4', 			'http://ad.linksynergy.com/fs-bin/show?id=TtGs22521mI&bids=160881.10000078&subid=0&type=4&gridnum=4', 	'31/12/2010',	'HomeTop'),
	new banner('1-800-Flowers.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=100462.10002823&type=4&subid=0', 			'http://a1516.g.akamai.net/f/1516/9236/1h/affiliate.1800flowers.com/flowers/graphics/Justbecause/JB01a03nF10.jpg', 	'02/03/2011',	'HomeTop'),
	new banner('4wd.com',			'http://www.jdoqocy.com/click-3802709-10448099', 			'http://www.awltovhc.com/image-3802709-10448099', 	'09/09/2019',	'HomeTop'),
	new banner('NewEgg.com',			'http://www.tkqlhce.com/click-3802709-10451795', 			'http://www.ftjcfx.com/image-3802709-10451795', 	'09/09/2019',	'HomeTop'),
	new banner('AutoPartsWarehouse.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=173296.10000027&type=4&subid=0', 			'http://images.apw21.com/2009/replacement/5apw.gif', 	'14/02/2014',	'HomeTop'),
	new banner('AmericanDiabetsWholesale.com',			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000030239673&pubid=21000000000252140', 			'http://clickserve.cc-dt.com/link/tplimage?lid=41000000030239673&pubid=21000000000252140', 	'14/02/2019',	''),
	new banner('TigerDirect.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=102327.10000025&type=4&subid=0', 			'http://images.tigerdirect.com/outsidebanners/gen-hot-728x90-2.gif', 	'27/02/2012',	'BottomBanner'),
	new banner('BarnesandNoble.com',			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000028574242&pubid=21000000000252140', 			'http://clickserve.cc-dt.com/link/tplimage?lid=41000000028574242&pubid=21000000000252140', 	'27/02/2019',	'BottomBanner'),
	new banner('PetsMart.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=170445.10000143&type=4&subid=0', 			'http://affiliates.petsmart.com/images/banners/031610/728x90.gif', 	'01/03/2012',	'BottomBanner'),
	new banner('1800Flowers.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=100462.10002830&type=4&subid=0', 			'http://a1516.g.akamai.net/f/1516/9236/1h/affiliate.1800flowers.com/flowers/graphics/spring/EA01aA1nF10.jpg', 	'04/04/2010',	'BottomBanner'),
	new banner('Chocolate.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=171713.10000093&type=4&subid=0', 			'http://linkshare.iregdev.com/images/chocolatecom_affiliate_images_main_1209_728x90a.jpg', 	'03/12/2015',	'BottomBanner'),
	new banner('GiftCards.com',			'http://affiliates.giftcards.com/z/96/7820/', 			'http://affiliates.giftcards.com/42/7820/96', 	'03/12/2019',	'BelowCoupons'),
	new banner('GiftCards.com',			'http://affiliates.giftcards.com/z/93/7820/', 			'http://affiliates.giftcards.com/42/7820/93', 	'03/12/2019',	'BelowCoupons'),
	new banner('Stamps.com',			'http://www.jdoqocy.com/click-3802709-10655427', 			'http://www.awltovhc.com/image-3802709-10655427', 	'03/12/2019',	'BottomBanner'),
    new banner('NetFlix.com',			'http://clickserve.cc-dt.com/link/tplclick?lid=41000000030310790&pubid=21000000000252140', 			'http://clickserve.cc-dt.com/link/tplimage?lid=41000000030310790&pubid=21000000000252140', 	'03/12/2019',	'BottomBanner'),
	new banner('MrBeer.com',			'http://click.linksynergy.com/fs-bin/click?id=TtGs22521mI&offerid=177250.10000020&subid=0&type=4', 			'http://ad.linksynergy.com/fs-bin/show?id=TtGs22521mI&bids=177250.10000020&subid=0&type=4&gridnum=16', 	'12/11/2010',	'BottomBanner'),
	new banner('BarnesandNoble.com',				'http://clickserve.cc-dt.com/link/tplclick?lid=41000000029031978&pubid=21000000000252140',	'http://clickserve.cc-dt.com/link/tplimage?lid=41000000029031978&pubid=21000000000252140',		'30/04/2019',	'')
]

//         				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);
