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

// Our callback function, for when a feed is loaded.
function feedLoaded(result) {
  if (!result.error) {
    // Grab the container we will put the results into
    var container = document.getElementById("forum");
    var rssoutput = '';
    container.innerHTML = '';

    // Loop through the feeds, putting the titles onto the page.
    // Check out the result object for a list of properties returned in each entry.
    // http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON
    for (var i = 0; i < result.feed.entries.length; i++) {
      var entry = result.feed.entries[i];
      var str = escape(entry.link.replace('http://cjbc.org/',''));
      rssoutput+="<a href='Board.php?pg=" + str + "'>" + entry.title + "</a>";
	  rssoutput+="<br />" + entry.contentSnippet;
      rssoutput+="<br />";
      container.innerHTML=rssoutput;
      // container.append(rssoutput);
    }
  }
}

function OnLoad() {
  // Create a feed instance that will grab Digg's feed.
  var feed = new google.feeds.Feed("http://cjbc.org/phpBB3/feed.php");

  // Calling load sends the request off.  It requires a callback function.
  feed.load(feedLoaded);
}

google.setOnLoadCallback(OnLoad);
