function doRateItem(table_name, item_id, rate, load_only) {
	var req = new JsHttpRequest();
	//alert('request created');
	req.onreadystatechange = function() {
		if (req.readyState == 4) {
			//alert('got content');
			document.getElementById('rating_' + table_name + '_' + item_id).innerHTML = req.responseText;
		}
	}
	req.caching = true;
	req.open('POST', '/tools/site/rating/rate.php', true);
	//alert('open request');
	req.send({ table_name: table_name, item_id: item_id, load_only: load_only, rate: rate });
	//alert('request sent');
}

function changeVotingPosition(table_name, item_id, rate, type, old_status) {
	img = document.getElementById('rating_star_' + table_name + '_' + item_id + '_' + rate);
	if (type == 'over') {
		img.alt = old_status;
		img.src = '/img/module/rating/star_green.gif';
	} else {
		img.src = '/img/module/rating/star_' + img.alt + '.gif';
	}
} 
