// Simple banner rotator
// (c) spyka Web Group 2008
// version info: 1.1.2
// Download & support: http://www.spyka.net
// Forums: http://www.spyka.net/forums
// Please keep this notice in place

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

var banners = new Array();
///////////////////////////////////////////////////////////////////////////////////
//
//         						START EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

// Full documentation & support: http://www.spyka.net/forums 

// if 1, all images will be resized to img_width and img_height, else images will display their correct size
var force_size	= 1;
// desired height and width of images, only takes affect if above is = 1
var img_width	= 480;
var img_height = 60;

// banner list syntax: banners[x] = new banner(website_name, website_url, website_image_url, show_until_date);  DATE FORMAT: dd/mm/yyyy
banners[0] = new banner('The Medicine House', 'http://www.themedicinehouse.com', 'http://www.themedicinehouse.com/images/tmh.gif', '09/09/2011');
banners[1] = new banner('E-Cig', 'http://www.jdoqocy.com/click-2785026-10756921', 'http://www.awltovhc.com/image-2785026-10756921', '10/04/2011');
banners[2] = new banner('USFreeAds', 'http://www.usfreeads.com/10389_refer.html', 'http://www.usfreeads.com/affiliate/banners/468-60_1.jpg', '10/04/2011');
banners[3] = new banner('Easysitebuild', 'http://redux.easysiteb.hop.clickbank.net/', 'http://www.easysitebuild.com/images/banner4.gif', '10/04/2010');
banners[4] = new banner('SoExcited', 'http://redux.soexcited.hop.clickbank.net', 'http://www.so-excited.com/banner/so468.jpg', '10/04/2010');
banners[5] = new banner('sdtv', 'http://c0d78gk2yl3q6t750kpe696nbj.hop.clickbank.net/', 'http://www.luck4all.com/images/sdtv_468x60_4.gif', '10/04/2010');
banners[6] = new banner('SmokeStick', 'http://www.dpbolvw.net/click-2785026-10745541', 'http://www.tqlkg.com/image-2785026-10745541', '10/04/2011');
banners[7] = new banner('TopSecret', 'http://redux.magiccode.hop.clickbank.net/?tid=AB', 'http://TopSecretMagicCode.com/images_boats/banners/tsmc-468x60b.gif', '10/04/2010');
banners[8] = new banner('MyMedicineHome', 'http://www.mymedicinehome.com', 'http://www.mymedicinehome.com/images/mmh.gif', '10/04/2011');
banners[8] = new banner('ContactLens', 'http://www.jdoqocy.com/click-2785026-5338700', 'http://www.lduhtrp.net/image-2785026-5338700', '10/04/2010');
banners[9] = new banner('inkjet', 'http://www.jdoqocy.com/click-2810262-10770119', 'http://www.tqlkg.com/image-2810262-10770119', '10/04/2011');
banners[10] = new banner('Asylum', 'http://redux.gainop.hop.clickbank.net/?tid=AB', 'http://www.luck4all.com/images/gainopinion.gif', '10/04/2011');
banners[11] = new banner('FOREXFUNNEL', 'http://redux.forexfun.hop.clickbank.net/?tid=AB', 'http://www.forexfunnel.com/banners/forexfunnel468x60a.gif', '10/04/2010');
banners[12] = new banner('SMOKETIP', 'http://www.smoketip.com/?a_aid=freedom', 'http://www.luck4all.com/images/smoketip.jpg', '10/04/2010');
banners[13] = new banner('ENERGY', 'http://www.luck4all.com/energy.html', 'http://www.luck4all.com/images/energy.gif', '10/04/2010');
banners[14] = new banner('Hovering', 'http://www.HoveringAds.com/1552', 'http://www.hoveringads.com/images/hoveringads-468x60.png', '10/04/2011');
banners[15] = new banner('Header', 'http://www.HeaderAds.com/11936', 'http://www.headerads.com/images/headerads-468x60.gif', '10/04/2011');
banners[16] = new banner('surveyCJ', 'http://www.jdoqocy.com/click-2785026-10537789', 'http://www.awltovhc.com/image-2785026-10537789', '10/04/2010');
banners[17] = new banner('survey2CJ', 'http://www.jdoqocy.com/click-2785026-10664847', 'http://www.ftjcfx.com/image-2785026-10664847', '10/04/2010');
banners[18] = new banner('survey3CJ', 'http://www.anrdoezrs.net/click-2785026-10664820', 'http://www.tqlkg.com/image-2785026-10664820', '10/04/2010');

///////////////////////////////////////////////////////////////////////////////////
//
//         						END EDITS HERE
//
///////////////////////////////////////////////////////////////////////////////////

function show_banners()
{
	var am		= banners.length;
	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>';
	
	// get current date string
	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]));
	
	(now < end_date) ? document.write(html) : show_banners();
}
