$(document).ready(function() {
//clear the content in the div for the next feed.
	$("#feedContent").empty();
	//use the JQuery get to grab the URL from the selected item, put the results in to an argument for parsing in the inline function called when the feed retrieval is complete
	$.get('proxy.php?url=http://uk.news.yahoo.com/rss/business', function(d) {
	    //find each 'item' in the file and parse it
	    var $counter = 0;
	    $(d).find('item').each(function() {
	    	$counter++;
	    	//name the current found item this for this particular loop run
	    	var $item = $(this);
	    	// grab the post title
	    	var title = $item.find('title').text();
	    	// grab the post's URL
	    	var link = $item.find('link').text();
	    	// next, the description
	    	var description = $item.find('description').text();
	    	//don't forget the pubdate
	    	var pubDate = $item.find('pubDate').text();
	    	var dt = new Date( pubDate );
	    	// now create a var 'html' to store the markup we're using to output the feed to the browser window
	    	var html = "<div class=\"news-item\"><span class=\"news-item-title\"><a target=\"_blank\" href=\"" + link + "\">" + title + "<\/a><\/span>";
	    	html += "<span class=\"news-item-date\">" + dt.getDate() + "/" + (dt.getMonth() +1) + "/" + dt.getFullYear() + "</span><\/div>";
	    	if ($counter != 4) {
	    	html += "<div class=\"c3hr\"><\/div>";
	    	};

	    	//put that feed content on the screen!
	    	$('#feedContent').append($(html));
	    	if ($counter == 4) {
	    	$counter = 0;
	    	return false;
	     	}; 
	    });
	});
});
