google.load("feeds", "1");
// loads ZZ recent news
function newLoadDynamicFeedControl() {
new rssdisplayer ('newfeed-control', 'http://zipcodezoo.com/zipcodezoonews.rss', 5, 'date, description');
function rssdisplayer(divid, url, feedlimit, showoptions){
this.showoptions=showoptions || "" //get string of options to show ("date" and/or "description")
var feedpointer=new google.feeds.Feed(url) //create new instance of Google Ajax Feed API
feedpointer.setNumEntries(feedlimit) //set number of items to display
this.feedcontainer=document.getElementById(divid)
var displayer=this
feedpointer.load(function(r){displayer.formatoutput(r)}) //call Feed.load() to retrieve and output RSS feed
}
rssdisplayer.prototype.formatdate=function(datestr){
var itemdate=new Date(datestr)
return "<span style='color:#666666; font-size: 11px'>"+itemdate.toLocaleString()+"</span>"
}
rssdisplayer.prototype.formatoutput=function(result){
if (document.getElementById('newfeed-control')) {
var thefeeds=result.feed.entries //get all feed entries as a JSON array
var rssoutput="<div class=\"rsstitle\"><i>From ZipcodeZoo:</i></div><div id=\"newzznews\">"
for (var i=0; i<thefeeds.length; i++){ //loop through entries
var itemtitle="<div class=\"rsstitle\">" + thefeeds[i].title + "</div>"
var itemdate=/date/i.test(this.showoptions)? this.formatdate(thefeeds[i].publishedDate) : ""
var itemdescription=/description/i.test(this.showoptions)? "<p class=\"rssdescrip\">"+thefeeds[i].content: /snippet/i.test(this.showoptions)? +thefeeds[i].contentSnippet: ""
rssoutput+= itemtitle + " " + itemdate + itemdescription + "</p>"
}
rssoutput+="</div>"
this.feedcontainer.innerHTML=rssoutput
}
else //else, do nothing
return true;
}
    }
google.setOnLoadCallback(newLoadDynamicFeedControl);
// loads featured plants and animals
    function LoadDynamicFeedControl2() {
      var feeds = [
	{title: 'Animals (with photos)',
	 url: 'http://www.zipcodezoo.com/animals.rss'
	},
        {title: 'Plants (with photos)',
	 url: 'http://www.zipcodezoo.com/plants.rss'
	}
        ];
      var options = {
        stacked : true,
        horizontal : false,
        numResults :50,
        displayTime : 9000,
        fadeOutTime : 700,
        title : "Featured Critters"
      }
      new GFdynamicFeedControl(feeds, 'recentadd', options);
    }

    // loads offsite feeds

    google.setOnLoadCallback(LoadDynamicFeedControl2);
    function LoadDynamicFeedControl3() {
      var feeds = [
	{title: 'Discovery News - Animals',
	 url: 'http://dsc.discovery.com/news/subjects/animals/xdb/topstories.xml'
	},
        {title: 'National Wildlife Magazine',
	 url: 'http://www.nwf.org/nationalwildlife/syndicate.cfm'
	}
        ,
        {title: 'National Geographic News',
	 url: 'http://news.nationalgeographic.com/index.rss'
	}
        ,
        {title: 'The 2050 Project',
	 url: 'http://the2050project.com/index.php?option=com_rss&amp;feed=RSS2.0&amp;no_html=1'
	}
        ,
        {title: 'Discovery News - Earth',
	 url: 'http://dsc.discovery.com/news/subjects/earth/xml/top-stories.xml'
	}
        ];
      var options = {
        stacked : true,
        horizontal : false,
        numResults : 18,
        displayTime : 9000,
        fadeOutTime : 700,
        title : "News from farther afield..."
      }
      new GFdynamicFeedControl(feeds, 'afield', options);
    }
    google.setOnLoadCallback(LoadDynamicFeedControl3);
  // loads the slideshow
  function LoadSlideShow() {
    var feed  = "http://zipcodezoo.com/Sharks_Skates_Rays.rss";
    var options = {fullControlPanel : true,displayTime:5000, transistionTime:600,numResults:30,scaleImages:false,linkTarget:google.feeds.LINK_TARGET_SELF };
    var ss = new GFslideShow(feed, "whatisit", options);
  }
  google.setOnLoadCallback(LoadSlideShow);
// loads National Geographic Feeds
function ngcLoadDynamicFeedControl() {
new rssdisplayer ('natgeo', 'http://news.nationalgeographic.com/index.rss', 5, 'date, description');
function rssdisplayer(divid, url, feedlimit, showoptions){
this.showoptions=showoptions || "" //get string of options to show ("date" and/or "description")
var feedpointer=new google.feeds.Feed(url) //create new instance of Google Ajax Feed API
feedpointer.setNumEntries(feedlimit) //set number of items to display
this.feedcontainer=document.getElementById(divid)
var displayer=this
feedpointer.load(function(r){displayer.formatoutput(r)}) //call Feed.load() to retrieve and output RSS feed
}
rssdisplayer.prototype.formatdate=function(datestr){
var itemdate=new Date(datestr)
return "<span style='color:#666666; font-size: 11px'>"+itemdate.toLocaleString()+"</span>"
}
rssdisplayer.prototype.formatoutput=function(result){
if (document.getElementById('natgeo')) {
var thefeeds=result.feed.entries //get all feed entries as a JSON array
var rssoutput="<div class=\"rsstitle\"><i>From National Geographic News:</i></div><div id=\"natgeonews\">"
for (var i=0; i<thefeeds.length; i++){ //loop through entries
var itemtitle="<div class=\"rsstitle\"><a target=\"_blank\" href=\"" + thefeeds[i].link + "\">" + thefeeds[i].title + "</a></div>"
var itemdate=/date/i.test(this.showoptions)? this.formatdate(thefeeds[i].publishedDate) : ""
var itemdescription=/description/i.test(this.showoptions)? "<p class=\"rssdescrip\">"+thefeeds[i].content: /snippet/i.test(this.showoptions)? +thefeeds[i].contentSnippet: ""
rssoutput+= itemtitle + " " + itemdate + itemdescription + "</p>"
}
rssoutput+="</div>"
this.feedcontainer.innerHTML=rssoutput
}
else //else, do nothing
return true;
}
    }

google.setOnLoadCallback(ngcLoadDynamicFeedControl);
