var rss = {
	
	xmlProcessData : function() {
		var topics, str, channel, items;
		var headStr = '<p><a href="http://my.nba.com/entry.jspa?gameID='+thisGameId+'"><strong>Got an Opinion?</strong></a><br>Tell us what you think about this game.</p>';
		var defaultStr  = '<p>Got an opinion you want to share? When this game starts, you can write a recap or check out what other fans are saying.</p><p><img src="/media/homepage/arrow.gif"><a href="http://my.nba.com/"><strong>Check out Fan Voice!</strong></a></p>';
		var endStr = '<p><img src="/media/homepage/arrow.gif"><a href="http://my.nba.com/entry.jspa?gameID='+thisGameId+'"><strong>Write your own recap!</strong> | Read More</a></p>';
		var feed = eval('('+ xml2json(this.req.responseXML, '\t')+ ')');
		var _htmlStr = '';
		
		
		if (feed["rss"]["channel"]){		
			if(feed["rss"]["channel"]["item"]){
			
			    
				var titleRe =  new RegExp("{@title}","g");	
				var linkRe =  new RegExp("{@link}","g");
				var textRe = new RegExp("{@text}","g");	
				var authorRe = new RegExp("{@jf:author}","g");
				var replyRe = new RegExp("{@jf:replyCount}","g");
	
				var items = feed["rss"]["channel"]["item"];
	         	
				if (items.constructor.toString().indexOf("Array")!=-1){
					var i=0;
					_htmlStr += headStr;
					do{
					//for(i=0;i<items.length;i++){
					    
						var topicStr = '<p><strong><a href="{@link}">{@title}</strong></a><br>{@jf:author} | {@jf:replyCount}</p>';			
						topicStr = topicStr.replace(titleRe, items[i]["title"]);
						topicStr = topicStr.replace(linkRe, items[i]["link"]);
						topicStr = topicStr.replace(authorRe, items[i]["jf:author"]["#cdata"]);
						if (parseInt(items[i]["jf:replyCount"]) == 1){
							items[i]["jf:replyCount"] = items[i]["jf:replyCount"] + ' reply';
						} else{
							items[i]["jf:replyCount"] = items[i]["jf:replyCount"] + ' replies';
						}
						topicStr = topicStr.replace(replyRe, items[i]["jf:replyCount"]);
						_htmlStr += topicStr;
						i=i+1;
						} while (i<=1)
					//}
				} else {
				    _htmlStr += headStr;
					var topicStr = '<p><strong><a href="{@link}">{@title}</strong></a><br>{@jf:author} | {@jf:replyCount}</p>';	
					topicStr = topicStr.replace(titleRe, items["title"]);
					topicStr = topicStr.replace(linkRe, items["link"]);
					//topicStr = topicStr.replace(textRe, items["description"]["#cdata"]);
					topicStr = topicStr.replace(authorRe, items["jf:author"]["#cdata"]);
					if (parseInt(items["jf:replyCount"]) == 1){
						items["jf:replyCount"] = items["jf:replyCount"] + ' reply';
					} else{
						items["jf:replyCount"] = items["jf:replyCount"] + ' replies';
					}					
					topicStr = topicStr.replace(replyRe, items["jf:replyCount"]);
					_htmlStr += topicStr;
				}
				
				_htmlStr +=endStr;
				
			}else{
			    
				_htmlStr = defaultStr;
			}
		}else{
		
			_htmlStr = defaultStr;
		
		}

		
		// is it new? fade it son.
		if (htmlStr != _htmlStr){
			Fat.fade_element("latestTopic");
		}
		thisID = helper.htmlElement("latestTopic");
		helper.checkElementExist(thisID, _htmlStr, "innerHTML");
		htmlStr = _htmlStr;
		
	}

}
