// JavaScript Document
// http://www.quirksmode.org/dom/toc.html
// http://code.google.com/apis/ajaxfeeds/documentation/

google.load("feeds", "1");

function initialize() {
  var feed = new google.feeds.Feed("http://blog.dbs-uk.co.uk/feeds/posts/default");
  feed.setNumEntries(4);
  feed.load(function(result) {
	if (!result.error) {
	  var container = document.getElementById("feedlist");
	  
	  var header = document.createElement('h3');
	  header.className += "first_heading";	  	  
	  header.appendChild(document.createTextNode("Latest News"));
	  container.appendChild(header);

	  var postlist = document.createElement('ul');
  	  postlist.className += "fp_list";	  
	  container.appendChild(postlist);
	  
	  for (var i = 0; i < result.feed.entries.length; i++)
	  {
		var entry = result.feed.entries[i];

		var postlistitem = document.createElement('li');

		var postlink = document.createElement('a');
		postlink.appendChild(document.createTextNode(entry.title));

		postlistitem.appendChild(postlink);
		postlink.href = entry.link;
		
		postlist.appendChild(postlistitem);
	  }
	}
  });
}

google.setOnLoadCallback(initialize);