function initEventsOnResize(){$(window).resize(function(){$(".header_container").css({height:$(".header").outerHeight()});$("body").css({paddingBottom:$("footer").outerHeight()-1})}).trigger("resize")}function initEventsOnClick(){$('[data-control="select"] ._value').text($(this).siblings("select").val());$('[data-control="select"] select').on("change",function(){$(this).siblings(".select__value").find("._value").text(this.value)});$(".action_follow").on("click",function(){$(this).toggleClass("active")});if(!isMobile)$("body").on("click",'a[href^="tel:"]',function(){$(this).attr("href",$(this).attr("href").replace(/^tel:/,"callto:"))})}function initClipboard(){var n=new Clipboard(".copy_code",{text:function(n){return n.previousElementSibling.innerHTML}});n.on("success",function(n){n.trigger.innerHTML='<i class="icon icon--check_thin"><\/i> Copied';n.clearSelection()})}function initTabs(){$("._go_to_tab").on("shown.bs.tab",function(){var n=$(this).attr("href");$('.nav-tabs a[href="'+n+'"]').tab("show")});var n=document.location.toString(),t="#tab_";n.match("#")&&$('.nav-tabs a[href="#'+n.split(t)[1]+'"]').tab("show");$(".nav-tabs a").on("shown.bs.tab",function(n){window.location.hash=t+n.target.hash.split("#")[1]})}function initHeader(){$(".btn_menu").on("click",function(n){n.preventDefault();n.stopPropagation();$("body").addClass("body--menu_opened");$(".sidebar_menu").addClass("sidebar_menu--open")});$(".sidebar_menu, .header_search").on("click",function(n){n.stopPropagation()});$("body, .btn_close_menu, .menu_overlay, .btn_close_header").on("click",function(){$("body").removeClass("body--menu_opened body--search_showed");$(".sidebar_menu").removeClass("sidebar_menu--open");$(".header_search").removeClass("header_search--show")});$(".btn_open_search").on("click",function(n){n.preventDefault();n.stopPropagation();$("body").addClass("body--search_showed");$(".header_search").addClass("header_search--show")})}function initSmoothScroll(){$(".smooth_scroll").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var n=$(this.hash);if(n=n.length?n:$("[name="+this.hash.slice(1)+"]"),n.length)return $("html, body").animate({scrollTop:n.offset().top},1e3),!1}})}function initAffix(){$(".btn_affix").affix({offset:{top:function(){return this.top=$(".site_nav").offset().top-$(".header_container").outerHeight()}}});$(window).resize(function(){$(".btn_affix").css({right:$(".header .container").offset().left+15})}).trigger("resize")}var wH=$(window).height(),wW=$(window).width(),ua=navigator.userAgent,touchendOrClick=ua.match(/iPad|iPhone|iPad/i)?"touchend":"click",deviceAgent=navigator.userAgent.toLowerCase(),isMobile=deviceAgent.match(/(iphone|ipod|ipad)/),is_touch_device="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;FastClick.attach(document.body);$(document).ready(function(){initEventsOnResize();initEventsOnClick();initClipboard();initHeader();initSmoothScroll();initAffix()});$(function(){$("body").on("click touchstart",function(n){$("[data-toggle=popover]").each(function(){$(this).is(n.target)||$(this).has(n.target).length!==0||$("[data-toggle=popover]").has(n.target).length!==0||$(this).popover("hide")})})})