function Reply(n,t){$("#CommentForm")&&(CancelReply($("input#parentId").val()),$("input#parentId").val(n),$("a#closeLink").show(),comment.text=$("textarea[name=Text]").val(),comment.inserted=t+", ",$("textarea[name=Text]").val(comment.inserted+comment.text),$("textarea[name=Text]").focus(),$("#comment-for").text($("#comment-for").data("text").replace("{0}",t)),$("#comment-for").show())}function CancelReply(){$("#CommentForm")&&($("textarea[name=Text]").val()==comment.inserted||$("textarea[name=Text]").val()==comment.inserted+comment.text?($("textarea[name=Text]").val(comment.text),$("textarea[name=Text]").focus()):($("textarea[name=Text]").val($("textarea[name=Text]").val().replace(comment.inserted,"")),$("textarea[name=Text]").focus()),$("input#parentId").val("00000000-0000-0000-0000-000000000000"),$("a#closeLink").hide(),$("#comment-for").text(""),$("#comment-for").hide())}function GetDeclension(n,t){var i=t.split(", "),r;if(n=n%100,n>=11&&n<=19)return i[2];r=n%10;switch(r){case 1:return i[0];case 2:case 3:case 4:return i[1];default:return i[2]}}function UpdateCommentsCount(){var n=$(".comment-item").length;$("#comments-count").length&&$("#comments-count").text(n);$(".banner-news__comments").length&&$(".banner-news__comments").text(n+" "+GetDeclension(n,$(".banner-news__comments").data("words")))}function UpdateFollowerssCount(){$(".social-button__label").length&&$(".social-button__label").each(function(n,t){var i=$(t).prev(".social-button__quantity").text().replace(" ","");$(t).text(GetDeclension(i,$(t).data("words")))});$(".social-account__subscribers").length&&$(".social-account__subscribers>p").each(function(n,t){var i=$(t).prev("span").text().replace(" ","");$(t).text(GetDeclension(i,$(t).data("words")))})}function UpdateShares(){var n={vk:"vk",fb:"fb",twi:"tw",gplus:"gp",odkl:"ok"};$("ul.share42init.list-share").each(function(t,i){var r=$(i).find("li>a[data-count]");r.each(function(t,i){var r=$(i).data("count");$(i).attr("class","link-"+n[r]);$(i).find("use").attr("xlink:href","#icon-"+n[r])})})}var comment={};$(document).ready(function(){UpdateCommentsCount();UpdateFollowerssCount();UpdateShares()})