///////// BANNER ROTATION SCRIPT///////////

// Use this script for actual promos



// GLOBAL VARIABLES
	imgPath = '"><IMG SRC="'
	linkPath = '<A HREF="'

// THE BANNER OBJECT CONSTRUCTOR
function banner(url, src, width, height) {
	this.url = url;
	this.src = src;
	this.width = width;
	this.height = height;
	this.show = banner_show; // Here's the method that goes with this object
}


// THE BANNER OBJECT'S ONLY METHOD
function banner_show() {
	document.write(linkPath + this.url + imgPath + this.src + '" WIDTH="' + this.width + '" HEIGHT="' + this.height + '" VSPACE="3" BORDER="0"></A>');
}


// CREATE AN ARRAY OF BANNER OBJECTS BY CALLING THE CONSTRUCTOR
var banners = new Array();

banners[0] = new banner("sections/vision_mag/article40.html","promos/flag1.jpg",100,90);
banners[1] = new banner("sections/vision_mag/article40.html","promos/flag2.jpg",100,90);
banners[2] = new banner("sections/vision_mag/article40.html","promos/flag3.jpg",100,90);

/*
banners[0] = new banner("current_events/article.php?ID=11","promos/reason_season.gif",100,90);
banners[1] = new banner("specials/christmas03.php","promos/christmas03.gif",100,90);
*/


// GENERATE A RANDOM NUMBER AND DISPLAY THE RIGHT BANNER
function randomBanner(where) {
	if (where == "relative") {		//the calling function passes a value
		imgPath = '"><IMG SRC="/'	//that is used to set the path to the promo images
		linkPath = '<A HREF="/'	//and the path to the url in the link
	}
	var how_many_ads = 3;
	var now = new Date()
	var sec = now.getSeconds()
	var ad = sec % how_many_ads;
	banners[ad].show()
}

