function getCssMediaDesktop(){return $(".iscssmedia_desktop").is(":visible")}function getCssMediaNetbook(){return $(".iscssmedia_netbook").is(":visible")}function getCssMediaTablet(){return $(".iscssmedia_tablet").is(":visible")}function getCssMediaPhoneLs(){return $(".iscssmedia_phone-ls").is(":visible")}function getCssMediaPhone(){return $(".iscssmedia_phone").is(":visible")}function getCssMediaPhoneSm(){return $(".iscssmedia_phone-sm").is(":visible")}function initPosition(n,t,i,r){return{a:{left:0,top:0,width:n,height:t},b:{left:n,top:0,width:n,height:t},c:{left:i,top:0,width:n,height:t},d:{left:n*3,top:0,width:n,height:t},e:{left:0,top:t,width:n,height:t},f:{left:n,top:t,width:n,height:t},g:{left:i,top:t,width:n,height:t},h:{left:n*3,top:t,width:n,height:t},A:{left:0,top:0,width:i,height:r},B:{left:n,top:0,width:i,height:r},C:{left:i,top:0,width:i,height:r}}}function mousenotlongfunc(){$("#"+Object.keys(moveControl)[0]).is(":hover")&&$("#"+Object.keys(moveControl)[0]).trigger("mousemove",[!0])}var position;(function(){$("#clergy-deanery").on("change",function(){var n=$(this).val();$.post("/Priests/GetTempleForDeanery?deaneryId="+n,function(n){$("#clergy-temple").html(n)})});$("#clergy-button-clear").on("click",function(){$("#clergy-deanery").val(0);$("#clergy-temple").val(0);var n=$(this).closest("#clergy-form")})})();$(document).ready(function(){jQuery.validator.methods.date=function(){return!0};$.datetimepicker.setLocale("ru");$(".dateTimePicker").datetimepicker({format:"d.m.Y H:i",lang:"ru",step:5,dayOfWeekStart:1,defaultDate:new Date,startDate:new Date,yearStart:2011});$(".popup-galleryImg").magnificPopup({delegate:"a",type:"image",mainClass:"mfp-img-mobile",gallery:{enabled:!0,navigateByImgClick:!0,tCounter:'<span class="mfp-counter-inner">Фотография %curr% из %total%<\/span>',preload:[0,1]},image:{tError:'<a href="%url%">The image #%curr%<\/a> could not be loaded.',titleSrc:function(n){var t=n.el.attr("title");return t!=undefined?t:""}}});$("#mobile-btn").on("click",function(){$("#mobile-search-input").val()!=""?($(".mobile__wrap-search-block").removeClass("hide"),$(this).addClass("mobile__search-btn_cross")):$(this).hasClass("mobile__search-btn_cross")?($(this).removeClass("mobile__search-btn_cross"),$(".mobile__wrap-search-block").addClass("hide")):($(this).addClass("mobile__search-btn_cross"),$(".mobile__wrap-search-block").removeClass("hide"))});$(".mobile__burger").on("click",function(){$("body").addClass("body-no-scroll");$(".header__menu").removeClass("hidden-xs");$(".header__menu").removeClass("hidden-sm");$(".header__mobile-close-btn").removeClass("hidden")});$(".header__mobile-close-btn").on("click",function(){$("body").removeClass("body-no-scroll");$(".header__menu").addClass("hidden-xs");$(".header__menu").addClass("hidden-sm");$(this).addClass("hidden")});$(".jsbxSliderMobileSlider").bxSlider({controls:!0,pager:!1,infiniteLoop:!0,autoStart:!0,auto:!0,pause:3500});$("[data-mfp-src]").on("click",function(){var n=$(this).data(),t;return console.log(n),t=$('[data-identifier="'+n.mfpSrc+'"]'),$.magnificPopup.open({items:{src:t},type:"inline"}),!1});$(".popup-with-form").magnificPopup({type:"inline",preloader:!1,focus:"#questionModel_Name",callbacks:{beforeOpen:function(){this.st.focus=$(window).width()<700?!1:"#questionModel_Name"}}});$(".comment-with-form").magnificPopup({type:"inline",preloader:!1,focus:"#questionModel_Name",callbacks:{beforeOpen:function(){this.st.focus=$(window).width()<700?!1:"#questionModel_Name"}}});$("#question-form").on("submit",function(n){var i=$(".field-validation-error",$(this)),t=$(this);i.length==0&&(n.preventDefault(),$.post("/Home/QuestionBishop",$(this).serialize(),function(n){if(n.err){console.log(n.message);var i=$("#error-div");i.show();i.text("Произошла ошибка. Перезагрузите страницу и попробуйте ещё раз")}else $("input",t).val(""),$("textarea",t).val(""),$.magnificPopup.close()}))});$("#comment-form").on("submit",function(n){var r=$(".field-validation-error",$(this)),t=$(this),i;r.length==0&&(n.preventDefault(),i=$(this).serialize(),$.post("/Comments/AddComment",$(this).serialize(),function(n){console.log("args="+i);n.err*!0?alert(n.message):(alert(n.message),$("input",t).val(""),$("textarea",t).val(""),$.magnificPopup.close())}));window.location.reload()});$("#deanery-button-clear").on("click",function(){$("#deanery-select").val(0);var n=$(this).closest("#deanery-form")});$(window).load(function(){function i(){var n=$("#bishop-img"),t=$("#bishop-block"),i=n.data("heightoriginal"),r=n.data("widthoriginal"),u=i/r,f=t.width(),e=f*u;n.css({height:e})}function u(){var i=$("#patriarh-img"),t;if(i.data("flagexecute")&&!($(window).width()<767)&&!$("body").hasClass("body-table-full")){var u=i.data("heightoriginal"),e=i.data("widthoriginal"),r=u*n/e;(r<=f||$("#true-priest").width()>n||$("#true-priest").width()<n)&&(t=$("#true-priest").parent().width(),n>(t-n)*2.8&&(n=t*.6),$("#true-priest-ornament").height()>r,i.css({"max-height":r,width:n}),$("#true-priest").css({"max-height":r,width:n,"flex-basis":n}),$("#true-priest-ornament").css({width:t-n,"flex-basis":t-n}))}}var t=$("#bishop-img"),e=t.height(),o=t.width();i();var r=$("#patriarh-img"),f=r.height(),n=r.width();u();$(window).on("resize",function(){i();u()})})});Share={vkontakte:function(n,t,i,r){url="https://vk.com/share.php?";url+="url="+encodeURIComponent(n);url+="&title="+encodeURIComponent(t);url+="&description="+encodeURIComponent(r);url+="&image="+encodeURIComponent(i);url+="&noparse=true";Share.popup(url)},odnoklassniki:function(n,t){url="http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1";url+="&st.comments="+encodeURIComponent(t);url+="&st._surl="+encodeURIComponent(n);Share.popup(url)},facebook:function(n,t,i,r){url="http://www.facebook.com/sharer.php?s=100";url+="&p[title]="+encodeURIComponent(t);url+="&p[summary]="+encodeURIComponent(r);url+="&p[url]="+encodeURIComponent(n);url+="&p[images][0]="+encodeURIComponent(i);Share.popup(url)},twitter:function(n,t){url="http://twitter.com/share?";url+="text="+encodeURIComponent(t);url+="&url="+encodeURIComponent(n);url+="&counturl="+encodeURIComponent(n);Share.popup(url)},telegram:function(n,t){url="https://telegram.me/share/url?";url+="url="+encodeURIComponent(n);url+="&text="+encodeURIComponent(t);Share.popup(url)},mailru:function(n,t,i,r){url="http://connect.mail.ru/share?";url+="url="+encodeURIComponent(n);url+="&title="+encodeURIComponent(t);url+="&description="+encodeURIComponent(r);url+="&imageurl="+encodeURIComponent(i);Share.popup(url)},viber:function(n,t){url="viber://forward?text=";url+=encodeURIComponent(t+" "+n);Share.popup(url)},whatsapp:function(n,t){url="whatsapp://send?text=";url+=encodeURIComponent(t+" "+n);Share.popup(url)},popup:function(n){window.open(n,"","toolbar=0,status=0,width=626,height=436")}};var layouts={L:{rotation:{A:"c",c:"d",d:"h",h:"g",g:"A"},cells:{c:{layout:"C",actions:{c:"B",g:"e",A:"a"}},d:{layout:"R",actions:{d:"C",c:"b",g:"e",h:"f",A:"a"}},g:{layout:"C",actions:{g:"B",c:"a",A:"e"}},h:{layout:"R",actions:{h:"C",c:"a",d:"b",g:"f",A:"e"}}}},C:{rotation:{a:"B",B:"d",d:"h",h:"e",e:"a"},cells:{a:{layout:"L",actions:{a:"A",e:"g",B:"c"}},d:{layout:"R",actions:{d:"C",h:"f",B:"b"}},e:{layout:"L",actions:{e:"A",a:"c",B:"g"}},h:{layout:"R",actions:{h:"C",d:"b",B:"f"}}}},R:{rotation:{e:"a",f:"e",C:"f",b:"C",a:"b"},cells:{a:{layout:"L",actions:{a:"A",b:"c",e:"g",f:"h",C:"d"}},b:{layout:"C",actions:{b:"B",f:"h",C:"d"}},e:{layout:"L",actions:{e:"A",a:"c",b:"d",f:"g",C:"h"}},f:{layout:"C",actions:{f:"B",b:"d",C:"h"}}}}},currentLayout="",currentStates,random=Math.round(.5+Math.random()*5);random==1&&(currentLayout="L",currentStates=["A","c","d","h","g"]);random==2&&(currentLayout="L",currentStates=["c","A","d","h","g"]);random==3&&(currentLayout="C",currentStates=["a","d","B","h","e"]);random==4&&(currentLayout="R",currentStates=["a","e","b","C","f"]);random==5&&(currentLayout="R",currentStates=["a","e","b","f","C"]);var parentWidth=$(".vertushka").width(),elemWidth=parentWidth/4,elemHeight=200,largeElemWidth=elemWidth*2,largeElemHeigth=elemHeight*2;position=initPosition(elemWidth,elemHeight,largeElemWidth,largeElemHeigth);$(window).on("resize",function(){var n=$(".vertushka").width();elemWidth=n/4;elemHeight=200;largeElemWidth=elemWidth*2;largeElemHeigth=elemHeight*2;position=initPosition(elemWidth,elemHeight,largeElemWidth,largeElemHeigth)});var animations=[],moveControl={},vertushkaTimer,ANIMATION_MANU=400,ANIMATION_AUTO=800,MOVE_CONTROL_DELAY=400,ROTATION_INTERVAL=9e3;$(document).ready(function(){$(function(){$(".vertushka__item").each(function(n){$(".vertushka__item").each(function(n){$(this).attr("id","nav-fragment-"+n).attr("data-pos",currentStates[n])});n==random-1?$(this).addClass("vertushka__item_big").find(".vertushka__text").addClass("vertushka__text_big"):$(this).removeClass("vertushka__item_big").find(".vertushka__text").removeClass("vertushka__text_big")})});$(".vertushka__item").mousemove(function(n,t,i){var e,o,u,r,f;if(getCssMediaDesktop()){if(!t)if(moveControl[n.currentTarget.id]){if(!(moveControl[n.currentTarget.id]+MOVE_CONTROL_DELAY<n.timeStamp)){e=moveControl[n.currentTarget.id];moveControl={};moveControl[n.currentTarget.id]=e;o=window.setTimeout(window.mousenotlongfunc,MOVE_CONTROL_DELAY+moveControl[n.currentTarget.id]-n.timeStamp);return}}else{moveControl[n.currentTarget.id]=n.timeStamp;return}if(animations.length||(u=layouts[currentLayout].cells[$(this).attr("data-pos")],u==undefined))return!1;currentLayout=u.layout;for(oldPos in u.actions)r=u.actions[oldPos],r=="A"||r=="B"||r=="C"?(animations.push("Grows"+oldPos),f=i?10:ANIMATION_MANU,$(".vertushka__item"),$(".vertushka__item[data-pos="+oldPos+"]").animate(position[r],f,function(){$(".vertushka__item[data-pos="+oldPos+"]");animations.pop()}),animations.push("GrowsImage"+oldPos),animations.pop(),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__text").addClass("vertushka__text_big"),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__b-title").css("display","block"),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__b-subtitle").css("display","block"),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__b-author").css("display","block"),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__s-title").hide(),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__s-subtitle").hide()):oldPos=="A"||oldPos=="B"||oldPos=="C"?(animations.push("shrink"+oldPos),$(".vertushka__item[data-pos="+oldPos+"]").animate(position[r],f,function(){animations.pop()}),$(this).hasClass("vertushka__item_big")||(animations.push("shrinkImage"+oldPos),animations.pop()),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__text").removeClass("vertushka__text_big"),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__b-title").hide(),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__b-subtitle").hide(),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__b-author").hide(),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__s-title").css("display","block"),$(".vertushka__item[data-pos="+oldPos+"] .vertushka__s-subtitle").css("display","block")):(animations.push("moving"+oldPos),$(".vertushka__item[data-pos="+oldPos+"]").animate(position[r],f,function(){animations.pop()})),$(".vertushka__item[data-pos="+oldPos+"]").attr("data-pos",r);$(".vertushka__item").removeClass("vertushka__item_big")}});getCssMediaPhoneLs()&&$(".vertushka__item").hover(function(){$(".vertushka__s-title, .vertushka__s-subtitle",this).hide();$(".vertushka__b-title, .vertushka__b-subtitle, .vertushka__b-author, .vertushka__b-anons",this).css("display","block")},function(){$(".vertushka__s-title, .vertushka__s-subtitle",this).css("display","block");$(".vertushka__b-title, .vertushka__b-subtitle, .vertushka__b-author, .vertushka__b-anons",this).hide()})})