/*
	Copyright © Eleanor CMS
	URL: http://eleanor-cms.ru, http://eleanor-cms.com
	E-mail: support@eleanor-cms.ru
	Developing: Alexander Sunvas*
	Interface: Rumin Sergey
	=====
	*Pseudonym
*/

function Rating(module,control,marks,addon)
{	if(!$(control).data("rating"))		$(control).data("rating",true).click(function(){			var mark=prompt("Введите свою оценку. Доступные варианты: "+marks.join(",")),
				th=this;
			if(!mark || $.inArray(parseInt(mark),marks)==-1)
				return false;
			CORE.Ajax(
					$.extend({							module:module,
							language:CORE.language,							rating:{
								mark:mark
							}						},addon),
					function(res)
					{						$(th).replaceWith(res);					}
			);
			return false;		})}
