function setStar(v){
	wid = v * 25;
	document.getElementById("cur-rate").style.width = wid + "px";
	document.getElementById("vote").value = v;
}

function post_comment() {
	body = escape(document.vp_add_comment.vp_comment_content.value);
	name = escape(document.vp_add_comment.vp_comment_name.value);
	if(body == '' || name == '')
		alert("You must fill in both name and body to submit a comment");
	else {
		rating = document.vp_add_comment.vote.value;
		seed = document.vp_add_comment.seed.value;
		if (window.XMLHttpRequest) { 
	    	http_request = new XMLHttpRequest();
		} else if (window.ActiveXObject) { 
	    	http_request = new ActiveXObject("Microsoft.XMLHTTP");
		}
		http_request.open('GET', 'ajax/post_comment.php?name='+name+'&body='+body+'&rating='+rating+'&seed='+seed, true);
		http_request.send('');
		comment_box_obj = document.getElementById("comment_box");
		comment_box_obj.innerHTML = "<br><span class=\"commentline\"><b>Thanks for your comment!</b><br />We will post all comments that add to the discussion.<br />&nbsp;<br /></span>";
	}
}
