function bannerRotator(bannerId)  {

	// Object default properties
	this.bannerElm = null;
	this.imgElm = null;
	this.interval = 5000;
	this.imgStream = new Array();
	this.linkStream = new Array();
	this.currentFrame = 0;

	// Fetch the element that will be holding the images
	if(document.getElementById(bannerId) != null) {
		this.bannerElm=document.getElementById(bannerId);
		this.imgElm=this.bannerElm.getElementsByTagName('img')[0];
	}
	else {
		return;
	}

	// Set the stream of images that will be rotated
	this.setStream = function(srcArray) {
		this.imgStream = srcArray; 
	}

	// Set the stream of links that the images will link to
	this.setLinks = function(lnkArray) {
		this.linkStream = lnkArray; 
	}

	// Set the time between each image
	this.setInterval = function(seconds) {
		this.interval = seconds * 1000;
	}

	this.start = function() {
		this.rotate();
	}

	this.rotate = function() {
		if(this.currentFrame < this.imgStream.length-1) {
			this.currentFrame++;
		}
		else {
			this.currentFrame = 0;
		}
		if(this.linkStream[this.currentFrame] != '') {
			this.bannerElm.href = this.linkStream[this.currentFrame];
		}
		else {
			this.bannerElm.href = '#';
		}
		this.imgElm.src = this.imgStream[this.currentFrame];
		var foo = this;
		window.setTimeout(function(){foo.rotate();},this.interval);
	}
}
