function loadFeed(toWhere,myFeed,feedTitle,maxItems){ 	
	$.getFeed({ 
		
		url: '/proxy-rss.php?url='+myFeed, 
		success: function(feed) {
			
	        // Title
	        //$(toWhere).append('<h2>' + feed.title + '</h2>');
	        $(toWhere).append('<h2>' + feedTitle + '</h2>');
	
	        // Unordered List
	        var html = '<ul>';
	
	        $(feed.items).each(function(i){
	        	// We only want to do this for so many items
	        	if( i < maxItems){
		            var $item = $(this);
		            //trace( $item.attr("link") );
		            
		            // Get date details in correct format
		            var articleDate = new Date().setISO8601($item.attr("updated")); 
		            var articleDateFormatted = articleDate.getDate() + "/" + (articleDate.getMonth() + 1) + "/" + articleDate.getFullYear();
		            
		            // List item
		            html += '<li>' +
		            '<a href="' + $item.attr("link") + '">' + $item.attr("title") + '</a> ' +
		            '<span class="date">(' + articleDateFormatted + ')</span>' +
		            '</li>';	        		
	        	}else{
	        		return false;
	        	}

	        });
	
	        html += '</ul>';
	
	        $(toWhere).append(html);
	        
	        $(toWhere+" ul li:last-child").addClass("last");
	    }
	});
};

// http://dansnetwork.com/2008/11/01/javascript-iso8601rfc3339-date-parser/
Date.prototype.setISO8601 = function(dString){
	var regexp = /(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/;
	if (dString.toString().match(new RegExp(regexp))) {
		var d = dString.match(new RegExp(regexp));
		var offset = 0;
		this.setUTCDate(1);
		this.setUTCFullYear(parseInt(d[1],10));
		this.setUTCMonth(parseInt(d[3],10) - 1);
		this.setUTCDate(parseInt(d[5],10));
		this.setUTCHours(parseInt(d[7],10));
		this.setUTCMinutes(parseInt(d[9],10));
		this.setUTCSeconds(parseInt(d[11],10));
		if (d[12])
			this.setUTCMilliseconds(parseFloat(d[12]) * 1000);
		else
			this.setUTCMilliseconds(0);
			if (d[13] != 'Z') {
			offset = (d[15] * 60) + parseInt(d[17],10);
			offset *= ((d[14] == '-') ? -1 : 1);
			this.setTime(this.getTime() - offset * 60 * 1000);
			}
		}
	else {
		this.setTime(Date.parse(dString));
	}
	return this;
};
