function readRSS(URI, display_limit, text_limit, tab_width, display_replies, display_GMT)
{
	var div_id;
	do
		div_id = 'rss_' + Math.round(Math.random() * 10000);
	while ($('body').is('#' + div_id));
	document.write('<div id="' + div_id + '"></div>');

	$("#" + div_id).ajaxError(function(event, request, settings){
		$(this).append('<span class="fa_rss_error">Error requesting page ' + settings.url + '</span>');
	});

	$.get(URI, '', function(xml){
		var items_count = $('item', xml).length;
		if (items_count == 0)
			return false;
		var title, link, creator, pubDate, description;
		var forum_title = $('title:first', xml).text();
		var forum_url = URI.substr(0, URI.indexOf('/', 7) + 1) + 'viewforum.forum?f=' + URI.substr(URI.indexOf('f=') + 2, URI.length);
		var display_html = '<table class="fa_rss_table" width="' + tab_width + '"><tr><td><center><h3 class="fa_rss_h3"><a class="fa_rss_forum_title" href="' + forum_url + '" target="_blank">' + forum_title + '</a></h3></center></td></tr><tr><td class="fa_rss_td">';
		if (display_limit == -1)
			display_limit = items_count;

		$('item', xml).each(function(i){
			title = $('title', this).text();
			link = $('link', this).text();
			display_html += (i + 1) + '. ' + (title == '' ? '' : '<a class="fa_rss_title" href="' + link + '">' + title + '</a>');
			creator = $('creator', this).text();
			display_html += '<br />' + (creator == '' ? '<i class="fa_rss_error">Undefined author</i>' : '<span class="fa_rss_author">' + creator + '</span>');
			pubDate = $('pubDate', this).text();
			display_html += '<br />' + (pubDate == '' ? '<i class="fa_rss_error">Undefined date</i>' : '<span class="fa_rss_pubdate">' + (display_GMT ? pubDate : pubDate.substring(0, pubDate.indexOf(' GMT')) + '</span>'));
			if (text_limit == 0)
				description = '';
			else
			{
				description = $('description', this).text();
				if (text_limit != -1 && description.length > text_limit)
					description = description.substring(0, text_limit - 3) + '...';
			}
			display_html += '<br />' + description;
			if (i < display_limit - 1)
				display_html += '<hr />';
			else
				return false;
		});

		$('#' + div_id).html(display_html + '</td></tr></table>');
	}, 'xml');

}

if (typeof($) == 'undefined')
	document.write('<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>');
