$(function(){function r(){$("#isDevice").is(":hidden")?($("#calendar_wrap").css("height",""),$("#news_block").css("height",""),$("#claim_wrap").css("height",""),$("#news_wrap").css("height","")):(setTimeout(u,0),setTimeout(f,0))}function u(){var n,t;window.innerWidth>991&&(n=$("#tabs_nav").height(),$("#tabs_content").css("height",n),$("#calendar_wrap").css("height",n),t=$("#districts_block").outerHeight(),$("#carousel_block").css("height",t),$("#map_block").css("height",t))}function f(){var n,t;window.innerWidth>991?($("#news_block").css("height",""),$("#claim_wrap").css("height",""),$("#news_wrap").css("height",""),n=$("#news_block").parent().outerHeight(),$("#news_block").css("height",n),$("#claim_wrap").css("height",n),t=n-($("#branches_wrap").outerHeight()+20),$("#news_wrap").css("height",t)):($("#news_block").css("height",""),$("#claim_wrap").css("height",""),$("#news_wrap").css("height",""))}function e(){$("#fs_btn span").removeClass("active");var t=n.fs;$('#fs_btn span[id="'+t+'"]').addClass("active");$("#cs_btn span").removeClass("active");t=n.cs;$('#cs_btn span[id="'+t+'"]').addClass("active");t=n.font;$('#font_btn span[id="'+t+'"]').addClass("active");t=n.lead;$('#lead_btn span[id="'+t+'"]').addClass("active")}function i(){$("#special_fs").remove();$("#special_cs").remove();$("#special_font").remove();$("#special_lead").remove();$("head").append('<link id="special_fs" href="'+t+"Content/Special/"+n.fs+'.css" rel="stylesheet" />');$("head").append('<link id="special_cs" href="'+t+"Content/Special/"+n.cs+'.css" rel="stylesheet" />');$("head").append('<link id="special_font" href="'+t+"Content/Special/"+n.font+'.css" rel="stylesheet" />');$("head").append('<link id="special_lead" href="'+t+"Content/Special/"+n.lead+'.css" rel="stylesheet" />');$("#topmenu_homelink img").css("display","none");$("#homepage_"+n.cs+"").css("display","block");$("#pvision_icon_wrap img").css("display","none");$("#pvision_icon_wrap img#"+n.cs+"").css("display","block");$("#branches_wrap img").css("display","none");$("#branches_wrap img."+n.cs+"").css("display","block");$("#carousel_block img.arroy").css("display","none");$("#carousel_block img.arroy."+n.cs+"").css("display","block");$.cookie("displayConfig",$.toJSON(n),{path:"/",expires:100});setTimeout(r,0)}var n,t;$("#datetimepicker_block").datetimepicker({inline:!0,locale:"ru",viewMode:"days",format:"DD/MM/YYYY",dayViewHeaderFormat:"MMMM YY"});$("#content_row2").imagesLoaded(function(){setTimeout(r,0)});$(window).resize(function(){r()});n={fs:"fs_small",cs:"cs_white",font:"font_default",lead:"lead_small"};t=$("#root_path").data("val");$("#pvision_icon_wrap").click(function(){$.cookie("version")!=null&&$.cookie("version")=="special"?$.cookie("version","common",{path:"/",expires:100}):$.cookie("version","special",{path:"/",expires:100});location.reload()});$.cookie("version")=="special"&&($.cookie("displayConfig")!=null&&(n=$.evalJSON($.cookie("displayConfig"))),e(),i());$("#fs_btn span").bind("click",function(){$("#fs_btn .active").removeClass("active");$(this).addClass("active");n.fs=$(this).attr("ID");i()});$("#cs_btn span").bind("click",function(){$("#cs_btn .active").removeClass("active");$(this).addClass("active");n.cs=$(this).attr("ID");i()});$("#font_btn span").bind("click",function(){$("#font_btn .active").removeClass("active");$(this).addClass("active");n.font=$(this).attr("ID");i()});$("#lead_btn span").bind("click",function(){$("#lead_btn .active").removeClass("active");$(this).addClass("active");n.lead=$(this).attr("ID");i()})})