function callRss() {
	asyncRequest('GET', 'http://www.uncommon-knowledge.co.uk/scripts/read-blog-feed.php?type=html', callRss_);
}

function callRss_(a) {
  document.getElementById("rss_feed").innerHTML = a;
}


var asyncRequest = function() {
	function handleReadyState(o, callback, tp) {
		var poll = window.setInterval(function() {
			if(o && o.readyState == 4) {
				window.clearInterval(poll);
				if ( callback ){
					!tp ? callback(o.responseText) : callback(o.responseText, tp);
				}
			}
		},
		50);
	}
	
	function getHttp() {
		var http;
		try {
			http = new XMLHttpRequest;
		}
		catch(e) {
			var msxml = [
				'MSXML2.XMLHTTP.3.0',
				'MSXML2.XMLHTTP',
				'Microsoft.XMLHTTP'
			];
			for ( var i=0, len = msxml.length; i < len; ++i ) {
				try {
					http = new ActiveXObject(msxml[i]);
					break;
				}
				catch(e) {}
			}
		}
		return http;
	}
	
	
	return function(method, uri, callback, tp, postData) {
		http = getHttp();
		http.open(method, uri, true);
		handleReadyState(http, callback, tp);
		if(method == 'POST') {
			http.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
			http.setRequestHeader("Content-length",postData.length);
			http.setRequestHeader("Connection", "close");
		}
		http.send(postData || null);
		return http;
	};
}();
