// Simple Random Banner script
// For use with phpBB3, but will work in any webpage
// (c) spyka Web Group 2008
// version info: 1.0.0
// Download & support: http://www.hiddenhaven.co.uk 
// 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.hiddenhaven.co.uk 

// 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	= 468;
var img_height	= 60;

// banner list syntax: new banner(website_name, website_url, website_image_url, show_until_date);  DATE FORMAT: dd/mm/yyyy
banners[0] = new banner('Mistress Suzi Spice', 'http://www.mssuzispice.com', 'http://www.mssuzispice.com/images/mssuzispicebanner.jpg', '09/04/3000');
banners[1] = new banner('Mistress Suzi Spice', 'http://www.mssuzispice.com', 'http://www.mssuzispice.com/images/mssuzispicestockingbanner.jpg', '09/04/3000');
banners[2] = new banner('Sinful Spanking', 'http://www.sinfulspanking.com/t1/pps=incider/', 'http://www.mssuzispice.com/images/sinfulspanking-468x60-02.gif', '09/04/3000');
banners[3] = new banner('Fleshlight Sex Toy', 'http://www.fleshlight.com?link=58965', 'http://www.mssuzispice.com/images/FL_468x60_05.jpg', '09/04/3000');
banners[4] = new banner('Bondage Barz - Because Splinters Suck', 'http://bondagebarz.com/catalog/index.php?ref=1568&affiliate_banner_id=19', 'http://www.mssuzispice.com/images/barz270-3.jpg', '09/04/3000');

///////////////////////////////////////////////////////////////////////////////////
//         						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 + '"><img src="' + bn.image + '"' + image_size + ' alt="' + bn.name+ '" /></a>';
	
	// get current date string
	var now 		= new Date(); 
	var now_string	= now.getDate() + now.getMonth() + now.getFullYear() + 1;
	
	// create string from user input
	var input		= bn.date;
	input			= input.split('/', 3);
	var date_string	= parseFloat(input[0]) + parseFloat(input[1]) + parseFloat(input[2]);
	var diff 		= date_string - now_string;

	(diff > 0) ? document.write(html) : show_banners();
}
