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

function post_comment_ajax() {
	body = escape(document.getElementById('comment_rating').value);
	name = escape(document.getElementById('name_rating').value);
	//if(body == '' || name == '')
	if(name == '')
		//alert("Please write a comment before you submit!");
		alert("Please fill your name in before you submit!");
	else {
		rating = document.getElementById('vote').value;
		seed = document.getElementById('commentSeed').value;
		if (window.XMLHttpRequest) { 
	    	http_request = new XMLHttpRequest();
		} else if (window.ActiveXObject) { 
	    	http_request = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		http_request.open('GET', 'post_comment.php?name='+name+'&body='+body+'&rating='+rating+'&seed='+seed, true);
		http_request.send('');
		comment_box_obj = document.getElementById("comment_box_id");
		comment_box_obj.innerHTML = "<span class=\"commentline\"><b>Your rating and comment were submitted.</b><br />Creativity Editors review all comments and post those that contribute to the discussion.</div><br />&nbsp;<br /></span>";
	}
}
