function makeXHR() {
	if (window.XMLHttpRequest)
		return new XMLHttpRequest();
	else if (window.ActiveXObject)
		return new ActiveXObject('Microsoft.XMLHTTP');
	else
		throw 'XHR not detected';
}

function makeDate(t) {
	return new Date(t).toLocaleString();
}

function read(el, key) {
	return el.getElementsByTagName(key)[0].firstChild.nodeValue;
}

function writeUpdates() {
	if (xhr.readyState < 4)
		return;
	cont = document.getElementById('updates');
	var html = '';
	var posts = xhr.responseXML.getElementsByTagName('item');
	for (var i = 0; i < posts.length; i++)
		html +=
			'<div class="both">' +
			'<h2>' + read(posts[i], 'title') + '</h2>' +
			'</div><div class="left">' +
			read(posts[i], 'description') +
			'</div><div class="right">' +
			'<p><a href="">' + makeDate(read(posts[i], 'pubDate')) + '</a>' +
			'</div>';
	html +=
		'<div class="both">' +
		'<h2>Older Updates</h2>' +
		'<p>Read older update news at the <a href="http://destinaro.com/forums/index.php?showforum=2">&raquo; updates forum</a>.' +
		'</div>';
	cont.innerHTML = html;
}

var cont;

document.writeln('<div id="updates"><p class="both"><img src="loadinfo.net.gif" alt=""> Fetching update news...</div>');
var xhr = makeXHR();

xhr.open('GET', 'forums/index.php?act=rssout&id=1');
xhr.onreadystatechange = writeUpdates;
xhr.send(null);