function PromoRSS (sInstanceName) {
	var that = this;
	this.logit = function(sOutput) {
		if (false && typeof(console) != 'undefined') {
			console.log(sOutput);
		}
	}
	
	this.sInstanceName = sInstanceName;
	
	this.init = function(aRssArray,sHolderId,IMaxItems) {
		that.sHolderId = sHolderId;
		that.eHolder = document.getElementById(sHolderId);
		
		var itemElements = [];
		
		if (typeof(aRssArray[0][0]) == 'undefined') {
			return false;
		}
		
		for (var i=0;i < aRssArray[0][0].length && i < IMaxItems; i++) {
			//that.logit(aRssArray[0][0][i]);
			itemElements[i] = that.addElement(that.sHolderId, 'a', [['class','promo_rss_item'],
																	['href',aRssArray[0][0][i][5]],
																	['target','_blank']
			]);
			
			itemElements[i].innerHTML = aRssArray[0][0][i][2];
		}
	}
	
	this.addElement = function(sParentId, sType, aAttributes) {
		
		var newElement = document.createElement(sType);
		for (var i=0; i < aAttributes.length; i++) {
			if (aAttributes[i][0] == "onclick" || 
				aAttributes[i][0] == "onload" ||
				aAttributes[i][0] == "onmouseover") {
				
				if (document.all) {
					//Attach event in the IE way
					function makeEventFunc(sEvents) {
						return function() {
							eval(sEvents);
						}
					}
					newElement.attachEvent(aAttributes[i][0], makeEventFunc(aAttributes[i][1]), true);
					
				} else {
					//Attach event in the Moz way
					newElement.setAttribute(aAttributes[i][0], aAttributes[i][1]);
				}
				
			} if (aAttributes[i][0] == "class") {
				newElement.className = aAttributes[i][1];
			} else {
				newElement.setAttribute(aAttributes[i][0],aAttributes[i][1]);
			}
		}
		
		if (sParentId != "") {
			document.getElementById(sParentId).appendChild(newElement);	
		} else {
			document.body.appendChild(newElement);
		}
		
		return newElement;
	}
}
