/*
######################   Simple RSS Aggregator   ###################### 
#		    -for feeds originating from foreign domains-              #
#			                                                          #
#			 	   Requires Google Ajax Feed API                      #
#			        http://www.google.com/jsapi                       #
#			                                                          #
#			             Jeremy Clewell                               #
#			               2/3/2010                                   #
#			                                                          #
####################################################################### 
*/

google.load("feeds", "1");

/* 
Method Summary:
	containerObj : String  - ID of Dom object to be appended with feed data 
	feeds		 : Array   - Array of objects containing titles and urls of RSS feeds to be consumed 
	numArticles  : int 	   - Number of articles to display per feed
	isPopup		 : Boolean - Sets link target to Blank. Default is Self
*/
function rssList(containerObj, feeds, numArticles, isPopup) {
	for (feed in feeds) {
		var feedDiv = document.createElement('div');
		feedDiv.setAttribute('class', 'feed')
		document.getElementById(containerObj.toString()).appendChild(feedDiv);
		var feedControl = new google.feeds.FeedControl();
		feedControl.setNumEntries(numArticles);
		if (isPopup) feedControl.setLinkTarget(google.feeds.LINK_TARGET_BLANK);
		feedControl.addFeed(feeds[feed].url, feeds[feed].title);
		feedControl.draw(feedDiv);
	}
}