//rss arrays

league_feeds = new Array();
league_feeds.push
(
	{rssURL: "http://www.nba.com/aroundtheassociation/rss.xml", title: "League Headlines"},
	{rssURL: "http://www.nba.com/powerrankings/rss.xml", 		title: "Power Rankings"}
);


multimedia_feeds = new Array();
multimedia_feeds.push
(
	{rssURL: "http://www.nba.com/rss/highlights.rss", 	title: "Highlights"},
	{rssURL: "http://www.nba.com/rss/editorspick.rss", 	title: "Editors Picks"},
	{rssURL: "http://www.nba.com/rss/barkleyzone.rss", 	title: "Barkley Zone"},
	{rssURL: "http://www.nba.com/broadband/tnt_overtime.xml", 	title: "TNT Overtime"},
	{rssURL: "http://www.nba.com/nbatvtop10/rss.xml", 			title: "NBA TV Top 10"},
	{rssURL: "http://www.nba.com/playoftheday/rss.xml", 		title: "Play of the Day"},
	{rssURL: "http://www.nba.com/dunkofthenight/rss.xml", 		title: "Dunk of the Night"},
	{rssURL: "http://www.nba.com/assistofthenight/rss.xml", 	title: "Assist of the Night"}
);


blogs_feeds = new Array();
blogs_feeds.push
(
	{rssURL: "http://my.nba.com/rssthreads.jspa?forumID=400032200", title: "Gilbert Arenas"},
	{rssURL: "http://my.nba.com/rssthreads.jspa?forumID=300013426", title: "Luol Deng"},
	{rssURL: "http://my.nba.com/rssthreads.jspa?forumID=400029799", title: "Morris Almond"},
	{rssURL: "http://my.nba.com/rssthreads.jspa?forumID=300012849", title: "Charlie Villanueva"},
	{rssURL: "http://my.nba.com/rssthreads.jspa?forumID=300015625", title: "Tyson Chandler"},
	{rssURL: "http://my.nba.com/rssthreads.jspa?forumID=400033012", title: "Marcus Camby"},
	{rssURL: "http://my.nba.com/rssthreads.jspa?forumID=300017151", title: "Flea"}
);


other_feeds = new Array();
other_feeds.push
(
	{rssURL: "http://www.wnba.com/rss/wnba_rss.xml", title: "WNBA"},
	{rssURL: "http://www.nba.com/downlowonthedleague/rss.xml", title: "NBA D-League"}
);


store_feeds = new Array();
store_feeds.push(
	{rssURL: "", title: ""}
);

NBA_Teams_feed = new Array();
NBA_Teams_feed.push
(
	{rssURL: "http://www.nba.com/bobcats/rss.xml", 		title: "Bobcats News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/bobcats_sm.gif"},
	{rssURL: "http://www.nba.com/bucks/rss.xml", 		title: "Bucks News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/bucks_sm.gif"},
	{rssURL: "http://www.nba.com/bulls/rss.xml", 		title: "Bulls News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/bulls_sm.gif"},
	{rssURL: "http://www.nba.com/cavaliers/rss.xml", 	title: "Cavaliers News and Headlines", 	teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/cavaliers_sm.gif"},
	{rssURL: "http://www.nba.com/celtics/rss.xml", 		title: "Celtics News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/celtics_sm.gif"},
	{rssURL: "http://www.nba.com/clippers/rss.xml", 	title: "Clippers News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/clippers_sm.gif"},
	{rssURL: "http://www.nba.com/grizzlies/rss.xml", 	title: "Grizzlies News and Headlines", 	teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/grizzlies_sm.gif"},
	{rssURL: "http://www.nba.com/hawks/rss.xml", 		title: "Hawks News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/hawks_sm.gif"},
	{rssURL: "http://www.nba.com/heat/rss.xml", 		title: "Heat News and Headlines", 			teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/heat_sm.gif"},
	{rssURL: "http://www.nba.com/hornets/rss.xml", 		title: "Hornets News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/hornets_sm.gif"},
	{rssURL: "http://www.nba.com/jazz/rss.xml", 		title: "Jazz News and Headlines", 			teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/jazz_sm.gif"},
	{rssURL: "http://www.nba.com/kings/rss.xml", 		title: "Kings News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/kings_sm.gif"},
	{rssURL: "http://www.nba.com/knicks/rss.xml", 		title: "Knicks News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/knicks_sm.gif"},
	{rssURL: "http://www.nba.com/lakers/rss.xml", 		title: "Lakers News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/lakers_sm.gif"},
	{rssURL: "http://www.nba.com/magic/rss.xml", 		title: "Magic News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/magic_sm.gif"},
	{rssURL: "http://www.nba.com/mavericks/rss.xml", 	title: "Mavericks News and Headlines", 	teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/mavericks_sm.gif"},
	{rssURL: "http://www.nba.com/nets/rss.xml", 		title: "Nets News and Headlines", 			teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/nets_sm.gif"},
	{rssURL: "http://www.nba.com/nuggets/rss.xml", 		title: "Nuggets News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/nuggets_sm.gif"},
	{rssURL: "http://www.nba.com/pacers/rss.xml", 		title: "Pacers News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/pacers_sm.gif"},
	{rssURL: "http://www.nba.com/pistons/rss.xml", 		title: "Pistons News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/pistons_sm.gif"},
	{rssURL: "http://www.nba.com/raptors/rss.xml", 		title: "Raptors News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/raptors_sm.gif"},
	{rssURL: "http://www.nba.com/rockets/rss.xml", 		title: "Rockets News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/rockets_sm.gif"},
	{rssURL: "http://www.nba.com/sixers/rss.xml", 		title: "Sixers News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/sixers_sm.gif"},
	{rssURL: "http://www.nba.com/spurs/rss.xml", 		title: "Spurs News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/spurs_sm.gif"},
	{rssURL: "http://www.nba.com/suns/rss.xml", 		title: "Suns News and Headlines", 			teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/suns_sm.gif"},
	{rssURL: "http://www.nba.com/thunder/rss.xml", 		title: "Thunder News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/50x40_okc.gif"},
	{rssURL: "http://www.nba.com/blazers/rss.xml", 		title: "Trail Blazers News and Headlines", teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/blazers_sm.gif"},
	{rssURL: "http://www.nba.com/timberwolves/rss.xml", title: "Timberwolves News and Headlines", 	teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/timberwolves_sm.gif"},
	{rssURL: "http://www.nba.com/warriors/rss.xml", 	title: "Warriors News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/warriors_sm.gif"},
	{rssURL: "http://www.nba.com/wizards/rss.xml", 		title: "Wizards News and Headlines", 		teamLogo: "http://i.cdn.turner.com/nba/nba/.element/img/1.1/sect/rss/teams/wizards_sm.gif"}
);


function buildRSSPanel(panelArray, isTeamPanel, panelHeadline, allRSS_URL, panelAnchor)//void
{
	var table = "";
	
	var tableClass = (isTeamPanel)? "largePanel" : "smallPanel";
	var footerClass = (isTeamPanel)? "largePanelFooter" : "smallPanelFooter";
	
	if(panelArray.length != 0)
	{
		//rounded header cap with panel heading
		table += "<a name='";
		table += panelAnchor;
		table += "'/>";
		table += "<table cellspacing='0' cellpadding='0' class='" + tableClass + "'>";
		table +=	"<tr>";
		table +=		"<td class='" + tableClass + "'>";
		table +=			panelHeadline;
		table +=		"</td>";
		table += 	"</tr>";
		
		for(var i = 0; i < panelArray.length; i++)
		{
			var cellClass = (!isTeamPanel)? ((i % 2 == 0)? "offsetNone" : "offset") : "teamBG";
			//first row under header of every panel (ALL FEEDS)
			if(i == 0 && allRSS_URL != null)
			{
				table +=	"<tr>";
				table +=		"<td class='cellBorder pad'>";
				table += 			"<table cellspacing='0' cellpadding='0' width='100%'>";
				table +=				"<tr>";
				table +=					"<td class='offset'>";
				table += 						"<a href='" + allRSS_URL + "' class='heading'>" + panelHeadline + " (All Feeds)</a>";
				table +=					"</td>";
				
				table +=					"<td class='rssCell offset'>";
				table +=						"<a href='" + allRSS_URL + "' class='rssText'>";
				table +=							"<img src='http://i.cdn.turner.com/nba/nba/.element/img/2.0/sect/rss/icon_RSS.png' alt='' /> <div>RSS</div>";
				table +=						"</a>";
				table +=					"</td>";
				table += 				"</tr>";
				table += 			"</table>";
				table +=		"</td>";
				table += 	"</tr>";
			}
			
			if (panelArray.length > 1) {
			//alternating background color feed rows
			table += 	"<tr>";
			table +=		"<td class='cellBorder pad'>";
								if(!isTeamPanel)
								{
									
									table += "<table cellspacing='0' cellpadding='0' width='100%'>";
									table +=	"<tr>";
									table +=		"<td class='" + cellClass + "'>";
									table += 			"<a href='" + panelArray[i].rssURL + "' class='subheading'>" + panelArray[i].title + "</a>";
									table +=		"</td>";
									
									table +=		"<td class='rssCell " + cellClass + "'>";
									table +=			"<a href='" + panelArray[i].rssURL + "' class='rssText'>";
									table +=				"<img src='http://i.cdn.turner.com/nba/nba/.element/img/2.0/sect/rss/icon_RSS.png' alt='' /> <div>RSS</div>";
									table +=			"</a>";
									table +=		"</td>";
									table += 	"</tr>";
									table += "</table>";
								}
								else{
									table += "<table cellspacing='0' cellpadding='0' width='100%'>";
									table +=	"<tr>";
									table +=		"<td class='" + cellClass + " teamLogos teamBottomBorder'>";
									table += 			"<img src='" + panelArray[i].teamLogo + "' alt='' />";
									table +=		"</td>";
									
									table +=		"<td class='" + cellClass + " teamBottomBorder'>";
									table += 			"<a href='" + panelArray[i].rssURL + "' class='subheading'>" + panelArray[i].title + "</a>";
									table +=		"</td>";
									
									table +=		"<td class='rssCell " + cellClass + " teamBottomBorder'>";
									table +=			"<a href='" + panelArray[i].rssURL + "' class='rssText'>";
									table +=				"<img src='http://i.cdn.turner.com/nba/nba/.element/img/2.0/sect/rss/icon_RSS.png' alt='' /> <div>RSS</div>";
									table +=			"</a>";
									table +=		"</td>";
									table += 	"</tr>";
									table += "</table>";	
								}
			table += 		"</td>";
			table +=	"</tr>";
			}
		}
		//rounded footer cap
		table +=	"<tr>";
		table +=		"<td class='" + footerClass + "'>";
		table +=			"&nbsp;";
		table +=		"</td>";
		table += 	"</tr>";
		table += "</table>";
	}
	
	document.write(table);
}