// 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('Employment Law Daily', 'http://www.employmentlawdaily.com', '/images/content/banners/560x126_EmploymentLawDaily.jpg', '30/01/2012');
banners[1] = new banner('Get the Employment Law News Widget', 'http://www.employmentlawdaily.com/index.php/widget', '/images/content/banners/ELD-Widget-banner.jpg', '30/01/2012');
banners[2] = new banner('Get the Human Resources Management News Widget', 'http://hr.cch.com/widgets/HRM-widget.asp', '/images/content/banners/HRM-Widget-banner.jpg', '30/01/2012');
banners[3] = new banner('Download the CCH/Aspen Publishers Payroll Widget', '/widgets/payroll-ui-widget.asp', '/images/content/banners/Payroll-UI-Widget-banner.jpg', '30/01/2012');
/*banners[1] = new banner('Law, Explanation and Analysis of the Patient Protection and Affordable Care Act', 'http://hr.cch.com/Products/ProductID-7127.asp', '/images/content/banners/HealthReformBook-560x126-031910.jpg', '30/01/2012');
banners[2] = new banner('Employment Law Daily', 'http://www.employmentlawdaily.com', '/images/content/banners/560x126_EmploymentLawDaily.jpg', '30/01/2012');
banners[3] = new banner('Immigration Law in the Workplace', 'http://www.youtube.com/watch?v=IELmxSZyY7M', '/images/content/banners/560x126_ImmigrationLawVideo.jpg', '30/01/2012');
banners[4] = new banner('15th Annual ADA Workshop - September 2010 - Locations nationwide, click for more information', 'http://www.neli.org/programs2.asp?programid=12&utm_source=CCH&utm_medium=banner&utm_campaign=ADA-Workshop', '/images/content/banners/NELI-080310.jpg', '30/01/2012');
banners[5] = new banner('Health Reform Toolkit', 'http://health.cch.com/Products/Health-Reform-Toolkit.asp', '/images/content/banners/Health-Reform-Toolkit-560x126.jpg', '30/01/2012');
banners[1] = new banner('Health Care Reform NetNews', 'javascript:rSubscribeToNews();', '/images/content/banners/560x126_HealthReformNetNews.jpg', '30/01/2010');
banners[2] = 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[3] = new banner('Free Download: 2010 Federal Withholding Tables with Highlights', '/2010WithholdingTables/default.asp', '/images/content/banners/FedWHTables-2010.jpg', '31/12/2010');
banners[4] = new banner('CCH Training Tools in PowerPoint', '/products/productID-5178.asp?HP=PPT', '/Images/promo/TrainingTools_PPT.jpg', '30/01/2010');
banners[6] = new banner('Wolters Kluwer Law &amp; Business welcomes ftwilliams', 'http://www.cch.com/press/news/2010/20100315h.asp', '/images/content/banners/560x126-ftwilliams-announcement.jpg', '30/01/2012');
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();
}

