/****************************************************************************************************************************************

	JavaScript 		-	events-random-banner.js
	Description	 	-	Random top of page banner script used on IoN events page
	Author			-	Darren Huskie
	Last Updated	-	17th February 2010					
	
****************************************************************************************************************************************/

	/* Declare the different banners to be used, starting at index 0. Change the variable 'numofbanners' to reflect the number of 
   	banners declared here */

	banner0="http://www.nano.org.uk/nanomasters/NEATweblogobordered.jpg"
	href0="http://www.nano.org.uk/nanomasters/index.htm"
	alt0="NEAT - Nano Enabling and Advanced Technologies"
	width0="406"
	height0="58"


	banner1="../banners/Coursesbanner.jpg"
	href1="http://www.nano.org.uk/courses/nanomed/about.htm"
	alt1="Short Courses in Nanomedicine"
	width1="411"
	height1="60"
	
	banner2="http://www.nano.org.uk/conferences/ageing2011/images/ageing-population-banner.jpg"
	href2="http://www.nano.org.uk/conferences/ageing2011/overview.htm"
	alt2="Advanced Technologies for the Ageing Population"
	width2="300"
	height2="60"

	numofbanners=3


	/* Standard random banner code, should not be changed when simply looking to change the number or type of banner being shown */

	now=new Date()
	now=now.getSeconds()
	rnd=now%numofbanners

	image=eval("banner"+rnd);
	href=eval("href"+rnd);
	alt=eval("alt"+rnd);
	height=eval("height"+rnd);
	width=eval("width"+rnd);
	border=0;

	if (rnd == 1) {
		document.write("<a href='" + href + "'>");
		document.write("<img src='" + image + "' alt='" + alt + "' height='" + height + "' width='" + width + "'border='" + border + "'></a>");
	}
	else {
		document.write("<a href='" + href + "' target='_blank'>");
		document.write("<img src='" + image + "' alt='" + alt + "' height='" + height + "' width='" + width + "'border='" + border + "'></a>");
	}
