function setRating(stars){
	var fillRate = stars * 20;
	document.getElementById('current-rating').setAttribute('style','width:' + fillRate + '%;');
	document.getElementById('rating').setAttribute('value', stars);
}
function rateArticle(){
hostport = (window.location.port==80) ? "" : ":"+ window.location.port;
var ajax = new Ajax.Updater(
         'rating',    
         'http://'+window.location.hostname+hostport+'/agwi_rating_saver/rating/submit',     
         {           
         method:'post',
         parameters:Form.serialize('rating_form'),
         onComplete: showResponse
             });
}
function showResponse(req)
{
var reqText = req.responseText;
Effect.Fade('rating_form');
setTimeout("Effect.BlindUp('rating_form');", 100);
switchContent('rating_message', reqText);
setTimeout("Effect.BlindDown('rating_message');", 1000);
}
function switchContent(tagId, content){
	$(tagId).innerHTML = content;
}