var InicializedTemplates={};var Standart2Template=function(rate_index)
{Standart2Template.superClass.apply(this, arguments);}
Standart2Template._extends(StandartTemplate);Standart2Template.prototype.drawControl=function( element_id, value )
{var dict=this.dictonary[element_id];var closure=this;switch ( element_id )
{case"current_consumed_year":case"current_consumed_month":case"current_consumed_day":case"current_consumed_symbolic":var formatted_date=this.rate.getFormattedConsumeDate();var html='<span style="font-size:1.1em;font-weight:bold;">'+this.dictonary["current_consumed_year"][2]+'</span>'+'<span class="ajaxblue" onclick="javascript:rates['+this.rate.rate_index+'].drawDate();return false;">'+formatted_date+'</span>'+'<img id="'+this.img_date_remove_id+'" class="remove_date" src="'+this.img_date_remove+'" alt="Удалить" title="Удалить">';$("#"+this.user_action_date_id ).html(html);$("#"+this.img_date_remove_id).unbind("click");$("#"+this.img_date_remove_id).click(function (){closure.rate.setDay(0,0,0);closure.drawDate();});$("div#"+this.links_block_id+"_status_date").hide();if (formatted_date)
$("div#"+this.links_block_id+"_status_date").html(this.dictonary["current_consumed_year"][2]+' '+formatted_date).show();break;case"rate_variance":$("#"+this.rate_average_block_id ).attr('title',"Средняя: "+this.structure['rate_average']+" Разброс: "+value);break;case"user_rate_expected":if (value>0)
{stars=this.calcStars(value, this.img_wr_user_rate_expected_full, this.img_wr_user_rate_expected_half, this.img_wr_null,'greeny');$("#"+this.user_rate_expected_block).html(stars['value']).show();$("#"+this.user_rate_expected_block_stars).html(stars['stars']);}
break;case"user_rate_get_expect_link":if (value)
{$("#"+this.user_rate_expected_block).html('').hide();$("#"+this.user_rate_expected_block_stars).html('<a class="cp" onclick="javascript:rates['+this.rate.rate_index+'].getDirectExpect()"><img src="'+HOST_BASE+'img/get_expect2.gif" /></a>');}
break;case"user_rate_no_expect":if (value)
$("#"+this.user_rate_expected_block_stars).html('<div class="pb2">Нет прогноза</div>');break;case"rate_average":stars=this.calcStars(value, this.img_wr_rate_average_full, this.img_wr_rate_average_half, this.img_wr_null,'brown');$("#"+this.rate_average_block_digits).html(stars['value']).show();$("#"+this.rate_average_block_id).html(stars['stars']);break;case"user_refferents_amount":if (!isset(this.rate.params['hide_referents']))
{if (value>0)
{if (this.rate.params['hide_referents_link']>0)
{$("#"+this.user_refferents_amount_id).hide();var html=value+'&nbsp;';if (this.rate.params['cross_object_type_id']&&this.rate.params['cross_object_type_name'])
{html+='<span style="cursor:help" title="Кросскультурный прогноз от рекомендателей по '+this.rate.params['cross_object_type_name']+'">'+getCountName(value,'рекомендатель','рекомендателя','рекомендателей')+'</span>';}else{html+=getCountName(value, this.dictonary.referents[1], this.dictonary.referents[2], this.dictonary.referents[3]);}
$("#"+this.user_refferents_amount_cross_id).html(html).show();}
else
{$("#"+this.user_refferents_amount_id ).attr('href', this.rate.params['user_refferents_amount_link']);$("#"+this.user_refferents_amount_id).html( value+'&nbsp;'+getCountName(value, this.dictonary.referents[1], this.dictonary.referents[2], this.dictonary.referents[3]) ).show();}}
else
{$("#"+this.user_refferents_amount_id).html('').hide();$("#"+this.user_refferents_amount_cross_id).html('').hide();}}
break;case"user_refferents_amount_link":$("#"+this.user_refferents_amount_id ).attr('href', value );break;case"rates_amount":if (value>0)
{$("#"+this.rates_amount_id).html( value+'&nbsp;'+getCountName(value,'оценка','оценки','оценок') ).show();$("#"+this.rates_amount_none_id).html('').hide();}
else
{$("#"+this.rates_amount_none_id).html('Нет оценок').show();$("#"+this.rates_amount_id).html('').hide();}
break;case"rates_amount_link":$("#"+this.rates_amount_id ).attr('href', value );break;case"user_interests":if (!this.rate.params['hide_user_interests'])
{if (this.rate.params['user_id']){if ( parseInt(value)>0 )
{$("#"+this.user_not_interesting_id ).hide();var html='<img src="'+this.img_user_interesting_a+'" style="vertical-align:top;">';html+='<span class="ryellow">'+((!dict)?'мне интересно':dict )+'</span> <span class="rgrey">(<a id="'+this.user_interesting_id+'_nomore" class="rgrey" href="#">больше нет</a>)</span>';$("#"+this.user_interesting_id ).html(html).show();$("#"+this.user_interesting_id).unbind('mouseenter').unbind('mouseleave').unbind('click');$("#"+this.user_interesting_id+"_nomore").unbind('click');$("#"+this.user_interesting_id+"_nomore").click(function(){$("#"+closure.user_interesting_id ).html('').hide();$("#"+closure.user_not_interesting_id ).show();closure.rate.setInterest(0);return false;});}
else{$("#"+this.user_not_interesting_id ).show();var html='<img id="'+this.user_interesting_id+'_icon" src="'+this.img_user_interesting+'" style="vertical-align:top;">';html+='<img src="'+this.img_user_interesting_hover+'" id="'+this.user_interesting_id+'_caption" style="vertical-align:top;display:none;">';$("#"+this.user_interesting_id ).addClass("user_interesting_caption").html(html).show();$("#"+this.user_interesting_id).unbind('mouseenter').unbind('mouseleave').unbind('click');$("#"+this.user_interesting_id).mouseenter(function(){$("#"+closure.user_interesting_id+"_caption").show();$("#"+closure.user_interesting_id+"_icon").hide();$("#"+closure.user_not_interesting_id+"_icon").hide();}).mouseleave(function(){$("#"+closure.user_interesting_id+"_caption").hide();$("#"+closure.user_interesting_id+"_icon").show();$("#"+closure.user_not_interesting_id+"_icon").show();}).click(function(){$(this).html('');$(this).removeClass("user_interesting_caption");closure.drawInterestLayer();closure.rate.setInterest(1);});}}}
break;case"user_not_interests":if (this.rate.params['user_id']&&this.rate.params['user_id']!=this.rate.params['object_owner_id'])
{if ( parseInt(value)>0 ){$("#"+this.user_interesting_id ).hide();var html='<img src="'+this.img_user_not_interesting_a+'" style="vertical-align:top;">';html+='<span class="ryellow">'+dict+'</span> <span class="rgrey">(<a id="'+this.user_not_interesting_id+'_nomore" class="rgrey" href="#">вернуть</a>)</span>';$("#"+this.user_not_interesting_id ).html(html).show();$("#"+this.user_not_interesting_id).unbind('mouseenter').unbind('mouseleave').unbind('click');$("#"+this.user_not_interesting_id+"_nomore").unbind('click');$("#"+this.user_not_interesting_id+"_nomore").click(function(){$("#"+closure.user_not_interesting_id ).html('').hide();closure.rate.setNotInterest(0);return false;});}
else if($("#"+this.user_interesting_id+"_nomore").length==0){$("#"+this.user_interesting_id ).show();var html='<img id="'+this.user_not_interesting_id+'_icon" src="'+this.img_user_not_interesting+'" style="vertical-align:top;">';html+='<img src="'+this.img_user_not_interesting_hover+'" id="'+this.user_not_interesting_id+'_caption" style="vertical-align:top;display:none;">';$("#"+this.user_not_interesting_id ).addClass("user_interesting_caption").html(html).show();$("#"+this.user_not_interesting_id).unbind('mouseenter').unbind('mouseleave').unbind('click');$("#"+this.user_not_interesting_id).mouseenter(function(){$("#"+closure.user_not_interesting_id+"_caption").show();$("#"+closure.user_not_interesting_id+"_icon").hide();}).mouseleave(function(){$("#"+closure.user_not_interesting_id+"_caption").hide();$("#"+closure.user_not_interesting_id+"_icon").show();}).click(function(){$(this).html('');$(this).removeClass("user_interesting_caption");closure.rate.setNotInterest(1);});}}
break;case"feedback_ok":if (value){$("#"+this.expect_feedback_id).parent().parent().hide();this.fixRateLayerPosition();}
break;case"user_important":this.drawUserImportant(value);break;case"user_multirate":if (this.rate.params['enable_nominations']&&this.rate.params['user_id']>0&&!isset(this.rate.params['nomination_rates']))
{$("#"+this.user_multirate_id ).html('<a class="ajax" href="#">детализированная оценка</a>');$("#"+this.user_multirate_id+" a").unbind('click');$("#"+this.user_multirate_id+" a").click(function(){closure.getNominations();return false;});}
break;case"user_rate_anonymous":if ( parseInt(value)>0 )
$("#"+this.user_rate_anonymous_id ).html('<span class="ryellow">анонимная</span> (<a class="rgrey" href="#" onclick="javascript:rates['+this.rate.rate_index+'].setAnonymity(0);return false;">снять</a>)');else
$("#"+this.user_rate_anonymous_id ).html('<a class="rgrey" href="#" onclick="javascript:rates['+this.rate.rate_index+'].setAnonymity(1);return false;">анонимная оценка</a>');break;case"special_passion_ok":if (value)
$("#"+this.passion_id).html('спасибо');break;case"special_funny_ok":if (value)
$("#"+this.funny_id).html('спасибо');break;case"user_rate":var multirate=false;var starId=0;var rateFunction='setRate';var extraId='';var user_star=this.img_star_user;var no_user_star=this.img_star_user_none;var rate_null=this.img_rate_null;var add_class=isset(this.additional_star_class)?this.additional_star_class:'';if (isset(value.nomination_id)){var nomination=value;value=value.rate;multirate=true;starId=nomination.nomination_id;rateFunction='setNominationRate';extraId='_'+nomination.nomination_id;user_star=this.img_star_user_nomination;no_user_star=this.img_star_user_nomination_none;rate_null=this.img_rate_null_nomination;add_class='';}
if (!multirate)
{this.drawFeedback(value);}
if ( this.drawed_stars[starId]!=false )
{if (this.rate.params['user_id']>0)
{var t=0;for (var i=1;i<=this.total_marks;i++)
{if (this.rate_names[i]==undefined||value<i)
continue;t++;}
if (!multirate)
this.drawRateLayer(value);if (!multirate&&$.cookie('rate_layer_no_display'))
this.collapseRateLayer();return this.rewriteStars( t,'static', starId );}else if(value>0){location.href=addParamSeparator(this.rate.params['link_registration'])+'redirect='+encodeURIComponent(window.location);return;}}
this.drawed_stars[starId]=true;var stars='';t=0;for (var i=1;i<=this.total_marks;i++)
{if (this.rate_names[i]==undefined)
continue;t++;if ( value<i )
star=no_user_star;else
star=user_star;if (!isset(this.no_display_digits))
stars+='<img class="magicstar rate_image '+add_class+'" title="'+this.rate_names[i]+' - '+i+'" src="'+star+'"';else
stars+='<img class="magicstar rate_image '+add_class+'" title="'+this.rate_names[i]+'" src="'+star+'"';stars+='onclick="javascript:rates['+this.rate.rate_index+'].template.'+rateFunction+'('+i+','+starId+')" ';stars+=' id="s_'+this.rate.rate_index+'_'+starId+'_'+t+'" />';}
if (this.rate.params.layout=='EntityTemplate')
stars+='<img id="'+this.loaded_image_id+extraId+'" src="'+this.img_progress_point+'" style="margin-left:5px;vertical-align: middle;display:none;">';stars+='<span id="'+this.rate_remove_id+extraId+'"></span>';if (!multirate&&!this.rate.params['disable_block_opinion']){if (this.show_rate_change_icon){stars+='<img class="changelink" style="';if (value<=0)
stars+='display:none;';stars+='" src="'+this.img_rate_change+'" id="'+this.rate_change_id+'" onclick="javascript:rates['+this.rate.rate_index+'].template.drawRateLayer(rates['+this.rate.rate_index+'].params.user_rate)">';}else{stars+='<span style="';if (value<=0)
stars+='display:none;';stars+='" class="ajax orangez changelink" id="'+this.rate_change_id+'" onclick="javascript:rates['+this.rate.rate_index+'].template.drawRateLayer(rates['+this.rate.rate_index+'].params.user_rate)">';stars+='изменить';stars+='</span>';}}
$("#"+this.user_rate_stars_id+extraId).html( stars );if (value>0)
{this.rate_remove_drawed[starId]=true;$("#"+this.rate_remove_id+extraId).html('&nbsp;<img class="rate_image '+add_class+'" title="сбросить оценку" onclick="javascript:rates['+this.rate.rate_index+'].template.'+rateFunction+'(0,'+starId+')" src="'+rate_null+'" />');}
if (this.show_user_rate_digits&&value>0&&!multirate){$("#"+this.user_rate_digits_id).html('<span class="red">'+value+'</span>').show();}
break;case"rate_other":if (value>0)
{stars=this.calcStars(value, this.img_wr_other_rate_expected_full, this.img_wr_other_rate_expected_full, this.img_wr_null,'och');$("#"+this.rate_other_value_id).html(stars['value']).show();$("#"+this.rate_other_block_stars).html(stars['stars']).show();}
break;case"alias_other":$("#"+this.alias_other_id).html(value).show();break;}}
Standart2Template.prototype.setRate=function(rate,type)
{return this.rate.setRate(rate,type);}
Standart2Template.prototype.setNominationRate=function(rate,type)
{return this.rate.setNominationRate(rate,type);}
Standart2Template.prototype.drawFeedback=function(user_rate)
{$("#"+this.expect_feedback_id).parent().parent().hide();if (user_rate>0&&this.rate.params['user_rate_expected']!=0&&(this.rate.params["feedback_ok"]==undefined||this.rate.params["feedback_ok"]==0)&&this.rate.params["already_feedback"]==undefined)
{$("#"+this.expect_feedback_id).show().html('<img src="'+HOST_BASE+'img/goodphoto.gif"> <a class="ajax rgreen" href="" onclick="rates['+this.rate.rate_index+'].sendExpectFeedback(); return false;">Хороший прогноз, спасибо!</a>');$("#"+this.expect_feedback_id).parent().parent().show();}
else if (this.rate.params["feedback_ok"]!=1)
{$("#"+this.expect_feedback_id).hide().html('');}}
Standart2Template.prototype.getNominations=function()
{var oParams=new Object;oParams.action='Nomination';oParams.step='getNominations';oParams.object_id=this.rate.params["object_id"];oParams.content_id=this.rate.params["content_id"];oParams.rate_index=this.rate.rate_index;$.post(script_url, oParams, this.drawNominations,"json");}
Standart2Template.prototype.getNominationRow=function(nomination_id, nomination_title)
{var html='';html+='<tr id="'+this.tr_nominations_block_id+'_'+nomination_id+'">';html+='<td colspan="2" class="orangez" style="text-align:right;"><div style="width:115px;">'+nomination_title+'&nbsp;</div></td><td>';html+='<div class="oh nobr" style="width:160px;height:17px;"><span';html+=' id='+this.user_rate_stars_id+'_'+nomination_id+'></span>';html+='</div></td></tr>';return html;}
Standart2Template.prototype.drawNominations=function(response)
{var closure=rates[response.rate_index].template;var html='';var multirates=Array();for ( var i in response.nominations )
if (isset(response.nominations[i].nomination_id)){var nomination_id=response.nominations[i].nomination_id;closure.drawed_stars[nomination_id]=false;closure.rate_remove_drawed[nomination_id]=false;multirates[nomination_id]=response.nominations[i].rate;html+=closure.getNominationRow(nomination_id,response.nominations[i].title);}
$("#"+closure.tr_nominations_block_id ).replaceWith(html);rates[response.rate_index].params["nomination_rates"]=multirates;for ( var i in response.nominations )
if (isset(response.nominations[i].nomination_id))
closure.drawControl('user_rate', response.nominations[i]);bindMagicStar();$("#"+closure.user_multirate_id+" a").unbind("click");$("#"+closure.user_multirate_id+" a").click(function (){$("#"+closure.div_nominations_block_id ).toggle();if (!closure.opinion_written){$("#"+closure.opinion_block_id).toggle();$("#"+closure.opinion_block_id+'link').toggle();}
return false;});$("#"+closure.div_nominations_block_id ).show();if (!closure.opinion_written){$("#"+closure.opinion_block_id).hide();$("#"+closure.opinion_block_id+'link').show();}}
Standart2Template.prototype.drawInterestLayer=function()
{if (this.rate.params['user_rate']>0||this.rate.params['disable_interest_layer']){this.collapseInterestLayer();return;}
var closure=this;var thing='Произведение добавлено';var hide_links=false;if (this.rate.params['entity']=='person'&&this.rate.params['list_person']=='1')
thing='Персона добавлена';if (this.rate.params['entity']=='person'&&this.rate.params['list_person']=='0'){thing='Бренд добавлен';hide_links=true;}
if (this.rate.params['entity']=='collection')
thing='Альбом добавлен';if (this.rate.params['entity']=='element')
thing=this.dictonary.elements[4];$("#"+this.interest_layer_id+"notice").html('<p>'+thing+' </p> в <a href="'+
this.rate.params['user_personal_list']+'">ваш личный список</a>');if (!hide_links){var links='Посмотрите <a href="'+this.rate.params['link_opinions']+'">отзывы</a>';if (this.rate.params['entity']=='element')
links+=' и '+'<a href="'+this.rate.params['link_rates']+'">оценки</a>';links+=' ваших единомышленников.';$("#"+this.interest_layer_id+"links").html(links);}
var no_options=true;if (isset(this.rate.params['il_buy_price'])&&this.rate.params['il_buy_price']>0){no_options=false;var html='<div style="color:#FF0063;"><img src="'+this.img_il_buy+'"> купить</div>'+'<span>'+this.rate.params['il_buy_price']+' руб. '+'<a href="'+this.rate.params['il_buy_link']+'">'+this.rate.params['il_buy_title']+'</a></span>';$("#"+this.interest_options_id+"buy").html(html);}
if (isset(this.rate.params['il_bazaar_amount'])&&this.rate.params['il_bazaar_amount']>0){no_options=false;var html='<div><img src="'+this.img_il_bazaar+'"> найти на толкучке</div>'+'<span><a href="'+this.rate.params['il_bazaar_link']+'">'+
this.rate.params['il_bazaar_amount']+' '+getCountName(this.rate.params['il_bazaar_amount'], this.dictonary.offers[1], this.dictonary.offers[2], this.dictonary.offers[3])+'</a></span>';$("#"+this.interest_options_id+"bazaar").html(html);}
if (!no_options)
$("#"+this.interest_options_id).show();$("#"+this.interest_layer_id+"close").click(function (){closure.collapseInterestLayer();});this.fixInterestLayerPosition();$("#"+this.interest_layer_id).show();$("#"+this.user_interesting_id).hide();}
Standart2Template.prototype.collapseInterestLayer=function()
{$("#"+this.interest_layer_id).hide();if (!this.rate.params['hide_user_interests']){$("#"+this.user_interesting_id).show();}}
Standart2Template.prototype.fixInterestLayerPosition=function()
{if (!$("#"+this.interest_layer_id))
return;if (this.rate.params['content_id']==20&&this.rate.params['layout']=='Standart2'){$("#"+this.interest_layer_id).css("top","45px");}
if (this.rate.params['content_id']==8&&this.rate.params['layout']=='EntityTemplate'&&this.rate.params['entity']!='person'&&!document.all&&!RegExp("WebKit/").test(navigator.userAgent)){$("#"+this.interest_layer_id).css("top","95px");}
if (this.rate.params['layout']=='EntityTemplate'&&this.rate.params['user_rate_expected']==0&&this.rate.params['user_rate']<=0&&this.rate.params['rate_average']==0){$("#"+this.interest_layer_id).css("left","120px");}
if (this.rate.params['layout']=='Joined'&&$("#"+this.distinct_other_id).css('display')!='none'){$("#"+this.interest_layer_id).css("top","100px");}
if (this.rate.params['entity']=='person'){$("#"+this.interest_layer_id+" div div.aside").css("background-color","transparent");}}
Standart2Template.prototype.drawRateLayer=function(user_rate)
{if (user_rate<=0||this.rate.params['disable_block_opinion']){this.collapseRateLayer();return;}
$("#"+this.rate_change_id).hide();$("#"+this.tr_user_rate_block_id+" td").appendTo("#"+this.rate_layer_stars_id);if (this.rate.current_consumed_year>0)
$("#"+this.user_action_date_id ).show();else
this.drawDate();if ( this.structure["user_multirate"]==undefined )
this.drawControl("user_multirate", this.loaded_params["user_multirate"]);this.drawPassion(user_rate);this.drawFunny(user_rate);this.drawOpinion(user_rate);this.fixRateLayerPosition();$("#"+this.rate_layer_id).show();$("#"+this.interest_layer_id).hide();}
Standart2Template.prototype.collapseRateLayer=function()
{$("#"+this.rate_layer_stars_id+" td").appendTo("#"+this.tr_user_rate_block_id);$("#"+this.consumed_date_id ).hide();$("#"+this.consumed_calendar_id ).hide();$("#"+this.rate_layer_id).hide();if (!this.rate.params['disable_block_opinion']){$("#"+this.rate_change_id).show();if (document.all){$("#"+this.user_rate_stars_id).hide().show();}}}
Standart2Template.prototype.fixRateLayerPosition=function()
{if (!$("#"+this.rate_layer_id))
return;if (this.rate.params['content_id']==8&&this.rate.params['layout']=='EntityTemplate'&&this.rate.params['entity']!='person'){$("#"+this.rate_layer_id).css("top","65px");}
if (this.rate.params['layout']=='Standart2'){if ($("#"+this.expect_feedback_id).parent().parent().css('display')=='none')
$("#"+this.rate_layer_id).css("top","32px");else
$("#"+this.rate_layer_id).css("top","52px");}
if (this.rate.params['layout']=='Joined'&&$("#"+this.distinct_other_id).css('display')!='none'){$("#"+this.rate_layer_id).css("top","39px");}
var right_offset=$("div#right").position();if (isset(right_offset)&&isset(right_offset.left)){var diff=746 - right_offset.left;var diff2=parseInt($("#"+this.rate_layer_id).css("width")) - 345;if (diff>0){var new_left=parseInt($("#"+this.rate_layer_id).css("left")) - (diff+diff2);$("#"+this.rate_layer_id).css("left", new_left+"px");}}}
Standart2Template.prototype.drawOpinion=function(user_rate)
{var oParams=new Object;var entity=this.rate.params["entity"];if (entity==undefined)
entity='collection';oParams.action='Opinion';oParams.user_opinion=1;oParams.id=this.rate.params[entity+"_id"];oParams.content_id=this.rate.params["content_id"];oParams.entity=entity;oParams.rate_index=this.rate.rate_index;$.post(script_url, oParams, this.responseOpinion,"json");}
Standart2Template.prototype.drawOpinionForm=function(response)
{var closure=this;$("#"+this.opinion_block_id+"save_block").hide();$("#"+this.opinion_block_id+"close").click(function (){closure.collapseRateLayer();});if ($.cookie('rate_layer_no_display'))
$("#"+this.opinion_block_id+"nodisplay").attr("checked","checked");$("#"+this.opinion_block_id+"nodisplay").change(function (){if (this.checked){setCookie('rate_layer_no_display', 1);$("input[id*='nodisplay']").attr("checked","checked");}else{setCookie('rate_layer_no_display','');$("input[id*='nodisplay']").removeAttr("checked");}});$("#"+this.opinion_block_id+"link").unbind("click");$("#"+this.opinion_block_id+"link").click(function (){$("#"+closure.div_nominations_block_id ).toggle();$("#"+closure.opinion_block_id).toggle();$("#"+closure.opinion_block_id+'link').toggle();return false;});if (response.user_opinion){var opinionLink='<a class="rate_opinion"  style="color:#037FDF !important;" href="'+response.user_opinion.link+'#edit">'+firstWords(response.user_opinion.text,10)+'...</a> &nbsp;';$("#"+this.opinion_block_id+"text").replaceWith(opinionLink);this.opinion_written=true;}else{$("#"+this.opinion_block_id+"text").unbind('keyup');$("#"+this.opinion_block_id+"text").keyup(function (){if ($.trim($(this).val())){$("#"+closure.opinion_block_id+"save_block").show();}else{$("#"+closure.opinion_block_id+"save_block").hide();}});$("#"+this.opinion_block_id+"save").unbind("click");$("#"+this.opinion_block_id+"save").click(function (){var text=$("#"+closure.opinion_block_id+"text").val();var anonymity=($("#"+closure.opinion_block_id+"anon").attr("checked"))?1:0;if (!$.trim(text))
{alert('Пустой отзыв не может быть отправлен.');return;}
$(this).attr('disabled', true).attr('value','Сохраняю...');var oParams=new Object;var entity=closure.rate.params["entity"];if (entity==undefined)
entity='collection';oParams.action='Opinion';oParams.text=text;oParams.source='';oParams.id=closure.rate.params[entity+"_id"];oParams.entity=entity;oParams.attitude='';oParams.anonymity=anonymity;oParams.content_id=closure.rate.params["content_id"];oParams.rate_index=closure.rate.rate_index;$.post(script_url, oParams, closure.responseOpinion,"json");});}
$("#"+this.tr_opinion_block_id).show();$("#"+this.opinion_block_id+"text").keyup();}
Standart2Template.prototype.drawPassion=function(user_rate)
{if (this.rate.params["passion"]==1)
{if (user_rate>0&&(this.rate.params["special_passion_ok"]==undefined||this.rate.params["special_passion_ok"]==0)&&this.rate.params["already_passion"]==undefined)
$("#"+this.passion_id).show().html('<span title="Страстно!" ><img src="'+HOST_BASE+'img/passions.gif" align="absmiddle"> <a class="ajax" onclick="rates['+this.rate.rate_index+'].sendUserSpecialObject(\'passion\'); return false;"><span style="color: #037FDF">Страстно!</span></a></span>');else if (this.rate.params["special_passion_ok"]!=1||user_rate==0)
$("#"+this.passion_id).hide().html('');}
else
{$("#"+this.passion_id).remove();}}
Standart2Template.prototype.drawFunny=function(user_rate)
{if (this.rate.params["funny"]==1)
{if (user_rate>0&&(this.rate.params["special_funny_ok"]==undefined||this.rate.params["special_funny_ok"]==0)&&this.rate.params["already_funny"]==undefined)
$("#"+this.funny_id).show().html('<span title="Смешно!" ><img src="'+HOST_BASE+'img/funny.png" align="absmiddle"> <a class="ajax" onclick="rates['+this.rate.rate_index+'].sendUserSpecialObject(\'funny\'); return false;"><span style="color: #037FDF">Смешно</span></a></span>');else if (this.rate.params["special_funny_ok"]!=1||user_rate==0)
$("#"+this.funny_id).hide().html('');}
else
{$("#"+this.funny_id).remove();}}
Standart2Template.prototype.responseOpinion=function(response)
{var closure=rates[response.rate_index].template;if (response.registration_url){setCookie('registration_referer', getHrefWOAnchor(location.href));location.href=addParamSeparator(response.registration_url)+'redirect='+encodeURIComponent(window.location);}else if (response.saved){closure.collapseRateLayer();}else{closure.drawOpinionForm(response);}}
Standart2Template.prototype.calcStars=function(value, star_full, star_half, star_none, value_class)
{ret=new Array();ret['stars']='';ret['value']='';stars='';v='';draw=false;margin=0;t=0;value=parseFloat(value);for (var i=1;i<=this.total_marks;i++)
{if (this.rate_names[i]==undefined)
continue;t++;switch (true)
{case (i - value<0.3 ):star=star_full;break;case (i - value>=0.3&&i - value<0.7):star=star_half;break;case (i - value>=0.7):star=star_none;break;}
if (i<value - 0.29)
margin+=13;else if (!draw)
{if (value!=0)
v+='<div class="'+value_class+'" style="margin-left:'+margin+'px">'+parseFloat(value).toPrecision(2).toString().replace('.',',')+'</div>';draw=true;}
stars+='<img src="'+star+'"/>';}
ret['value_padding']=v;if (parseFloat(value)!=0)
ret['value']='<span class="'+value_class+'">'+parseFloat(value).toPrecision(2).toString().replace('.',',')+"</span>";else
ret['value']='&nbsp;';ret['stars']='<nobr>'+stars+'</nobr>';return ret;}
Standart2Template.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=this.getZindex();html=this.drawControlElement('header');html+='<table cellspacing="0" cellpadding="0">';html+=this.drawControlElement('expected_digits');html+=this.drawControlElement('expected_stars');html+=this.drawControlElement('expect_feedback');html+=this.drawControlElement('average_digits');html+=this.drawControlElement('average_stars');html+=this.drawControlElement('user_rate');html+=this.drawControlElement('links_blocks');html+='</table>';html+=this.drawControlElement('rate_layer_header');html+=this.drawControlElement('nominations');html+=this.drawControlElement('rate_layer_links');html+=this.drawControlElement('rate_layer_date');html+=this.drawControlElement('opinion');html+=this.drawControlElement('rate_layer_footer');html+=this.drawControlElement('interest_layer_header');html+=this.drawControlElement('interest_layer_body');html+=this.drawControlElement('interest_layer_footer');html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
Standart2Template.prototype.getZindex=function()
{zindex=10 - this.rate.rate_index;if (this.rate.rate_index>10)
zindex=(10 - this.rate.rate_index % 10);return zindex;}
Standart2Template.prototype.drawControlElement=function(name)
{if (!name)
return'';switch( name )
{case"header":return'<div class="wrate" style="z-index:'+this.getZindex()+';position:relative;" id="'+this.rate_block_id+'">';break;case"footer":return'</div>';break;case"rate_layer_header":html='<div style="top:32px;left:70px;padding:2px 9px 12px 9px;" class="wrate rate_layer" id="'+this.rate_layer_id+'">';html+='<div style="float:right;margin-right:90px;margin-left:-60px;" class="rgrey pb2" id="'+this.user_rate_anonymous_id+'"></div>';html+='<table><tr id="'+this.rate_layer_stars_id+'" ></tr></table>';return html;break;case"rate_layer_date":html='<div class="consumed_date"  id="'+this.user_action_date_id+'"></div>';html+='<div class="consumed_date" id="'+this.consumed_date_id+'"></div>';html+='<div class="consumed_date" id="'+this.consumed_calendar_id+'"></div>';return html;break;case"rate_layer_links":html='<div class="rgrey" id="'+this.user_important_id+'"></div>';html+='<div id="'+this.passion_id+'"></div>';html+='<div id="'+this.funny_id+'"></div>';return html;break;case"rate_layer_footer":html='';html+='</div>';return html;break;case"interest_layer_header":html='<div class="wrate interest_layer" style="top:50px;left:70px;padding:2px 9px 12px 9px;" id="'+this.interest_layer_id+'">';return html;break;case"interest_layer_body":html='<div><div class="aside">&nbsp;</div><div class="caption">Мне интересно</div></div>';html+='<div class="interest_layer_body">'+'<div id="'+this.interest_layer_id+'notice" class="notice"></div>'+'<div id="'+this.interest_layer_id+'links" class="links"></div>'+'<div id="'+this.interest_options_id+'" class="options">'+'    <div id="'+this.interest_options_id+'buy"></div>'+'    <div id="'+this.interest_options_id+'bazaar"></div>'+'    <div id="'+this.interest_options_id+'cinema"></div>'+'    <div id="'+this.interest_options_id+'tv"></div>'+'</div>'+'<div style="float:right;" id="'+this.interest_layer_id+'close">'+'    <span style="text-decoration:underline;cursor:pointer;margin-left:10px;color:#46494E;">закрыть</span> <img style="margin-left:0;" class="remove_date" src="'+this.img_date_remove+'" alt="закрыть" title="закрыть">'+'</div>'+'</div>';return html;break;case"interest_layer_footer":html='';html+='</div>';return html;break;case"expect_feedback":return'<tr style="display:none"><td colspan="2" ></td><td class="pb5"><span id="'+this.expect_feedback_id+'" style="display:none"></span></td></tr>';break;case"user_rate":html='<tr id="'+this.tr_user_rate_block_id+'"><th class="orangez" style="width:43px;height:17px"><nobr>Моя оценка</nobr></th>';html+='<td id="'+this.user_rate_digits_id+'" class="orangez"></td><td>';html+='<div class="oh nobr" style="width:';html+=this.rate.params['compact_width']?'160':'205';html+='px;"><span id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div></td></tr>';return html;break;case"expected_stars":html='<tr id="'+this.tr_expected_stars_id+'" class="'+this.expected_and_average_id+'"><th class="pb_expect" style="width:43px">Прогноз</th>';html+='<td><div style="margin-right:5px" id="'+this.user_rate_expected_block+'"></div></td>';html+='<td><div style="float:left;margin-right:5px" id="'+this.user_rate_expected_block_stars+'"></div>';html+='<a class="count" style="float:left;display:none;" id="'+this.user_refferents_amount_id+'"></a>'
html+='<span id="'+this.user_refferents_amount_cross_id+'" style="display:none"></span></td></tr>';return html;break;case"average_stars":html='<tr id="'+this.tr_average_stars_id+'" class="'+this.expected_and_average_id+'"><th class="vat pb_average" style="width:43px;">Средняя</th>';html+='<td><div style="display:none;margin-right:5px" id="'+this.rate_average_block_digits+'"></div></td>';html+='<td><div class="tltpshow" style="float:left;margin-right:5px"id='+this.rate_average_block_id+'></div>';html+='<span><a style="display:none;float:left" class="count" id="'+this.rates_amount_id+'"></a></span> <span style="display:none" id="'+this.rates_amount_none_id+'" class="nobr count"></span></td></tr>';return html;break;case"links_blocks":return'<tr id="'+this.tr_links_block_id+'"><td colspan="2">&nbsp;</td><td><div style="line-height:14px" class="rate_links_block" id="'+this.links_block_id+'"></div></td></tr>';break;case"opinion":html='<div style="display:none;color: #45484d;margin-top:2px;" id="'+this.tr_opinion_block_id+'">';html+=' <div class="rate_opinion_block" id="'+this.opinion_block_id+'"><form  class="gray">';html+='  <div class="rate_opinion_text" id="'+this.opinion_block_id+'title">Мой отзыв</div>';html+='  <textarea class="rate_opinion text" id="'+this.opinion_block_id+'text"></textarea>';html+='  <div id="'+this.opinion_block_id+'save_block" style="display:none;">';html+='<div style="float:left;display:inline;">';html+='<input type="button" id="'+this.opinion_block_id+'save" class="rate_opinion_button" style="margin-left: 0px;" value="Сохранить"/>';html+='</div><input type="checkbox" id="'+this.opinion_block_id+'anon" name="anonymity">';html+='<label for="'+this.opinion_block_id+'anon">анонимно</label>';html+='</div>';html+='</form></div>';html+='<div style="float:right;">';html+='<input type="checkbox" id="'+this.opinion_block_id+'nodisplay" name="nodisplay">';html+='<label for="'+this.opinion_block_id+'nodisplay">не показывать</label>';html+='<span id="'+this.opinion_block_id+'close">';html+='<span style="text-decoration:underline;cursor:pointer;margin-left:10px;">закрыть</span> <img style="margin-left:0;" class="remove_date" src="'+this.img_date_remove+'" alt="закрыть" title="закрыть">';html+='</span></div>';html+='  <div id="'+this.opinion_block_id+'link" style="display:none;"><span class="ajaxblue">Написать отзыв</span></div>';html+='</div>';return html;break;case"nominations":html='<div class="orangez" id="'+this.user_multirate_id+'" ></div>';html+='<div id="'+this.div_nominations_block_id+'" class="multirate">';html+='<table><tr style="display:none" id="'+this.tr_nominations_block_id+'"><td colspan="3"></td></tr></table></div>';return html;break;default:return'';break;}}
Standart2Template.prototype.doSomeSpecial=function()
{if (this.rate.params['entity']=='person')
$("#"+this.user_action_date_id ).hide();if ((this.structure['user_interests']==0||this.structure['user_interests']==undefined)&&this.rate.params['interest_amount']>0)
$("#"+this.interesting_count_id ).html('&nbsp;(<a class="rgrey" href="'+this.rate.params['user_important_link']+'">'+this.rate.params['interest_amount']+'</a>)');else if (this.rate.params['interest_amount']==0)
$("#"+this.interesting_count_id ).html('');if (this.rate.params['content_id']!=22&&this.rate.params['user_interests']==0){this.drawControl('user_not_interests', this.structure['user_not_interests']);}
if (this.rate.params['user_rate']>0){$("#"+this.user_not_interesting_id ).hide();$("#"+this.user_interesting_id ).hide();}
if (this.rate.params['hide_rates_link']==1)
$("#"+this.rates_amount_id).hide();if (isset(this.rate.params['is_simple_things'])&&!this.rate.params['user_id']){$("#"+this.tr_expected_stars_id).hide();}}
Standart2Template.prototype.beforeRequest=function()
{}
Standart2Template.prototype.afterRequest=function()
{}
function incializeTemplate(type)
{switch (type)
{case'PoemTemplate':PoemTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{document.write('<div class="rate_element"  style="margin:5px 0" id="'+this.rate_block_id+'">');document.write('<div class="poem_guess mb5">');document.write('<table id="'+this.guess_author_id+'" width="200px" cellpadding="0" cellspacing="0"><tr>');document.write('<td style="width:4px; height:19px; vertical-align:middle; background: transparent url('+HOST_BASE+'img/search4.gif) 100% 50% no-repeat"></td>');document.write('<td width="155px" style="background: transparent url('+HOST_BASE+'img/searchbg.gif) 50% 50% repeat-x">');document.write('<input type="text" maxlength="40" value="Угадай автора" class="searchtxt" id="guess_result" onfocus="javascript:rates['+this.rate.rate_index+'].flushForm(\'guess_result\')" onblur="javascript:rates['+this.rate.rate_index+'].restoreForm(\'guess_result\',\'Угадай автора\')" />');document.write('</td><td style="width:24px; height:19px; vertical-align:middle; background: transparent url('+HOST_BASE+'img/search3.gif) 0% 50% no-repeat">');document.write('</tr></table>');document.write('</div>');document.write('<div class="rate_stars_block">');document.write('<span id="'+this.user_rate_stars_id+'" onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)"></span>');document.write('<span id="'+this.loaded_image_id+'"></span></div>');document.write('</div>');this.drawed=true;}}
PoemTemplate.prototype.doSomeSpecial=function()
{if (this.rate.params.user_id)
{this.rate.ajax_params.action='RatePoem';if (this.rate.params.user_rate!=0)
{$('#RealWidget'+this.rate.params.object_id).show();$('#GuessWidget'+this.rate.params.object_id).hide();$('#PoemInfo'+this.rate.params.object_id).show();$('#PoemTitle'+this.rate.params.object_id).show();$('#PoemPicture'+this.rate.params.object_id).attr('src', $("#PoemPictureSrc"+this.rate.params.object_id).attr('value') );if (this.rate.params.success!=undefined)
{var resp='';if (this.rate.params.success>0&&this.rate.params.guess_result==1)
{var resp='Вы угадали '+this.rate.params.success+' автора из '+this.rate.params.total;}
else
{if (this.rate.params.guess_result!=undefined&&this.rate.params.guess_result!=2)
{var resp='Вы ошиблись';$("#PoemsUserStat"+this.rate.params.object_id).addClass('tipAlert');}}
if (resp!='')
$("#PoemsUserStat"+this.rate.params.object_id).show().html(resp);}}
else
{$('#GuessWidget'+this.rate.params.object_id).show();if (this.rate.params.guess_result!=undefined)
{this.rate.params.guess_result=2;$("#"+this.guess_author_id).hide();}
$('#PoemPicture'+this.rate.params.object_id).attr('src', $("#PoemPictureSrcNull"+this.rate.params.object_id).attr('value') );$("#PoemsUserStat"+this.rate.params.object_id).hide();$('#RealWidget'+this.rate.params.object_id).hide();$('#PoemInfo'+this.rate.params.object_id).hide();$('#PoemTitle'+this.rate.params.object_id).hide();$("#PoemsUserStat"+this.rate.params.object_id).hide();}}}
break;case'EvaluateRateTemplate':EvaluateRateTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{html=this.drawControlElement('header');html+='<table cellspacing="0" cellpadding="0"><tr><td>';html+='<div class="oh nobr" style="width:160px"><span onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)" id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';if (this.rate.params['user_rate']==0)
{var miracle_oid='0';if (this.rate.params['miracle_oid']!=undefined)
var miracle_oid=this.rate.params['miracle_oid'];html+='<div><a class="ajax cp" onclick="replaceEvaluateElement('+
this.rate.params['content_id']+',\''+this.rate_block_id+'\',\''+miracle_oid+'\',\''+this.rate.params['entity']+'\')">Не знаю, уберите</a></div>';}
html+='</td></tr>';html+='</table>';html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;$("#"+this.rate_block_id).css('width','140px');}}
EvaluateRateTemplate.prototype.beforeRequest=function()
{if (this.rate.params['user_rate']==0)
{var miracle_oid='0';if (isset(this.rate.params['miracle_oid']))
var miracle_oid=this.rate.params['miracle_oid'];replaceEvaluateElement(this.rate.params['content_id'], this.rate_block_id,miracle_oid,this.rate.params['entity']);}}
EvaluateRateTemplate.prototype.afterRequest=function()
{refreshEvaluateRates(this.rate.params['content_id'], 1, this.rate.params['entity']);}
break;case'EvaluateTravelTemplate':EvaluateTravelTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{html=this.drawControlElement('header');html+='<table cellspacing="0" cellpadding="0"><tr><td>';html+='<div class="oh nobr" style="width:160px"><span onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)" id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';if (this.rate.params['user_rate']==0)
{html+='<div><a class="ajax cp" onclick="replaceEvaluateCity('+
this.rate.params['object_type_id']+',\''+this.rate_block_id+'\')">'+this.dictonary['dontbeen']+'</a></div>';}
html+='</td></tr>';html+='</table>';html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;$("#"+this.rate_block_id).css('width','140px');}}
EvaluateTravelTemplate.prototype.beforeRequest=function()
{if (this.rate.params['user_rate']==0)
replaceEvaluateCity(this.rate.params['object_type_id'], this.rate_block_id);}
EvaluateTravelTemplate.prototype.afterRequest=function()
{refreshEvaluateCityRates(1);}
break;case'EvaluateIntRateTemplate':EvaluateIntRateTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{html=this.drawControlElement('header');html+='<table cellspacing="0" cellpadding="0"><tr><td>';html+='<div class="oh nobr" style="width:160px"><span onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)" id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';if (this.rate.params['user_rate']==0)
{html+='<div><a class="ajax cp" onclick="replaceEvaluateElement('+
this.rate.params['content_id']+',\''+this.rate_block_id+'\',\'0\')">Не знаю, уберите</a></div>';}
html+='</td></tr>';html+='</table>';html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;$("#"+this.rate_block_id).css('width','140px');}}
EvaluateIntRateTemplate.prototype.beforeRequest=function()
{if (this.rate.params['user_rate']==0)
{replaceEvaluateElement(this.rate.params['content_id'], this.rate_block_id,'0');}}
EvaluateIntRateTemplate.prototype.afterRequest=function()
{refreshEvaluateRates(this.rate.params['content_id'], 1);}
EvaluateIntRateTemplate.prototype.requestCompleted=function()
{$("#"+this.loaded_image_id ).hide();}
break;case'JoinedTemplate':JoinedTemplate.prototype.drawControlElement=function(name)
{if (!name)
return'';switch( name )
{case"rate_layer_header":html='<div style="top:23px;left:70px;padding:2px 9px 12px 9px;" class="wrate rate_layer" id="'+this.rate_layer_id+'">';html+='<div style="float:right;margin-right:90px;margin-left:-60px;" class="rgrey pb2" id="'+this.user_rate_anonymous_id+'"></div>';html+='<table><tr id="'+this.rate_layer_stars_id+'" ></tr></table>';return html;break;case"interest_layer_header":html='<div class="wrate interest_layer" style="top:85px;left:70px;padding:2px 9px 12px 9px;" id="'+this.interest_layer_id+'">';return html;break;default:return JoinedTemplate.superClass.prototype.drawControlElement.apply(this, arguments);break;}}
JoinedTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=this.getZindex();html='<div class="wrate" style="z-index:'+zindex+';position:relative;" id="'+this.rate_block_id+'">';html+='<table cellspacing="0" cellpadding="0" border=0>';html+='<tr><th class="pb_other" style="color:red;width:43px!important;display:none;" id="'+this.alias_other_id+'"></th>';html+='<td><div style="padding-right:5px;" id="'+this.rate_other_value_id+'"></div></td>';html+='<td><div class="oh mr5" style="display:none" id="'+this.rate_other_block_stars+'"></div>'+'<div class="db grey" id="'+this.distinct_other_id+'" style="color:red;display:none;"></div>'+'<div style="display:none;margin-bottom:4px;" class="db grey" id="'+this.read_date_other_id+'"></div>'+'</td></tr>';html+=this.drawControlElement('expected_digits');html+=this.drawControlElement('expected_stars');html+=this.drawControlElement('average_digits');html+=this.drawControlElement('average_stars');html+=this.drawControlElement('user_rate');html+=this.drawControlElement('links_blocks');html+='</table>';html+=this.drawControlElement('rate_layer_header');html+=this.drawControlElement('nominations');html+=this.drawControlElement('rate_layer_links');html+=this.drawControlElement('rate_layer_date');html+=this.drawControlElement('opinion');html+=this.drawControlElement('rate_layer_footer');html+=this.drawControlElement('interest_layer_header');html+=this.drawControlElement('interest_layer_body');html+=this.drawControlElement('interest_layer_footer');html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
JoinedTemplate.prototype.drawControl=function( element_id, value )
{switch ( element_id )
{default:JoinedTemplate.superClass.prototype.drawControl.apply(this, arguments);break;case"distinct_other":if (value>0)
{$("#"+this.distinct_other_id).html('&laquo;Знаковое&raquo;').show();$("#"+this.distinct_other_id).parent().parent().show();}
else
{$("#"+this.distinct_other_id).html('').hide();$("#"+this.distinct_other_id).parent().parent().hide();}
break;case"read_date_other":t=value.split("-");consumed_year_other=t[0];consumed_month_other=t[1];consumed_day_other=parseInt(t[2],10);switch (true)
{case (consumed_day_other>0):$("#"+this.read_date_other_id ).html(
this.dictonary["current_consumed_year"][3]+parseInt(consumed_day_other,10)+' '+
this.months_locative[consumed_month_other]+' '+consumed_year_other+' года').show();break;case (consumed_month_other>0):$("#"+this.read_date_other_id ).html(
this.dictonary["current_consumed_year"][3]+' в '+this.months_genitive[consumed_month_other]+' '
+consumed_year_other+' года').show();break;case (consumed_year_other>0):$("#"+this.read_date_other_id ).html(
this.dictonary["current_consumed_year"][3]+' в '+consumed_year_other+' году').show();break;default:$("#"+this.read_date_other_id ).html('').hide();break;}
break;}}
JoinedTemplate.prototype.doSomeSpecial=function()
{JoinedTemplate.superClass.prototype.doSomeSpecial.apply(this, arguments);if (this.structure['no_display_name'])
$("#"+this.alias_other_id).hide();if (this.rate.params['user_rate']>0)
$("."+this.expected_and_average_id).hide();else
$("."+this.expected_and_average_id).show();}
break;case'Home2Template':Home2Template.prototype.getZindex=function()
{zindex=9 - this.rate.rate_index;if (this.rate.rate_index>9)
zindex=(10 - this.rate.rate_index % 10);return zindex;}
Home2Template.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=this.getZindex();html='<div class="wrate" style="z-index:'+zindex+';position:relative" id="'+this.rate_block_id+'">';html+='<table cellspacing="0" cellpadding="0" border=0><tr class="digits">';html+='<td style="padding-bottom:0px"><div class="greeny fll">Прогноз&nbsp;</div><div id="'+this.user_rate_expected_block+'"></div></td>';html+='</tr>';html+='<tr><td><div style="height:20px" id="'+this.user_rate_expected_block_stars+'"></div>';html+='</a></td></tr>';html+='<tr class="digits"><td><div class="brown">Средняя</div></td>';html+='</tr>';html+='<tr><td><div class="oh fll mr5" id='+this.rate_average_block_id+'></div>';html+='</td></tr>';html+='<tr>';html+='<td><div class="orangez">Моя оценка</div></td></tr><tr id="'+this.tr_user_rate_block_id+'"><td class="pd10">';html+='<div class="oh nobr" style="width:160px"><span onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)" id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';html+='</td></tr><tr><td class="pd10 home2ie"><div class="rate_links_block" id="'+this.links_block_id+'"></div></td></tr>';html+='</table>';html+=this.drawControlElement('rate_layer_header');html+=this.drawControlElement('rate_layer_date');html+=this.drawControlElement('rate_layer_important');html+=this.drawControlElement('opinion');html+=this.drawControlElement('rate_layer_footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;$("#"+this.rate_block_id).css('marginLeft','0px').css('width','140px');}}
Home2Template.prototype.drawControl=function( element_id, value )
{switch ( element_id )
{default:return Home2Template.superClass.prototype.drawControl.apply(this, arguments);break;case"user_rate_expected":if (value>0)
{stars=this.calcStars(value, this.img_wr_user_rate_expected_full, this.img_wr_user_rate_expected_half, this.img_wr_null,'greeny');$("#"+this.user_rate_expected_block).html(stars['value_padding']).show();$("#"+this.user_rate_expected_block_stars).html(stars['stars']);}
break;case"user_multirate":this.rate.params["enable_nominations"]=0;break;}}
Home2Template.prototype.drawControlElement=function(name)
{if (!name)
return'';switch( name )
{case"rate_layer_header":html='<div style="top:72px;left:-11px;padding:2px 9px;" class="wrate rate_layer" id="'+this.rate_layer_id+'"><table>';html+='<tr id="'+this.rate_layer_stars_id+'" ></tr></table>';return html;break;default:return Home2Template.superClass.prototype.drawControlElement.apply(this, arguments);break;}}
break;case'PersonTemplate':PersonTemplate.prototype.doSomeSpecial=function()
{PersonTemplate.superClass.prototype.doSomeSpecial.apply(this, arguments);$("#"+this.user_action_date_id).remove();}
break;case'ProductTemplate':ProductTemplate.prototype.doSomeSpecial=function()
{ProductTemplate.superClass.prototype.doSomeSpecial.apply(this, arguments);$("#"+this.user_action_date_id).remove();}
break;case'IntTemplate':IntTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=100 - this.rate.rate_index;html='<div class="wrate" style="margin-left:0px" style="z-index:'+zindex+';position:relative;" id="'+this.rate_block_id+'">';html+='<table cellspacing="0" cellpadding="0" border=0>';html+=this.drawControlElement('user_rate');html+='</table>';html+='</div>';if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
IntTemplate.prototype.drawControlElement=function(name)
{if (!name)
return'';switch( name )
{case"user_rate":html='<tr><th class="orangez vat" style="width:80px"><strong>Моя оценка</strong></th>';html+='<td class="pd10">';html+='<div class="oh nobr" style="width:160px"><span onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)" id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';html+='<div class="rate_links_block" id="'+this.links_block_id+'"></div>';html+='<div class="rate_links_block" id="'+this.additional_block_id+'"></div>';html+='</td></tr>';return html;break;default:return IntTemplate.superClass.prototype.drawControlElement(name);break;}}
IntTemplate.prototype.doSomeSpecial=function()
{if (this.rate.params['user_rate']>0)
{$("#"+this.links_block_id).hide();if (this.rate.params['user_id']>0)
{var additional_html='<div><a class="rgrey" href="#" onclick="showRateIntAdditional('+this.rate.params['object_id']+', \''+this.additional_block_id+'\'); return false;">Уточнить</a></div><div class="yellow rate_psevdo">&nbsp;</div>';$("#"+this.additional_block_id).html(additional_html).show();}}else{$("#"+this.links_block_id).show();$("#"+this.additional_block_id).hide();}
$('#rateIntAdditionalDiv').remove();}
IntTemplate.prototype.requestCompleted=function()
{IntTemplate.superClass.prototype.requestCompleted.apply(this, arguments);if (this.rate.params['user_id']>0&&this.rate.params['user_rate']>0&&!$.cookie('rate_int_additional_hide'))
{showRateIntAdditional(this.rate.params['object_id'], this.additional_block_id);}}
break;case'IntIntersectionTemplate':IntIntersectionTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=this.getZindex();html='<div class="wrate" style="z-index:'+zindex+';position:relative;" id="'+this.rate_block_id+'">';html+='<table cellspacing="0" cellpadding="0" border=0>';html+='<tr><th class="vat" style="width:80px;color:red" id="'+this.alias_other_id+'"></th><td><div class="oh fll mr5" id="'+this.rate_other_block_stars+'"></div>';html+=' <span class="db fll grey" id="'+this.distinct_other_id+'" style="color:red;display:none;"></span><br /><span style="display:none;" class="db fll grey" id="'+this.read_date_other_id+'"></span></td></tr>';html+=this.drawControlElement('user_rate');html+='</table>';html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
break;case'TVTemplate':TVTemplate.prototype.doSomeSpecial=function()
{TVTemplate.superClass.prototype.doSomeSpecial.apply(this, arguments);if (this.structure['user_rate']<=0 )
$("#"+this.links_block_id).hide();else if (this.structure['user_rate']>0)
$("#"+this.links_block_id).show();}
break;case'PrintTemplate':PrintTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=100 - this.rate.rate_index;html='<span id="'+this.user_rate_expected_text_id+'"><u>Прогноз:</u> <span id="'+this.user_rate_expected_block+'"></span> &nbsp;</span>';html+='<span id="'+this.user_rate_average_text_id+'"><u>Средняя:</u> <span id='+this.rate_average_block_digits+'></span></span>';if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
PrintTemplate.prototype.doSomeSpecial=function()
{PrintTemplate.superClass.prototype.doSomeSpecial.apply(this, arguments);if (parseInt(this.rate.params['user_rate_expected'])==0)
$("#"+this.user_rate_expected_text_id).hide();if (parseInt(this.rate.params['rate_average'])==0)
$("#"+this.user_rate_average_text_id).hide();}
break;case'ExpectedAndAverageTemplate':ExpectedAndAverageTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=100 - this.rate.rate_index;html='<div class="wrate" style="z-index:'+zindex+';position:relative;" id="'+this.rate_block_id+'">';html+='<table cellspacing="0" cellpadding="0" border=0>';html+='<tr class="digits"><td></td>';html+='<td><div class="oh" id="'+this.user_rate_expected_block+'"></div></td></tr>';html+='<tr><th class="vat" style="color:white">Прогноз</th><td><div class="oh" id="'+this.user_rate_expected_block_stars+'"></div>';html+='</td></tr>';html+='<tr><th class="vat" style="color:white">Средняя</th><td><div class="oh" id='+this.rate_average_block_id+'></div>';html+='</td></tr>';html+='</table>';html+='</div>';if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
break;case'ExpectedOrAverageTemplate':ExpectedOrAverageTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=100 - this.rate.rate_index;html=this.drawControlElement('header');html+='<table cellspacing="0" cellpadding="0">';html+=this.drawControlElement('expected_digits');html+=this.drawControlElement('expected_stars');html+=this.drawControlElement('average_digits');html+=this.drawControlElement('average_stars');html+=this.drawControlElement('user_rate');html+='<tr id="'+this.tr_button_expand_id+'"><th></th><td></td><td style="padding-bottom:4px">';html+='<a href="#" class="ajax" style="color:#808080;" onclick="javascript:rates['+this.rate.rate_index+'].showWidget();$(this).parent().parent().remove(); return false;" id="'+this.button_expand_id+'">Подробнее</a></td></tr>';html+=this.drawControlElement('links_blocks');html+='</table>';html+=this.drawControlElement('rate_layer_header');html+=this.drawControlElement('nominations');html+=this.drawControlElement('rate_layer_links');html+=this.drawControlElement('rate_layer_date');html+=this.drawControlElement('opinion');html+=this.drawControlElement('rate_layer_footer');html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
ExpectedOrAverageTemplate.prototype.drawControlElement=function(name)
{if (!name)
return'';switch( name )
{case"rate_layer_header":html='<div style="top:-9px;left:60px;padding:2px 9px 12px 4px;" class="wrate rate_layer" id="'+this.rate_layer_id+'">';html+='<div style="float:right;margin-right:90px;margin-left:-60px;" class="rgrey pb2" id="'+this.user_rate_anonymous_id+'"></div>';html+='<table><tr id="'+this.rate_layer_stars_id+'" ></tr></table>';return html;break;default:return ExpectedOrAverageTemplate.superClass.prototype.drawControlElement.apply(this, arguments);break;}}
ExpectedOrAverageTemplate.prototype.doSomeSpecial=function()
{ExpectedOrAverageTemplate.superClass.prototype.doSomeSpecial.apply(this, arguments);if (this.rate.params["expand_widget"]==0)
{$("#"+this.tr_button_expand_id).remove();$("#"+this.user_rate_digits_id).remove();$("#"+this.user_rate_expected_block).parent().remove();$("#"+this.rate_average_block_digits).parent().remove();$("#"+this.links_block_id).hide();$("#"+this.tr_links_block_id).hide();if (parseInt(this.rate.params['user_rate'])!=0)
{$("#"+this.tr_expected_block_id).hide();$("#"+this.tr_expected_stars_id).hide();$("#"+this.tr_average_stars_id).hide();$("#"+this.tr_average_block_id).hide();}
else
{$("#"+this.tr_user_rate_block_id).hide();$("#"+this.tr_expected_block_id).show();$("#"+this.tr_expected_stars_id).show();$("#"+this.tr_average_stars_id).show();$("#"+this.tr_average_block_id).show();}
if (parseInt(this.rate.params['user_rate_expected'])==0)
{$("#"+this.tr_expected_block_id).hide();$("#"+this.tr_expected_stars_id).hide();}
if (parseInt(this.rate.params['rate_average'])==0)
{$("#"+this.tr_user_rate_block_id).show();$("#"+this.tr_expected_block_id).hide();$("#"+this.tr_expected_stars_id).hide();$("#"+this.tr_average_stars_id).hide();$("#"+this.tr_average_block_id).hide();}
if (parseInt(this.rate.params['user_rate_expected'])!=0)
{$("#"+this.tr_average_stars_id).hide();$("#"+this.tr_average_block_id).hide();}
$("#"+this.user_refferents_amount_id).hide();$("#"+this.user_refferents_amount_cross_id).hide();}
else
{if (this.widget_hided)
{$("#"+this.tr_links_block_id).hide();$("#"+this.links_block_id).hide();if (parseInt(this.rate.params['user_rate_expected'])!=0)
{$("#"+this.tr_user_rate_block_id).show();$("#"+this.tr_expected_block_id).show();$("#"+this.tr_expected_stars_id).show();$("#"+this.tr_average_stars_id).hide();$("#"+this.tr_average_block_id).hide();}
if (parseInt(this.rate.params['user_rate'])!=0||parseInt(this.rate.params['rate_average'])==0||parseInt(this.rate.params['user_rate_expected'])==0)
{$("#"+this.links_block_id).hide();$("#"+this.tr_links_block_id).hide();$("#"+this.tr_expected_block_id).hide();$("#"+this.tr_expected_stars_id).hide();$("#"+this.tr_average_stars_id).show();$("#"+this.tr_average_block_id).show();$("#"+this.tr_user_rate_block_id).show();}}
else
{$("#"+this.tr_links_block_id).show();$("#"+this.links_block_id).show();}}}
ExpectedOrAverageTemplate.prototype.showWidget=function()
{this.widget_hided=false;$("#"+this.tr_user_rate_block_id).show();$("#"+this.tr_expected_block_id).show();$("#"+this.tr_expected_stars_id).show();$("#"+this.tr_average_stars_id).show();$("#"+this.tr_average_block_id).show();$("#"+this.user_refferents_amount_id).show();$("#"+this.user_refferents_amount_cross_id).show();$("#"+this.links_block_id).show();this.doSomeSpecial();}
break;case'MyRateTemplate':MyRateTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=100 - this.rate.rate_index;html=this.drawControlElement('header');html+='<table cellspacing="0" cellpadding="0">';html+=this.drawControlElement('user_rate');html+='</table>';html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
break;case'StringIntersectionTemplate':StringIntersectionTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=this.getZindex();html='<div class="wrate" style="z-index:'+zindex+';position:relative" id="'+this.rate_block_id+'">';html+='<div class="oh mr5 fll" id='+this.other_rate_name_id+'></div><div style="height:20px;" class="oh mr5 fll tltpshow" id='+this.rate_other_block_stars+'></div>';html+='<div class="oh mr5 fll">Моя</div><div class="oh nobr fll" style="height:20px;width:160px"><span onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)" id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';html+='</div>';if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
StringIntersectionTemplate.prototype.doSomeSpecial=function()
{if (this.rate.params['rate_other']>0)
$("#"+this.other_rate_name_id).html(this.dictonary['him']);else
$("#"+this.other_rate_name_id).hide();}
break;case'PhotoTemplate':PhotoTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=this.getZindex();html='<div class="wrate" style="z-index:'+zindex+';position:relative" id="'+this.rate_block_id+'">';html+='<table cellspacing="0" cellpadding="0" border=0><tr class="digits">';html+='<td style="padding-bottom:0px"><div id="'+this.user_rate_expected_block+'" class="greeny fll"></div></td>';html+='</tr>';html+='<tr><td><div style="height:20px" class="oh fll mr5" id="'+this.user_rate_expected_block_stars+'"></div><a id="'+this.user_refferents_amount_id+'"></a>';html+='</a></td></tr>';if (this.loaded_params["rate_other"])
{html+='<tr class="digits"><td><div class="red fll" id="'+this.alias_other_id+'"></div></td>';html+='</tr>';html+='<tr><td><div style="height:20px" class="oh fll mr5 tltpshow" id='+this.rate_other_block_stars+'></div>';html+='</td></tr>';}
html+='<tr class="digits"><td><div class="brown fll">Средняя&nbsp;&mdash;&nbsp;</div><div class="fll brown" id="'+this.rate_average_block_digits+'"></div></td>';html+='</tr>';html+='<tr><td><div style="height:20px" class="oh fll mr5 tltpshow" id='+this.rate_average_block_id+'></div><a id="'+this.rates_amount_id+'"></a>';html+='</td></tr>';html+='<tr>';html+='<td class="pd10"><div class="orangez">Моя оценка</div>';html+='<div class="oh nobr" style="height:20px"><span onmouseout="javascript:rates['+this.rate.rate_index+'].restoreStars(\'dynamic\',0)" id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';html+='<div class="rate_links_block" id="'+this.links_block_id+'"></div></td></tr>';html+='</table>';html+='</div>';if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;if (this.loaded_params["rates_amount_link"])
$("#"+this.rates_amount_id ).attr('href', this.loaded_params["rates_amount_link"]);}}
PhotoTemplate.prototype.drawControl=function( block_id, value )
{switch ( block_id )
{default:return PhotoTemplate.superClass.prototype.drawControl.apply(this, arguments);break;case"user_rate_expected":if (value>0)
{stars=this.calcStars(value, this.img_wr_user_rate_expected_full, this.img_wr_user_rate_expected_half, this.img_wr_null,'greeny');var html='Прогноз&nbsp;&mdash;&nbsp;'+parseFloat(value).toPrecision(2).toString().replace('.',',');$("#"+this.user_rate_expected_block).html(html).show();$("#"+this.user_rate_expected_block_stars).html(stars['stars']);}
break;case"rate_average":PhotoTemplate.superClass.prototype.drawControl.apply(this, arguments);if (value==0)
$('#'+this.rate_average_block_digits).html('нет');break;}}
break;case'RatingRateTemplate':RatingRateTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=100 - this.rate.rate_index;html=this.drawControlElement('header');html+='<table cellspacing="0" cellpadding="0">';html+=this.drawControlElement('user_rate');html+=this.drawControlElement('average_digits');html+=this.drawControlElement('average_stars');html+='</table>';html+=this.drawControlElement('footer');if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;}}
RatingRateTemplate.prototype.drawControlElement=function(name)
{if (!name)
return'';switch( name )
{case"rate_layer_header":html='<div style="top:-9px;left:60px;padding:2px 9px 12px 4px;" class="wrate rate_layer" id="'+this.rate_layer_id+'">';html+='<div style="float:right;margin-right:90px;margin-left:-60px;" class="rgrey pb2" id="'+this.user_rate_anonymous_id+'"></div>';html+='<table><tr id="'+this.rate_layer_stars_id+'" ></tr></table>';return html;break;default:return RatingRateTemplate.superClass.prototype.drawControlElement.apply(this, arguments);break;}}
RatingRateTemplate.prototype.doSomeSpecial=function()
{if (parseInt(this.rate.params['user_rate'])!=0)
{$("#"+this.tr_user_rate_block_id).show();$("#"+this.tr_average_stars_id).hide();$("#"+this.tr_average_block_id).hide();}
else
{$("#"+this.tr_user_rate_block_id).hide();$("#"+this.tr_average_stars_id).show();$("#"+this.tr_average_block_id).show();}}
break;case"CompactRatingRateTemplate":CompactRatingRateTemplate.prototype.getZindex=function()
{zindex=9 - this.rate.rate_index;if (this.rate.rate_index>9)
zindex=(10 - this.rate.rate_index % 10);return zindex;}
CompactRatingRateTemplate.prototype.drawControls=function(rate)
{this.rate=rate;if (!this.drawed )
{zindex=this.getZindex();html='<div class="wrate" style="z-index:'+zindex+';position:relative" id="'+this.rate_block_id+'">';html+='<table cellspacing="0" cellpadding="0" border=0>';html+='<tr class="digits" id="'+this.tr_user_rate_block_id+'_myrate"><td><div class="brown">Моя&nbsp;оценка</div></td>';html+='</tr>';html+='<tr id="'+this.tr_user_rate_block_id+'">';html+='<td id="'+this.user_rate_digits_id+'" class="orangez">';html+='<div class="oh mr5 nobr fll" style="width: 145px;"><span id='+this.user_rate_stars_id+'></span>';html+='<span>&nbsp;<img id="'+this.loaded_image_id+'" src="'+this.img_progress_point+'" style="display:none" width="10" height="10"></span></div>';html+='</td></tr>';html+='<tr class="digits" id="'+this.tr_average_block_id+'"><td><div class="brown">Средняя</div></td>';html+='</tr>';html+='<tr id="'+this.tr_average_stars_id+'"><td><div class="oh fll mr5" id='+this.rate_average_block_id+'></div>';html+='</td></tr>';html+='</table>';html+='</div>';if (this.rate.params.use_document_write===0)
$("#"+this.rate.params.widget_id).html(html);else
document.write(html);this.drawed=true;$("#"+this.rate_block_id).css('marginLeft','0px').css('width','140px');}}
CompactRatingRateTemplate.prototype.doSomeSpecial=function()
{if (parseInt(this.rate.params['user_rate'])!=0)
{$("#"+this.tr_user_rate_block_id+'_myrate').show();$("#"+this.tr_user_rate_block_id).show();$("#"+this.tr_average_stars_id).hide();$("#"+this.tr_average_block_id).hide();}
else
{$("#"+this.tr_user_rate_block_id+'_myrate').hide();$("#"+this.tr_user_rate_block_id).hide();$("#"+this.tr_average_stars_id).show();$("#"+this.tr_average_block_id).show();}}
CompactRatingRateTemplate.prototype.drawControl=function( element_id, value )
{switch ( element_id )
{default:return CompactRatingRateTemplate.superClass.prototype.drawControl.apply(this, arguments);break;case"user_rate_expected":if (value>0)
{stars=this.calcStars(value, this.img_wr_user_rate_expected_full, this.img_wr_user_rate_expected_half, this.img_wr_null,'greeny');$("#"+this.user_rate_expected_block).html(stars['value_padding']).show();$("#"+this.user_rate_expected_block_stars).html(stars['stars']);}
break;case"user_multirate":this.rate.params["enable_nominations"]=0;break;}}
break;case"EntityTemplate":EntityTemplate.prototype.drawControl=function( element_id, value )
{var dict=this.dictonary[element_id];if (this.rate.params['user_id']){return EntityTemplate.superClass.prototype.drawControl.apply(this, arguments);}else{switch ( element_id )
{case"user_rate_expected":case"user_rate_get_expect_link":case"user_rate_no_expect":$("#"+this.tr_expected_stars_id).hide();break;default:return EntityTemplate.superClass.prototype.drawControl.apply(this, arguments);break;}}}
EntityTemplate.prototype.drawControlElement=function(name)
{if (!name)
return'';switch( name )
{case"rate_layer_header":html='<div style="top:73px;left:111px;padding:9px 15px 10px 15px;" class="wrate rate_layer" id="'+this.rate_layer_id+'">';html+='<div style="float:right;margin:5px 27px 0px -12px;" class="rgrey pb2" id="'+this.user_rate_anonymous_id+'"></div>';html+='<table><tr class="entity_tpl et_user" id="'+this.rate_layer_stars_id+'" ></tr></table>';return html;break;case"interest_layer_header":html='<div class="wrate interest_layer" style="top:105px;left:130px;padding:2px 9px 12px 9px;" id="'+this.interest_layer_id+'">';return html;break;case"expected_stars":html='<tr id="'+this.tr_expected_stars_id+'" class="entity_tpl et_expect">';html+='<th style="height:31px;">Прогнозная оценка';html+='<a class="count" style="float:left;display:none;" id="'+this.user_refferents_amount_id+'"></a>';html+='<span id="'+this.user_refferents_amount_cross_id+'" style="display:none"></span>';html+='</th>';html+='<td><div style="margin-right:5px" id="'+this.user_rate_expected_block+'"></div></td>';html+='<td><div style="float:left;margin-right:5px" id="'+this.user_rate_expected_block_stars+'"></div></td>';html+='</tr>';return html;break;case"expect_feedback":return'<tr style="height:10px;"><td colspan="2" >&nbsp;</td><td style="padding-bottom:2px;"><span><span id="'+this.expect_feedback_id+'" style="display:none"></span></span></td></tr>';break;case"average_stars":html='<tr id="'+this.tr_average_stars_id+'" class="entity_tpl">';html+='<th style="height:31px;">Средняя оценка';html+='<a style="display:none;float:left" class="count" id="'+this.rates_amount_id+'"></a> <span style="display:none;float:left" class="rgrey" id="'+this.rates_amount_none_id+'"></span>';html+='</th>';html+='<td><div style="display:none;margin-right:5px" id="'+this.rate_average_block_digits+'"></div></td>';html+='<td><div class="tltpshow" style="float:left;margin-right:5px"id='+this.rate_average_block_id+'></div></td>';html+='</tr>';return html;break;case"user_rate":html='<tr id="'+this.tr_user_rate_block_id+'" class="entity_tpl et_user">';html+='<th class="big" style="height:25px;">Моя оценка</th>';html+='<td><div style="display:none;margin-right:5px;text-align:right;" id="'+this.user_rate_digits_id+'"></div></td>';html+='<td class="et_stars"><div style="float:left;margin-right:5px;vertical-align: middle;white-space:nowrap;" id="'+this.user_rate_stars_id+'"></div>';html+='</td></tr>';return html;break;default:return EntityTemplate.superClass.prototype.drawControlElement.apply(this, arguments);break;}}
break;case'TravelTemplate':TravelTemplate.prototype.doSomeSpecial=function(user_rate)
{$("#"+this.user_rate_anonymous_id).hide();}
TravelTemplate.prototype.drawFeedback=function(user_rate)
{}
break;}}
var IntIntersectionTemplate=function(rate_index)
{IntIntersectionTemplate.superClass.apply(this, arguments);this.rate_other_value_id="rate_other_value_"+rate_index;this.img_wr_other_rate_expected_full=HOST_BASE+'img/wr_s_redfull.gif';this.rate_other_block_stars='rate_other_block_stars_'+rate_index;this.alias_other_id='alias_other_id_'+rate_index;}
var TVTemplate=function(rate_index)
{TVTemplate.superClass.apply(this, arguments);}
var PrintTemplate=function(rate_index)
{PrintTemplate.superClass.apply(this, arguments);this.user_rate_expected_text_id="user_rate_expected_text_id_"+rate_index;this.user_rate_average_text_id="user_rate_average_text_id_"+rate_index;}
var ExpectedAndAverageTemplate=function(rate_index)
{ExpectedAndAverageTemplate.superClass.apply(this, arguments);this.img_wr_user_rate_expected_half=HOST_BASE+'img/wr_s_grehalf_dark.gif';this.img_wr_user_rate_expected_full=HOST_BASE+'img/wr_s_grefull_dark.gif';this.img_wr_null=HOST_BASE+'img/wr_s_gra_dark.gif';this.img_wr_rate_average_half=HOST_BASE+'img/wr_s_ohalf_dark.gif';this.img_wr_rate_average_full=HOST_BASE+'img/wr_s_ofull_dark.gif';this.img_star_user=HOST_BASE+'img/wr_s_orfull_dark.gif';this.img_star_none=HOST_BASE+'img/wr_s_gra_dark.gif';}
var ExpectedOrAverageTemplate=function(rate_index)
{ExpectedOrAverageTemplate.superClass.apply(this, arguments);this.widget_hided=true;this.tr_button_expand_id="button_expand_"+rate_index;this.button_expand_id='button_expand_id_'+rate_index;this.show_rate_change_icon=true;}
var MyRateTemplate=function(rate_index)
{MyRateTemplate.superClass.apply(this, arguments);}
var TravelTemplate=function(rate_index)
{TravelTemplate.superClass.apply(this, arguments);}
var StringIntersectionTemplate=function(rate_index)
{StringIntersectionTemplate.superClass.apply(this, arguments);this.other_rate_name_id='other_rate_name_'+rate_index;}
var PhotoTemplate=function(rate_index)
{PhotoTemplate.superClass.apply(this, arguments);}
var RatingRateTemplate=function(rate_index)
{RatingRateTemplate.superClass.apply(this, arguments);this.show_rate_change_icon=true;}
var CompactRatingRateTemplate=function(rate_index)
{CompactRatingRateTemplate.superClass.apply(this, arguments);}
var EntityTemplate=function(rate_index)
{EntityTemplate.superClass.apply(this, arguments);this.show_user_rate_digits=true;this.img_star_user=HOST_BASE+'img/wr_s_big_redfull.gif';this.img_star_user_none=HOST_BASE+'img/wr_s_big_redempty.gif';this.img_wr_user_rate_expected_half=HOST_BASE+'img/wr_s_big_greenhalf.gif';this.img_wr_user_rate_expected_full=HOST_BASE+'img/wr_s_big_greenfull.gif';this.img_wr_rate_average_half=HOST_BASE+'img/wr_s_big_orangehalf.gif';this.img_wr_rate_average_full=HOST_BASE+'img/wr_s_big_orangefull.gif';this.img_wr_null=HOST_BASE+'img/wr_s_big_grayempty.gif';this.img_wr_none=HOST_BASE+'img/wr_s_big_grayempty.gif';this.img_rate_null=HOST_BASE+"img/rate_null_big.gif";this.img_star_user_nomination=HOST_BASE+'img/wr_s_orfull.gif';this.img_star_user_nomination_none=HOST_BASE+'img/wr_user_none.gif';this.img_rate_null_nomination=HOST_BASE+"img/rate_null.gif";this.additional_star_class='bigstar';}
var JoinedTemplate=function(rate_index)
{JoinedTemplate.superClass.apply(this, arguments);this.expected_and_average_id='expected_and_average_id_'+rate_index;}
var Home2Template=function(rate_index)
{Home2Template.superClass.apply(this, arguments);}
var PersonTemplate=function(rate_index)
{PersonTemplate.superClass.apply(this, arguments);}
var ProductTemplate=function(rate_index)
{ProductTemplate.superClass.apply(this, arguments);}
var IntTemplate=function(rate_index)
{IntTemplate.superClass.apply(this, arguments);this.total_marks=10;var rate_names=new Array();rate_names[0]='Сбросить оценку';rate_names[1]='сильно негативно';rate_names[3]='слабо негативно';rate_names[5]='не интересует';rate_names[6]='слабо';rate_names[7]='средне';rate_names[8]='сильно';rate_names[10]='страстно';this.rate_names=rate_names;this.no_display_digits=true;this.img_star_user=HOST_BASE+'img/wr_s_orfull.gif';this.img_star_none=HOST_BASE+'img/wr_s_gra.gif';this.additional_block_id='rateIntAdditionalLink_'+rate_index;}
var EvaluateRateTemplate=function(rate_index)
{EvaluateRateTemplate.superClass.apply(this, arguments);}
var EvaluateTravelTemplate=function(rate_index)
{EvaluateTravelTemplate.superClass.apply(this, arguments);}
var EvaluateIntRateTemplate=function(rate_index)
{EvaluateIntRateTemplate.superClass.apply(this, arguments);this.total_marks=10;var rate_names=new Array();rate_names[0]='Сбросить оценку';rate_names[1]='сильно негативно';rate_names[3]='слабо негативно';rate_names[5]='не интересует';rate_names[6]='слабо';rate_names[7]='средне';rate_names[8]='сильно';rate_names[10]='страстно';this.rate_names=rate_names;this.no_display_digits=true;}
var PoemTemplate=function(rate_index)
{PoemTemplate.superClass.apply(this, arguments);}