google.load("feeds","1",{"nocss":true})
function rssdisplayer(divid,url,feedlimit,showoptions){this.showoptions=showoptions||""
var feedpointer=new google.feeds.Feed(url)
feedpointer.setNumEntries(feedlimit)
this.feedcontainer=document.getElementById(divid)
var displayer=this
feedpointer.load(function(r){displayer.formatoutput(r)})}
rssdisplayer.prototype.formatdate=function(datestr){var itemdate=new Date(datestr)
return"<span style='color:gray; font-size: 90%'>"+itemdate.toLocaleString()+"</span>"}
rssdisplayer.prototype.formatoutput=function(result){if(!result.error){var thefeeds=result.feed.entries
var rssoutput="<ul>"
for(var i=0;i<thefeeds.length;i++){var itemtitle="<h3><a href=\""+thefeeds[i].link+"\">"+thefeeds[i].title+"</a></h3>"
var itemdate=/date/i.test(this.showoptions)?this.formatdate(thefeeds[i].publishedDate):""
var itemdescription=/description/i.test(this.showoptions)?"<br />"+thefeeds[i].content:/snippet/i.test(this.showoptions)?"<br />"+thefeeds[i].contentSnippet:""
rssoutput+="<li>"+itemtitle+" "+itemdate+itemdescription+"</li><hr/>"}
rssoutput+="</ul>"
this.feedcontainer.innerHTML=rssoutput}
else
alert("Error fetching feeds: "+result.error.message)}
