// 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	= 0;
// desired height and width of images, only takes affect if above is = 1
var img_width	= 560;
var img_height	= 126;

// 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('Law, Explanation and Analysis of Health Care Reform Legislation', 'http://hr.cch.com/Products/ProductID-7127.asp', '/images/content/banners/HealthReformBook-560x126.jpg', '30/01/2010'); */
banners[0] = new banner('Health Care Reform NetNews', 'javascript:rSubscribeToNews();', '/images/content/banners/560x126_HealthReformNetNews.jpg', '30/01/2010');
banners[1] = new banner('Special Report: House Passes Health Reform Bill', 'http://health.cch.com/cforms/SpecialReport-HealthCareReform.aspx', '/images/content/banners/HealthReformSpecReport-560x126-111209.jpg', '30/01/2010');
banners[2] = new banner('Free Download: 2010 Federal Withholding Tables with Highlights', '/2010WithholdingTables/default.asp', '/images/content/banners/FedWHTables-2010.jpg', '31/12/2010');
banners[3] = new banner('CCH Training Tools in PowerPoint', '/products/productID-5178.asp?HP=PPT', '/Images/promo/TrainingTools_PPT.jpg', '30/01/2010');
// banners[1] = new banner('Ernst &amp; Young Payroll Resource Library', '/products/ProductID-5261.asp?HP=EYPRL', '/images/content/banners/ErnstYoungBanner.jpg', '30/01/2010');
// banners[2] = new banner('State Employment Law Compare', '/products/flash-4067.asp?HP=SELC', '/images/promo/banner-state-law-compare_560x126.jpg', '30/01/2010');
// banners[3] = new banner('ProSystem fx&reg; Engagement', '/products/ProductID-psfx.asp?HP=PSFX', '/images/content/banners/PS_Engagement.jpg', '30/01/2010');
// banners[4] = new banner('OSHA Standards for Construction and General Industry, 2009 Editions', '/safety/?HP=OSHA', '/images/promo/OSHA-09.jpg', '30/01/2010');
// banners[5] = new banner('State Payroll Law Compare Trial Offer', '/payroll/splc-trial.asp?HP=SPLC-Trial', '/images/content/banners/SPLC-TrialOffer.jpg', '31/05/2009');
// banners[6] = new banner('COBRA Survey', 'http://www.zoomerang.com/Survey/survey.zgi?p=WEB228QV6HWKSS', '/images/content/banners/COBRA-Survey.jpg', '01/05/2009');
// banners[7] = new banner('Free Webcast - Employment Tax Update: Are you prepared for 2009', 'http://mediazone.brighttalk.com/event/WoltersKluwer/831caa1b60-2512-intro?TID=EW04 ', '/images/content/banners/PayrollWebinar.jpg', '22/04/2009');
///////////////////////////////////////////////////////////////////////////////////
//
//         						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="_self"><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();
}
