function CreateRating(currrating,curID,unicid,readonly,tabRat)
{
	var total_reiting = currrating; // итоговый ретинг
	var id_arc = curID; // id статьи
	var star_widht = total_reiting * 17;
	$('#raiting_star'+curID+unicid+' .raiting_votes').width(star_widht);
	
	$('#raiting_star'+curID+unicid+' .raiting_info span').append("Рейтинг : " + total_reiting);
	
	var he_voted = $.cookies.get('prodrat' + id_arc); // проверяем есть ли кука?
	if ((he_voted == null)&&(!readonly))
	{
		$('#raiting_star'+curID+unicid+' .raiting').hover(
		function() 
		{
			$('#raiting_star'+curID+unicid+' .raiting_votes').hide();
			$('#raiting_star'+curID+unicid+' .raiting_hover').toggle();
		},
		function() 
		{
			$('#raiting_star'+curID+unicid+' .raiting_votes').show();
			$('#raiting_star'+curID+unicid+' .raiting_hover').toggle();
		});
		var margin_doc = $('#raiting_star'+curID+unicid+' .raiting').offset();
		$('#raiting_star'+curID+unicid+' .raiting').mousemove(function(e) 
		{
			var widht_votes = e.pageX - margin_doc.left;
			
			//alert(margin_doc.left);
			/*
			if($.browser.mozilla)
			{
				widht_votes+=17;
			}
			*/
			if (widht_votes == 0)
				widht_votes = 1;
				user_votes = Math.ceil(widht_votes / 17);
				// обратите внимание переменная user_votes должна задаваться
				// без var, т.к. в этом случае она будет глобальной и мы
				// сможем к ней обратиться из другой ф-ции (нужна будет при
				// клике на оценке.
				$('#raiting_star'+curID+unicid+' .raiting_hover').width(user_votes * 17);
		});
		// отправка
		
		$('#raiting_star'+curID+unicid+' .raiting').click(function() 
		{
			$('#raiting_star'+curID+unicid+' .raiting_info span, #raiting_star'+curID+unicid+' .raiting_info img').toggle();
			$.post(location.href, 
					{
						recID : curID,
						user_votes : user_votes,
						raTab : tabRat,
						isRating:true
					}, function(data) 
					{
						//alert(data*17);
						var cursize=data*17;
						$('#raiting_star'+curID+unicid+' .raiting_votes').show();
						$('#raiting_star'+curID+unicid+' .raiting_votes').width(0);
						$('#raiting_star'+curID+unicid+' .raiting_votes').animate({width:cursize},3000);						
						$('#raiting_star'+curID+unicid+' .raiting_info span').html("Рейтинг : "+data);
						//$('#raiting_star'+curID+unicid+' .raiting_info span').html("Рейтинг: "+data+" / Вы поставили: "+user_votes);
						$('#raiting_star'+curID+unicid+' .raiting_info span, #raiting_star'+curID+unicid+' .raiting_info img').toggle();
						$.cookies.set('prodrat' + id_arc, 123, {
									hoursToLive : 24
								}); // создаем куку
						$('#raiting_star'+curID+unicid+' .raiting').unbind();
						$('#raiting_star'+curID+unicid+' .raiting_hover').hide();
					})
		});
	}
}
