// 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	= 0;
// 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('Velvet Kick', 'http://www.velvetkick.net', 'http://www.velvetkick.net/images/velvet-kick-banner.gif', '01/01/3000');
banners[1] = new banner('California Mean Girls', 'http://www.californiameangirls.com', 'http://www.calimgfiles.com/banners/cali-status.gif', '01/01/3000');
banners[2] = new banner('Donate to the Forum!', 'http://www.tlcnet.com/Donations.htm', 'http://www.tlcnet.com/Donations.JPG', '01/01/3000');
banners[3] = new banner('Ballbusting Porn Stars', 'http://www.ballbustingpornstars.com', 'http://www.ballbustingpornstars.com/photos/ballbusting-pornstars-logo.jpg', '01/01/3000');
banners[4] = new banner('Brazilian Low Blows', 'http://www.brazilianlowblows.com', 'http://www.brazilianlowblows.com/images/ads.jpg', '01/01/3000');
banners[5] = new banner('Suburban Sensations', 'http://suburbansensations.com', 'http://suburbansensations.com/banners/SuburbanSensations-BBForum-Banner.gif', '01/01/3000');
banners[6] = new banner('Roksana Ballbuster', 'http://www.roksana-ballbuster.com', 'http://www.roksana-ballbuster.com/images/banner.gif', '01/01/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();
}
