
///////////////////////////////////////////////////////////////////////////////////
//         						Program options


// if 1 (one), all images will be resized to img_width and img_height, else images will display their correct size
var force_size	= 0;
// desired height and width of images, only takes affect if above is one
var img_width	= 728;
var img_height	= 90;

// time between refreshs of ad locations, to disable refreshs set to 0. In milliseconds, 1000 = 1 second
var refresh_time = 60000;
// maximum amount of refreshs, good to set if a user may be on a page for a long period of time.
var refresh_max = 10;

// if you do not want the same banners to display on the same page then set this to 0, else set it to 1.
// this option is only used if you have put the show_banners() javascript code more than once into a page
var duplicate_banners = 0;


// ignore/skip this line 
var banners = new Array();

// banner list syntax: banners[x] = new banner(website_name, website_url, banner_url, show_until_date);  DATE FORMAT: dd/mm/yyyy
// be sure to increase x by 1 for each banner added!
// to make sure a banner is always rotating, just set the date far into the future, i.e. year 3000

banners[0] = new banner('Beauty.com', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&offerid=57302.10000104&type=4&subid=0', 'http://a248.e.akamai.net/f/248/580/1d/pics.drugstore.com/prodimg/promo/assoclinks/728x90_beauty_10_off_60.jpg', '10/04/2019');
banners[1] = new banner('Weight Watchers(R)', 'http://www.kqzyfj.com/click-3248359-10421823', 'http://www.yceml.net/0312/10480952-5.gif', '10/04/2019');
banners[2] = new banner('No one deals like we do!', 'http://www.jdoqocy.com/click-3248359-10392988', 'http://www.tqlkg.com/image-3248359-10392988', '10/04/2019');
banners[3] = new banner('Hotels.com', 'http://www.kqzyfj.com/click-3248359-10465567', 'http://www.awltovhc.com/image-3248359-10465567', '10/04/2019');
banners[4] = new banner('A Grande new addition to a Grande New Resort', 'http://www.anrdoezrs.net/click-3248359-10471175', 'http://www.lduhtrp.net/image-3248359-10471175', '10/04/2019');
banners[5] = new banner('Net 10 Wireless', 'http://www.anrdoezrs.net/click-3248359-10389300', 'http://www.ftjcfx.com/image-3248359-10389300', '10/04/2019');
banners[6] = new banner('Try Angie\'s List!', 'http://www.jdoqocy.com/click-3248359-10461880', 'http://www.ftjcfx.com/image-3248359-10461880', '10/04/2019');
banners[7] = new banner('Mary Kay', 'http://www.marykay.com/tcrook1/sellmarykay/default.aspx?ab=sidenav_sellmk', 'http://www.myblackhairsalons.com/images/marykay_001.jpg', '10/04/2019');
banners[8] = new banner('Payless Shoes', 'http://www.kqzyfj.com/click-3248359-10541489?cm_mmc=CJ-_-2547127-_-3248359-_-728x90%20In-Store%20Shipping', 'http://www.tqlkg.com/image-3248359-10541489', '10/04/2019');
banners[9] = new banner('Free Standard Shipping with your $75 order!', 'http://www.dpbolvw.net/click-3248359-10642466', 'http://www.lduhtrp.net/image-3248359-10642466', '10/04/2019');
banners[10] = new banner('Miles Card Application', 'http://www.tkqlhce.com/click-3248359-10494114', 'http://www.ftjcfx.com/image-3248359-10494114', '10/04/2019');
banners[11] = new banner('free gifts tuesdays and thursdays', 'http://www.dpbolvw.net/click-3248359-10595034', 'http://www.awltovhc.com/image-3248359-10595034', '10/04/2019');
banners[12] = new banner('1-800-FLOWERS.COM', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&offerid=100462.10002583&type=4&subid=0', 'http://a1516.g.akamai.net/f/1516/9236/1h/affiliate.1800flowers.com/flowers/graphics/birthday/FY10/BD02aA1nF9.gif', '10/04/2019');
banners[13] = new banner('AmericaRx.com', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&offerid=175432.10000076&type=4&subid=0', 'http://www.americarx.com/allaffliate/Linkshare/728_90.jpg', '10/04/2019');
banners[14] = new banner('ULTA Beauty', 'http://www.dpbolvw.net/click-3248359-10644533', 'http://www.myblackhairsalons.com/images/ul-bn-ad.gif', '10/04/2019');
banners[15] = new banner('Mary Kay', 'http://www.marykay.com/tcrook1/sellmarykay/default.aspx?ab=sidenav_sellmk', 'http://www.myblackhairsalons.com/images/marykay_001.jpg', '10/04/2019');
banners[16] = new banner('Lane Bryant', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&amp;offerid=79295.10000074&amp;type=4&amp;subid=0', 'http://www.lanebryant.com/dptbannersLB/save75_728x90_18k.jpg', '10/04/2019');
banners[17] = new banner('Mary Kay', 'http://www.marykay.com/tcrook1/sellmarykay/default.aspx?ab=sidenav_sellmk', 'http://www.myblackhairsalons.com/images/marykay_001.jpg', '10/04/2019');
banners[18] = new banner('Footlocker.com', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&offerid=101680.10000113&type=4&subid=0', 'http://a712.g.akamai.net/7/712/225/1d/www.footlocker.com/images/linkshare/Footlocker/HoH ls_header_728x90.jpg', '10/04/2019');
banners[19] = new banner('Baby Phat ', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&offerid=177070.84&type=4&subid=0', 'http://efashion.hs.llnwd.net/o33/efs/affiliate/AFFL_BP_720x90_julyweek4.jpg', '10/04/2019');
banners[20] = new banner('macys.com', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&offerid=176538.10000196&subid=0&type=4', 'http://ad.linksynergy.com/fs-bin/show?id=Nxa5e6p80kE&bids=176538.10000196&subid=0&type=4&gridnum=16', '10/04/2019');
banners[21] = new banner('Wal-Mart.com', 'http://linksynergy.walmart.com/fs-bin/click?id=Nxa5e6p80kE&offerid=130188.10001965&type=4&subid=0', 'http://i.walmart.com/i/email/nl/71509/728X90_affiliate_template_home.gif', '10/04/2019');
banners[21] = new banner('', 'http://linksynergy.walmart.com/fs-bin/click?id=Nxa5e6p80kE&offerid=130188.10001965&type=4&subid=0', 'http://i.walmart.com/i/email/nl/71509/728X90_affiliate_template_home.gif', '10/04/2019');
banners[22] = new banner('Lane Bryant', 'http://click.linksynergy.com/fs-bin/click?id=Nxa5e6p80kE&offerid=79295.10000072&type=4&subid=0', 'http://www.lanebryant.com/dptbannersLB/save50_728x90_18k.jpg', '10/04/2019');




//         				There is no need to edit below here
///////////////////////////////////////////////////////////////////////////////////

var used = 0;
var first_pass = 0;
var location_counter = 1;
var refresh_counter = 1;

function banner(name, url, image, date)
{
	this.name	= name;
	this.url	= url;
	this.image	= image;
	this.date	= date;
	this.active = 1;
}

function show_banners()
{
	var html = '<div id="adLocation-' + location_counter + '"></div>';
	document.write(html);
	display_banners(location_counter);
	location_counter++;
}

function display_banners(location)
{
	if(location == '' || !location || location < 0)
	{
		// no location given
		return;
	}
	
	var am	= banners.length;
	
	if((am == used) && duplicate_banners == 0) {
		// all banners have been used
		return;
	}

	var rand	= Math.floor(Math.random()*am);	
	var bn 		= banners[rand];
	
	var image_size 	= (force_size == 1) ? ' width="' + img_width + '" height="' + img_height + '"' : '';
	var html 		= '<a href="' + bn.url + '" title="' + bn.name + '" target="_blank"><img border="0" src="' + bn.image + '"' + image_size + ' alt="' + bn.name+ '" /></a>';
	
	var now		= new Date(); 
	
	var input	= bn.date;
	input		= input.split('/', 3);
	var end_date	= new Date();
	end_date		= end_date.setFullYear(parseFloat(input[2]), parseFloat(input[1]), parseFloat(input[0]));
	
	if((now < end_date) && bn.active == 1) 
	{
		var location_element = document.getElementById('adLocation-' + location);
		
		if(location_element == null)
		{
			// ad location doesn't exist
			alert('spyka Webmaster banner rotator\nError: adLocation doesn\'t exist!');
		}
		else
		{
			location_element.innerHTML = html;
			
			if(duplicate_banners == 0)
			{
				bn.active = 0;
				used++;
			}
		}
	}
	else
	{
		display_banners(location);
	}
}

function refresh_banners()
{
	if((refresh_counter == refresh_max) || refresh_time < 1)
	{
		clearInterval(banner_refresh);  
	}
	used = 0;
	for(i = 0; i < banners.length; i++)
	{
		banners[i].active = 1;
	}
	for(i = 1; i < location_counter; i++)
	{
		display_banners(i);
	}
	refresh_counter++;
}
var banner_refresh = window.setInterval(refresh_banners, refresh_time);