// JavaScript Document
//the data set constructor
var dsTeamUpdates = new Spry.Data.XMLDataSet("/apps/articles/rssfeed.asp?columnid=5258", "rss/channel/item");
	dsTeamUpdates.setColumnType("pubDate", "date");
	dsTeamUpdates.filterData(filterMyData);
// Add a listener that fires after the page is loaded. 

function filterMyData(ds, row, rowNumber) {
	// Strip off pointless time stamp
	row["pubDate"] = row["pubDate"].replace(/ 00:00:00 -0400/,'');
	
	if (rowNumber<=2) {
    	if(row["description"].length >= 50) {
			row["description"] =  row["description"].substr(0,50) + '...';
		}
		
		return row;  // Return the row to keep it in the data set.
	}
	else {
  		return null;   // Return null to remove the row from the data set.
	}
}


Spry.Utils.addLoadListener(function() {
	Spry.$$("#snapshotheader").setAttribute("spry:region","dsTeamUpdates");
	Spry.$$("#snapshotheader").setAttribute("spry:repeat","dsTeamUpdates");
	/*Spry.$$("#teamdate").setAttribute("pubDate");
	Spry.$$("#teamupdatelink").setAttribute("pubDate");
	Spry.$$("#teamtext").setAttribute("description");*/
});