/**
  * Post Rating 1.0
  * @author Albin Joseph
  * July 25, 2007
*/
var pid=-1;

function rate_action(response)
{
	// Display the current rating and hide the rating form
	xml=response.responseXML;
	document.getElementById('curr_rating_'+pid).innerHTML="Current Rating : " + xml.getElementsByTagName('rating').item(0).firstChild.data;
	document.getElementById('rate_form_'+pid).innerHTML = '';
}


function rate(postId, rating)
{
	var currId = 'rating_'+postId;
	pid = postId;
	new ajax('xmlhttp.php?action=rate_post&pid='+postId+"&rating="+rating,{onComplete:rate_action});
}