function elcMWRotator(sName){
	this.name = sName;
	this.Items = new Array();
	this.currentIndex = 0;
	this.interval = 3000;
}

elcMWRotator.prototype.addImgObj = function(oImage){
	this.oImage = oImage;
}

/* for use the the HTML head to define the MW array */
elcMWRotator.prototype.addItem = function(sId, sImagePath, sURL, isDefault){
	var index = this.Items.length;
	oItem = this.Items[index] = new String( sId );
	oItem.imagePath = new String( sImagePath );
	oItem.url = new String( sURL );
	oItem.image = new Image();
	oItem.image.src = wsmlMakeResourceUrl(sImagePath);
//	oItem.image.src = sImagePath;
	if (isDefault) {
		this.currentIndex = index;
	}
}

elcMWRotator.prototype.showNext = function(){
	var currentIndex = this.currentIndex;
	if (this.Items.length < 2) { return; }
	if (currentIndex < 0) { currentIndex = 0 }
	var nextIndex = currentIndex + 1;
	nextIndex %= this.Items.length;
	var oItem = this.Items[nextIndex];
	this.oImage.src = oItem.image.src;
	this.currentIndex = nextIndex;
}

elcMWRotator.prototype.start = function(){
	this.intervalTimer = window.setInterval( this.name+".showNext();", this.interval );
}

elcMWRotator.prototype.pause = function(){
	window.clearInterval( this.intervalTimer );
}

elcMWRotator.prototype.resume = function(){
	this.intervalTimer = window.setInterval( this.name+".showNext();", this.interval );
}

elcMWRotator.prototype.hOnClick = function(){
	var currentIndex = this.currentIndex;
	if (currentIndex < 0) { currentIndex = 0 }
	var oItem = this.Items[currentIndex];
	if (oItem != null) {
		sendURL(oItem.url);
		return false;
	}
	return true;
}
