	function makePOSTRequest(url) {
		var http_request = false;

		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType('text/xml');
				// See note below about this line
			}
		} else if (window.ActiveXObject) { // IE
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}

		if (!http_request) {
			alert('Giving up :( Cannot create an XMLHTTP instance');
			return false;
		}
		return http_request;
	}
	
	function returnData(http_request) {
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				updateComments(http_request);
			} else {
				alert('There was a problem with the request.');
			}
		}
		if (http_request.readyState <= 1)
		{
			showLoading();
		}
	}
	
	function showLoading()
	{
// 		document.getElementById('se-newgenre').innerHTML='<option>Loading...</option>';
	}
	
	function updateComments(http_request) {
		var xmldoc = http_request.responseXML;
		
		// Insert new child elements for those in the XML file
		var node_count = xmldoc.getElementsByTagName('comment').length;
// 		document.getElementById('se-newgenre').innerHTML='';
		for (i = 0; i < node_count; i++) {
			var comment_author = xmldoc.getElementsByTagName('author').item(i);
			var comment_date = xmldoc.getElementsByTagName('date').item(i);
			var comment_body = xmldoc.getElementsByTagName('cbody').item(i);
			var new_comment = document.createElement('li');
			new_author = document.createElement('h2')
			new_author.appendChild(document.createTextNode(comment_author.firstChild.data));
			new_body = document.createElement('p')
			new_body.appendChild(document.createTextNode(comment_body.firstChild.data));
			new_date = document.createElement('p')
			new_date.setAttribute('class', 'date');
			new_date.appendChild(document.createTextNode(comment_date.firstChild.data));
			if (xmldoc.getElementsByTagName('avatar').item(i).firstChild.data != 'none')
			{
				var comment_avatar = xmldoc.getElementsByTagName('avatar').item(i);
				new_avatar = document.createElement('img')
				new_avatar.setAttribute('src', comment_avatar.firstChild.data);
				new_avatar.setAttribute('alt', comment_author.firstChild.data);
				new_comment.appendChild(new_avatar);
			}
			
			new_comment.appendChild(new_author);
			new_comment.appendChild(new_body);
			new_comment.appendChild(new_date);
			document.getElementById('ul-comments').insertBefore(new_comment, document.getElementById('ul-comments').firstChild);
		}
	}
	
	function postRating(url, rating) {
		rating++;
		http_request = makePOSTRequest(url);
		http_request.onreadystatechange = function() { updateRating(http_request); };
		http_request.open('POST', url, true);
		http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http_request.send('rating=' + rating);
	}
	
	function updateRating (http_request) {
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				var xmldoc = http_request.responseXML;
				var max_rating = xmldoc.getElementsByTagName('max').item(0).firstChild.data;
				var img_path = xmldoc.getElementsByTagName('img_path').item(0).firstChild.data;
				var rating = xmldoc.getElementsByTagName('rating').item(0).firstChild.data;
				var votes = xmldoc.getElementsByTagName('votes').item(0).firstChild.data;
				for (i = 0; i < max_rating; i++) {
					if (rating >= i+0.75) {
						img = 'on';
					} else if (rating >= i+0.25) {
						img = 'half';
					} else {
						img = 'off';
					}
					document.getElementById('ratingimg-' + i).src=img_path + 'rating-' + img + '.gif';
					document.getElementById('ratingimg-' + i).alt=100 / max_rating * rating + '% (' + votes + ')';
					document.getElementById('ratingimg-' + i).title=100 / max_rating * rating + '% (' + votes + ')';
				}
			} else {
				alert('There was a problem with the request.');
			}
		}
		if (http_request.readyState <= 1)
		{
// 			alert('loading');
		}
	}
	
	function showPage (id) {
		var pages = Array('pa-comments', 'pa-files', 'pa-events');
// 		pages[] = 'pa-comments';
// 		pages[] = 'pa-files';
// 		pages[] = 'pa-events';
		
		for (i = 0; i < pages.length; i++) {
			document.getElementById(pages[i]).style.display='none';
		}
		
		document.getElementById(id).style.display='block';
	}