
function vote(post_id, vote_num) {
	document.getElementById('post_vote_span_' + post_id).innerHTML = 'Ваша оценка: <span class="post_vote_res">' + vote_num + '</span>';
	var req = new XMLHttpRequest();
	if (req) {
		req.onreadystatechange = function() {
			if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {
			}
		};
		req.open('POST', '/rpc/', true);
		// many server-side scripts require the Content-Type to be set:
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
		req.send('func=vote&post_id=' + post_id + '&vote=' + vote_num);
	}
}
