function GlobalizeDatepicker(){$.validator.methods.date=function(n,t){return this.optional(t)||moment(n,"DD.MM.YYYY",!0).isValid()}}function SetMarginTopForLeftMenu(){$(".sidebar-nav-fixed.affix").css("margin-top",(window.innerHeight-$(".sidebar-nav-fixed.affix").height()-$(".navbar.navbar-inverse.navbar-fixed-top").height())/2)}function storageTest(n){var t="test";try{return n.setItem(t,t),n.removeItem(t),!0}catch(i){return!1}}function storageSet(n,t,i){storageTest(n)&&n.setItem(t,i)}function storageGet(n,t,i){var r=null;return storageTest(n)&&(r=n.getItem(t)),r===null&&i!=undefined&&(r=i),r}function sessionStorageSet(n,t){storageSet(sessionStorage,n,t)}function sessionStorageGet(n,t){return storageGet(sessionStorage,n,t)}function getPageNumber(){var n=$.parseJSON(sessionStorageGet("pageSettings",JSON.stringify({})));return Number(n[document.URL]!=undefined?n[document.URL]:"1")}function savePageNumber(n){var t={};t[document.URL]=n;sessionStorageSet("pageSettings",JSON.stringify(t))}function alertifyResult(n,t,i){n.Success?(alertify.success(n.Info),t!=undefined&&t()):(alertify.error(n.Info),i!=undefined&&i())}function handleError(){this.src="/Content/img/logo_gray.png";$(this).css("object-fit","contain")}function sleep(n){var i=new Date,t=null;do t=new Date;while(t-i<n)}$.fn.select2.defaults.set("language","ru");GlobalizeDatepicker();$(window).resize(function(){SetMarginTopForLeftMenu()});$(function(){SetMarginTopForLeftMenu();$(".sidebar-nav-fixed.affix").hover(function(){$(".sidebar-nav-fixed.affix").stop().animate({left:"0px"})},function(){$(".sidebar-nav-fixed.affix").stop().animate({left:"-235px"})})});$(document).on("keypress","form",function(n){var t,i;if(n.which==13&&(t=$(n.target),t.is("textarea")&&(i=t.val(),t.val(i+"\n")),!t.is("textarea")&&!t.is(":button, :submit")))return!1});$(document).ready(function(){$("img").on("error",handleError)});$.ajaxSetup({cache:!1,data:{t:(new Date).getTime()}});var updateRightContainerHeight=function(){$("#rightContainer").css("height",Math.max($("#centerContainer").outerHeight(!1),$("#leftContainer").outerHeight(!1)));var n=0;$("#rightContainer").children().not(".documents-banner").each(function(){n+=$(this).outerHeight(!0)});$("#rightContainer .documents-banner").css("height",document.getElementById("rightContainer").clientHeight-n-15);$("#rightContainer #news").css("height",document.getElementById("rightContainer").clientHeight-n-135);try{jScrollapi.reinitialise()}catch(t){}}