//Requires Prototype

function postComment(url) {

	cReq = new Ajax.Request(url, {
		method: 'post',
		onComplete: function(transport) {
			if(transport.responseText.match(/<code>\s*0/)) {
				$('blogcomment-form').style.display = "none";
				$('blogcomment-results').className = "blogcomment-results-good";
				$('blogcomment-results').innerHTML = "<h3>Your comment has been submitted - thanks!</h3><p>Comments will not appear until they've been approved.</p>";
			} else {
				$('blogcomment-results').className = "blogcomment-results-bad";
				$('blogcomment-results').innerHTML = "<h3>Your comment could not be posted.<h3><p>All fields are required, but your e-mail address will never be made public.</p>";
			}
		},
		parameters: {
			name: $('id_name').value,
			email: $('id_email').value,
			body: $('id_body').value
		}
	});
}