window.isMobile=!1;if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){window.isMobile=!0}
function t_throttle(fn,threshhold,scope){var last;var deferTimer;threshhold||(threshhold=250);return function(){var context=scope||this;var now=+new Date();var args=arguments;if(last&&now<last+threshhold){clearTimeout(deferTimer);deferTimer=setTimeout(function(){last=now;fn.apply(context,args)},threshhold)}else{last=now;fn.apply(context,args)}}}
function t830_init(recid){var rec=document.getElementById('rec'+recid);var allRec=document.getElementById('allrecords');if(!allRec||!rec)return;var panel=rec.querySelector('.t830__panel');var overlay=rec.querySelector('.t830m__overlay');var menu=rec.querySelector('.t830m');var submenu=rec.querySelector('.t830m__submenu');var burger=rec.querySelector('.t830__side .t830__burger');var menuItemList=rec.querySelectorAll('.t830m__list-title a');var submenuItemList=rec.querySelectorAll('.t830m__submenu-item a');t830_initMenu(rec,menu,burger,overlay);t830_removePadding(rec,allRec);t830_calcCol(rec,menu,allRec,!1);t_onFuncLoad('t_menu__highlightActiveLinks',function(){t_menu__highlightActiveLinks('.t830m__list a');t830_openSubmenu(rec)});t830_hoverShowMenu(rec,menu,panel,overlay,burger);window.addEventListener('resize',function(){t830_calcCol(rec,menu,allRec,!0);t830_removePadding(rec,allRec);if(menu&&menu.classList.contains('t830m_close')&&window.innerWidth>1499){if(overlay)overlay.classList.remove('t830m__menu_show')}});if(submenu&&submenu.classList.contains('t830m__submenu_close')){t830_toggleMenu(rec)}
if(window.innerWidth>1199){t830_scrollSideMenu(rec)}
var isHashNotEmpty=window.location.hash.length!==0;Array.prototype.forEach.call(menuItemList,function(menuItem){menuItem.addEventListener('click',function(){if(isHashNotEmpty){Array.prototype.forEach.call(menuItemList,function(menuEl){menuEl.classList.remove('t-active')});menuItem.classList.add('t-active')}})});Array.prototype.forEach.call(submenuItemList,function(submenuItem){submenuItem.addEventListener('click',function(){if(isHashNotEmpty){Array.prototype.forEach.call(submenuItemList,function(submenuEl){submenuEl.classList.remove('t-active')});submenuItem.classList.add('t-active')}})});t_onFuncLoad('t_menu__findAnchorLinks',function(){t_menu__findAnchorLinks(recid,'.t830m__list a')})}
function t830_calcCol(rec,menu,allrecords,isResized){if(window.innerWidth<=1199||!menu||window.getComputedStyle(rec).display==='none')return;var label=document.querySelector('.t-tildalabel');if(menu.classList.contains('t830m_open')){if(allrecords)allrecords.classList.add('t830__allrecords_padd-small');if(label)label.classList.add('t830__t-tildalabel_padd-small')}else{if(allrecords)allrecords.classList.add('t830__allrecords_padd');if(label)label.classList.add('t830__t-tildalabel_padd')}
if(isResized)return;var event=document.createEvent('Event');event.initEvent('allRecPaddingInit',!0,!0);if(allrecords)allrecords.dispatchEvent(event)}
function t830_toggleMenu(rec){var titleList=rec.querySelectorAll('.t830m__list-title_toggle');Array.prototype.forEach.call(titleList,function(listTitle){listTitle.addEventListener('click',function(){var submenu=listTitle.nextElementSibling;var textTitle=listTitle.querySelector('.t830m__list-title-text');t830_slideToggle(submenu);if(textTitle)textTitle.classList.toggle('t830m__list-title-text_opacity');if(textTitle)textTitle.classList.toggle('t-menu__link-item')})})}
function t830_openSubmenu(rec){var activeLink=rec.querySelector('.t830m__submenu-item a.t-active');var submenu=activeLink?activeLink.closest('.t830m__submenu'):null;if(submenu)submenu.style.display='block'}
function t830_hoverShowMenu(rec,menu,panel,overlay,burger){if(window.innerWidth<=1199||!panel||!panel.classList.contains('t830__panel_hover'))return;panel.addEventListener('mouseenter',function(){if(menu)menu.classList.add('t830m__menu_show');if(burger)burger.classList.add('t830__burger_open');if(overlay)overlay.classList.add('t830m__overlay_hover')});if(menu){menu.addEventListener('mouseleave',function(){menu.classList.remove('t830m__menu_show');if(burger)burger.classList.remove('t830__burger_open')})}
if(overlay){overlay.addEventListener('mouseenter',function(){overlay.classList.remove('t830m__overlay_hover');if(burger)burger.classList.remove('t830__burger_open');if(menu)menu.classList.remove('t830m__menu_show')})}
var menuLinks=menu.querySelectorAll('a');Array.prototype.forEach.call(menuLinks,function(link){link.addEventListener('click',function(){menu.classList.remove('t830m__menu_show');if(burger)burger.classList.remove('t830__burger_open')})});if(burger){burger.addEventListener('click',function(){if(burger.classList.contains('t830__burger_open')){t830_closeMenu(rec,menu,overlay);burger.classList.remove('t830__burger_open')}else{burger.classList.add('t830__burger_open');if(menu)menu.classList.add('t830m__menu_show');if(overlay)overlay.classList.add('t830m__overlay_hover')}})}}
function t830_showMenu(rec,menu,burger,overlay){var panel=rec.querySelector('.t830__panel');if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t830__body_menushowed');if(overlay)overlay.classList.add('t830m__menu_show');if(menu)menu.classList.add('t830m__menu_show');var closedMenuEls=rec.querySelectorAll('.t830m__overlay, .t830m__close, a[href*="#"]');closedMenuEls=Array.prototype.filter.call(closedMenuEls,function(el){return!(el.classList.contains('tooltipstered')||el.classList.contains('t794__tm-link')||el.classList.contains('t978__tm-link')||el.classList.contains('t966__tm-link'))});closedMenuEls.forEach(function(el){el.addEventListener('click',function(){t830_closeMenu(rec,menu,overlay);if(burger)burger.classList.remove('t830__burger_open')})});if(panel)panel.classList.add('t830__panel_close');var popupBg=document.querySelector('.t-site-search-popup__background');document.addEventListener('keydown',function(e){if(e.keyCode!==27||popupBg)return;if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');document.body.classList.remove('t830__body_menushowed');if(menu)menu.classList.remove('t830m__menu_show');if(burger)burger.classList.remove('t830__burger_open');if(overlay)overlay.classList.remove('t830m__menu_show')})}
function t830_closeMenu(rec,menu,overlay){var panel=rec.querySelector('.t830__panel');if(menu&&menu.classList.contains('t830m_open')&&window.innerWidth<1500){if(panel)panel.classList.remove('t830__panel_close')}
if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');document.body.classList.remove('t830__body_menushowed');if(menu)menu.classList.remove('t830m__menu_show');if(overlay)overlay.classList.remove('t830m__menu_show')}
function t830_initMenu(rec,menu,burger,overlay){if(!rec)return;var panel=rec.querySelector('.t830__panel');var menuContent=rec.querySelector('.t830__menu__content');if(typeof jQuery!=='undefined'){$('.t830').bind('clickedAnchorInTooltipMenu',function(){t830_closeMenu(rec,menu,overlay)})}else{var menuBlock=document.querySelector('.t830');if(menuBlock){menuBlock.addEventListener('clickedAnchorInTooltipMenu',function(){t830_closeMenu(rec,menu,overlay)})}}
if(!panel||!menuContent||!menu)return;if(panel.classList.contains('t830__panel_click')||(panel.classList.contains('t830__panel_hover')&&window.innerWidth<=1199)){menuContent.addEventListener('click',function(e){if(menu.classList.contains('t830m__menu_show')){if(burger)burger.classList.remove('t830__burger_open');t830_closeMenu(rec,menu,overlay)}else{if(burger)burger.classList.add('t830__burger_open');t830_showMenu(rec,menu,burger,overlay)}})}}
function t830_scrollSideMenu(rec){var container=rec?rec.querySelector('.t830m__container'):null;if(!container)return;var events=['scroll','wheel','DOMMouseScroll','mousewheel'];events.forEach(function(event){container.addEventListener(event,function(e){var searchResult=rec.querySelector('.t-site-search-dm');if(!searchResult){t830_stopScroll(container,e)}})})}
function t830_stopScroll(container,eventScroll){var scrollTop=container.scrollTop;var scrollHeight=container.scrollHeight;var height=container.offsetHeight;var delta=eventScroll.type==='DOMMouseScroll'?eventScroll.detail*-40:eventScroll.wheelDelta;var up=delta>0;var prevent=function(){eventScroll.stopPropagation();eventScroll.preventDefault();eventScroll.returnValue=!1;return!1};if(!up&&-delta>scrollHeight-height-scrollTop){container.scrollTo(0,scrollHeight);return prevent()}else if(up&&delta>scrollTop){container.scrollTo(0,0);return prevent()}}
function t830_removePadding(rec,allrecords){if(!allrecords||!rec||window.getComputedStyle(rec).display!=='none')return;allrecords.classList.remove('t830__allrecords_padd');allrecords.classList.remove('t830__allrecords_padd-small');allrecords.style.paddingLeft='';var label=document.querySelector('.t-tildalabel');if(label){label.classList.remove('t830__t-tildalabel_padd');label.classList.remove('t830__t-tildalabel_padd-small');label.style.paddingLeft=''}}
function t830_slideToggle(target){if(!target)return;if(target.getAttribute('data-slide')==='y')return;if(window.getComputedStyle(target).display==='none'){return t830_slideDown(target)}else{return t830_slideUp(target)}}
function t830_slideUp(target){if(!target)return;var step=target.offsetHeight/30;var difference=target.offsetHeight;target.style.overflow='hidden';target.setAttribute('data-slide','y');var timerID=setInterval(function(){difference-=step;target.style.height=difference+'px';if(difference<=0){target.style.height='';target.style.overflow='';target.style.display='none';target.removeAttribute('data-slide');clearInterval(timerID)}},10)}
function t830_slideDown(target){if(!target)return;target.style.display='';var currentDisplayValue=window.getComputedStyle(target).display;target.style.display=currentDisplayValue==='none'?'block':currentDisplayValue;var targetHeight=target.offsetHeight;target.style.height='0';target.style.overflow='hidden';target.setAttribute('data-slide','y');var step=targetHeight/30;var difference=0;var timerID=setInterval(function(){target.style.height=difference+'px';difference+=step;if(difference>=targetHeight){target.style.height='';target.style.overflow='';target.removeAttribute('data-slide');clearInterval(timerID)}},10)}
function t228__init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var menuBlock=rec.querySelector('.t228');var mobileMenu=rec.querySelector('.t228__mobile');var menuSubLinkItems=rec.querySelectorAll('.t-menusub__link-item');var rightBtn=rec.querySelector('.t228__right_buttons_but .t-btn');var mobileMenuPosition=mobileMenu?mobileMenu.style.position||window.getComputedStyle(mobileMenu).position:'';var mobileMenuDisplay=mobileMenu?mobileMenu.style.display||window.getComputedStyle(mobileMenu).display:'';var isFixedMobileMenu=mobileMenuPosition==='fixed'&&mobileMenuDisplay==='block';var overflowEvent=document.createEvent('Event');var noOverflowEvent=document.createEvent('Event');overflowEvent.initEvent('t228_overflow',!0,!0);noOverflowEvent.initEvent('t228_nooverflow',!0,!0);if(menuBlock){menuBlock.addEventListener('t228_overflow',function(){t228_checkOverflow(recid)});menuBlock.addEventListener('t228_nooverflow',function(){t228_checkNoOverflow(recid)})}
rec.addEventListener('click',function(e){var targetLink=e.target.closest('.t-menusub__target-link');if(targetLink&&window.isMobile&&window.innerWidth<=980){if(targetLink.classList.contains('t-menusub__target-link_active')){if(menuBlock)menuBlock.dispatchEvent(overflowEvent)}else{if(menuBlock)menuBlock.dispatchEvent(noOverflowEvent)}}
var currentLink=e.target.closest('.t-menu__link-item:not(.tooltipstered):not(.t-menusub__target-link):not(.t794__tm-link):not(.t966__tm-link):not(.t978__tm-link):not(.t978__menu-link)');if(currentLink&&mobileMenu&&isFixedMobileMenu)mobileMenu.click()});Array.prototype.forEach.call(menuSubLinkItems,function(linkItem){linkItem.addEventListener('click',function(){if(mobileMenu&&isFixedMobileMenu)mobileMenu.click()})});if(rightBtn){rightBtn.addEventListener('click',function(){if(mobileMenu&&isFixedMobileMenu)mobileMenu.click()})}
if(menuBlock){menuBlock.addEventListener('showME601a',function(){var menuLinks=rec.querySelectorAll('.t966__menu-link');Array.prototype.forEach.call(menuLinks,function(menuLink){menuLink.addEventListener('click',function(){if(mobileMenu&&isFixedMobileMenu)mobileMenu.click()})})})}}
function t228_checkOverflow(recid){var rec=document.getElementById('rec'+recid);var menu=rec?rec.querySelector('.t228'):null;if(!menu)return;var mobileContainer=document.querySelector('.t228__mobile_container');var mobileContainerHeight=t228_getFullHeight(mobileContainer);var windowHeight=document.documentElement.clientHeight;var menuPosition=menu.style.position||window.getComputedStyle(menu).position;if(menuPosition==='fixed'){menu.classList.add('t228__overflow');menu.style.setProperty('height',(windowHeight-mobileContainerHeight)+'px','important')}}
function t228_checkNoOverflow(recid){var rec=document.getElementById('rec'+recid);if(!rec)return!1;var menu=rec.querySelector('.t228');var menuPosition=menu?menu.style.position||window.getComputedStyle(menu).position:'';if(menuPosition==='fixed'){if(menu)menu.classList.remove('t228__overflow');if(menu)menu.style.height='auto'}}
function t228_setWidth(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var menuCenterSideList=rec.querySelectorAll('.t228__centerside');Array.prototype.forEach.call(menuCenterSideList,function(menuCenterSide){menuCenterSide.classList.remove('t228__centerside_hidden')});if(window.innerWidth<=980)return;var menuBlocks=rec.querySelectorAll('.t228');Array.prototype.forEach.call(menuBlocks,function(menu){var maxWidth;var centerWidth=0;var paddingWidth=40;var leftSide=menu.querySelector('.t228__leftside');var rightSide=menu.querySelector('.t228__rightside');var menuList=menu.querySelector('.t228__list');var mainContainer=menu.querySelector('.t228__maincontainer');var leftContainer=menu.querySelector('.t228__leftcontainer');var rightContainer=menu.querySelector('.t228__rightcontainer');var centerContainer=menu.querySelector('.t228__centercontainer');var centerContainerLi=centerContainer?centerContainer.querySelectorAll('li'):[];var leftContainerWidth=t228_getFullWidth(leftContainer);var rightContainerWidth=t228_getFullWidth(rightContainer);var mainContainerWidth=mainContainer?mainContainer.offsetWidth:0;var dataAlign=menu.getAttribute('data-menu-items-align');var isDataAlignCenter=dataAlign==='center'||dataAlign===null;maxWidth=leftContainerWidth>=rightContainerWidth?leftContainerWidth:rightContainerWidth;maxWidth=Math.ceil(maxWidth);Array.prototype.forEach.call(centerContainerLi,function(li){centerWidth+=t228_getFullWidth(li)});if(mainContainerWidth-(maxWidth*2+paddingWidth*2)>centerWidth+20){if(isDataAlignCenter){if(leftSide)leftSide.style.minWidth=maxWidth+'px';if(rightSide)rightSide.style.minWidth=maxWidth+'px'}}else{if(leftSide)leftSide.style.minWidth=maxWidth+'';if(rightSide)rightSide.style.minWidth=maxWidth+''}
if(menuList&&menuList.classList.contains('t228__list_hidden'))menuList.classList.remove('t228__list_hidden')})}
function t228_getFullWidth(el){if(!el)return 0;var marginLeft=el.style.marginLeft||window.getComputedStyle(el).marginLeft;var marginRight=el.style.marginRight||window.getComputedStyle(el).marginRight;marginLeft=parseInt(marginLeft,10)||0;marginRight=parseInt(marginRight,10)||0;return el.offsetWidth+marginLeft+marginRight}
function t228_getFullHeight(el){if(!el)return 0;var marginTop=el.style.marginTop||window.getComputedStyle(el).marginTop;var marginBottom=el.style.marginBottom||window.getComputedStyle(el).marginBottom;marginTop=parseInt(marginTop,10)||0;marginBottom=parseInt(marginBottom,10)||0;return el.offsetHeight+marginTop+marginBottom}
function t451_initMenu(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var burgerList=rec.querySelectorAll('.t451 .t-menuburger');var menu=rec.querySelector('.t451m');var menuBlock=rec.querySelector('.t451');var overlay=rec.querySelector('.t451m__overlay');var links=rec.querySelectorAll('.t-menu__link-item');Array.prototype.forEach.call(burgerList,function(burger){burger.addEventListener('click',function(e){e.preventDefault();t451_closeMenu(menu,overlay);t451_showMenu(menu,overlay);t451_checkSize(menu)})});if(menu){menu.click(function(e){t451_closeMenu(menu,overlay);t451_showMenu(menu,overlay);t451_checkSize(menu);e.preventDefault()})}
if(menuBlock){menuBlock.addEventListener('clickedAnchorInTooltipMenu',function(){t451_closeMenu(menu,overlay)})}
rec.addEventListener('click',function(e){if(window.innerWidth>980)return;var submenuClassList=['.t451__link-item_submenu','.t966__tm-link','.t978__tm-link','.t978__menu-link_hook'];var isContainsSubmenuClass=submenuClassList.some(function(className){return e.target.closest(className)});if(!isContainsSubmenuClass)return;setTimeout(function(){t451_checkSize(menu)},100)});window.addEventListener('resize',function(){t451_checkSize(menu)});menu.addEventListener('menuOverflow',function(){t451_checkSize(menu)});var navLinks=rec.querySelectorAll('.t451 a.t-menu__link-item[href*="#"], .t451 a.t-menusub__link-item[href*="#"]');navLinks=Array.prototype.filter.call(navLinks,function(navLink){return!navLink.classList.contains('tooltipstered')});if(navLinks.length>0){t_onFuncLoad('t_menu__updateActiveLinks',function(){t_menu__updateActiveLinks(navLinks,'.t451')})}
t_onFuncLoad('t_menu__highlightActiveLinks',function(){t_menu__highlightActiveLinks('.t451m__menu a')});document.addEventListener('click',function(e){if(e.target.closest('.t451m__overlay, .t451m__close, a[href*="#"]:not(.tooltipstered):not(.t794__tm-link):not(.t978__tm-link):not(.t966__tm-link):not(.t978__menu-link_hook):not(.t-menuwidgeticons__link_wishlist):not(.t-menuwidgeticons__link_cart)')){t451_closeMenu(menu,overlay)}});document.addEventListener('keydown',function(e){if(e.keyCode===27){t451_closeMenu(menu,overlay)}})}
function t451_showMenu(menu,overlay){if(!menu)return;if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t451__body_menushowed');menu.classList.add('t451m__menu_show');if(overlay)overlay.classList.add('t451m__menu_show')}
function t451_closeMenu(menu,overlay){if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');document.body.classList.remove('t451__body_menushowed');if(menu)menu.classList.remove('t451m__menu_show');if(overlay)overlay.classList.remove('t451m__menu_show')}
function t451_checkSize(menu){if(!menu)return;var menuTop=menu.querySelector('.t451m__top');var menuRight=menu.querySelector('.t451m__rightside');var menuContainer=menu.querySelector('.t451m__container');var menuTopHeight=menuTop?menuTop.offsetHeight:0;var menuRightHeight=menuRight?menuRight.offsetHeight:0;var windowPadding=80;if(menuTopHeight+menuRightHeight+windowPadding>window.innerHeight){menu.classList.add('t451m__overflowed');if(menuContainer)menuContainer.style.height='auto'}else{menu.classList.remove('t451m__overflowed');if(menuContainer)menuContainer.style.height=''}}
function t451_appearMenu(recid){var rec=document.getElementById('rec'+recid);var burger=rec?rec.querySelector('.t451__panel'):null;if(!burger)return;var burgerAppearOffset=burger?burger.getAttribute('data-appearoffset'):'';if(burgerAppearOffset)burgerAppearOffset=t451_appearMenuParseNumber(burgerAppearOffset);if(window.pageYOffset>=burgerAppearOffset){if(burger.classList.contains('t451__beforeready')){burger.classList.remove('t451__beforeready')}}else{burger.classList.add('t451__beforeready')}}
function t451_appearMenuParseNumber(string){if(string.indexOf('vh')>-1){string=Math.floor((window.innerHeight*(parseInt(string,10)/100)))}
return parseInt(string,10)}
function t738_init(recId){t_onFuncLoad('t_card__moveClickOnCard',function(){t_card__moveClickOnCard(recId)});t_onFuncLoad('t_card__addFocusOnTab',function(){t_card__addFocusOnTab(recId)})}
function t738_unifyHeights(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t738');if(!container)return;var items=rec.querySelectorAll('.t738__item');var maxHeight=0;for(var i=0;i<items.length;i++){items[i].style.height=''}
for(var i=0;i<items.length;i++){var itemPaddingTop=parseInt(getComputedStyle(items[i]).paddingTop)||0;var itemPaddingBottom=parseInt(getComputedStyle(items[i]).paddingBottom)||0;var imgHeight=items[i].querySelector('img').offsetHeight+itemPaddingTop+itemPaddingBottom;if(imgHeight>maxHeight){maxHeight=imgHeight}}
for(var i=0;i<items.length;i++){var itemPaddingTop=parseInt(getComputedStyle(items[i]).paddingTop)||0;var itemPaddingBottom=parseInt(getComputedStyle(items[i]).paddingBottom)||0;items[i].style.height=maxHeight+itemPaddingTop+itemPaddingBottom+'px'}
t_onFuncLoad('t_slds_updateSlider',function(){t_slds_updateSlider(recId)})}
function t868_initPopup(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;rec.setAttribute('data-animationappear','off');rec.style.opacity='1';var popup=rec.querySelector('.t-popup');if(!popup)return;var hook=popup.getAttribute('data-tooltip-hook');if(!hook)return;var analitics=popup.getAttribute('data-track-popup');var customCodeHTML=t868__readCustomCode(rec);var recBlocks=document.querySelectorAll('.r');for(var i=0;i<recBlocks.length;i++){recBlocks[i].addEventListener('click',function(event){var target=event.target;var href=target.closest('a[href$="'+hook+'"]')?target:!1;if(!href)return;event.preventDefault();t868_showPopup(rec,customCodeHTML);t_onFuncLoad('t_popup__resizePopup',function(){t_popup__resizePopup(recid)});if(hook.substring(0,7)==='#popup:'&&analitics&&window.Tilda){var virtTitle=hook;virtTitle=virtTitle.substring(7);Tilda.sendEventToStatistics(analitics,virtTitle)}})}
if(!popup.getAttribute('data-popup-inited')&&'MutationObserver' in window){popup.setAttribute('data-popup-inited','yes');var stores=document.querySelectorAll('body .t-store');Array.prototype.forEach.call(stores,function(store){new MutationObserver(function(mutationsList){for(var mutation in mutationsList){var event=mutationsList[mutation];if(event.type==='attributes'){if(event.target.className.indexOf('t-popup_show')!==-1){popup.style.zIndex='99999999';t868_initPopup(recid);}}}}).observe(store,{attributes:!0,attributeFilter:['class'],subtree:!0,})})}}
function t868__readCustomCode(rec){var codeWrap=rec.querySelector('.t868 .t868__code-wrap');if(!codeWrap)return;var customCode=codeWrap.innerHTML;return customCode}
function t868_showPopup(rec){var popup=rec.querySelector('.t-popup');if(!popup)return;var popupContainer=popup.querySelector('.t-popup__container');if(!popupContainer)return;var codeWrap=popup.querySelector('.t868__code-wrap');if(!codeWrap)return;var windowWidth=window.innerWidth;var screenMin=rec.getAttribute('data-screen-min');var screenMax=rec.getAttribute('data-screen-max');if(screenMin&&windowWidth<parseInt(screenMin,10))return;if(screenMax&&windowWidth>parseInt(screenMax,10))return;popup.style.display='block';codeWrap.style.display='block';t868_setHeight(rec);setTimeout(function(){popupContainer.classList.add('t-popup__container-animated');popup.classList.add('t-popup_show')},100);if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t-body_popupshowed');popup.addEventListener('click',function(event){var container=event.target.closest('.t-popup__container');if(!container)t868_closePopup(rec)});var closeButton=rec.querySelector('.t-popup__close');if(closeButton){closeButton.addEventListener('click',function(){t868_closePopup(rec)})}
var buttons=rec.querySelectorAll('a[href*="#"]');Array.prototype.forEach.call(buttons,function(button){button.addEventListener('click',function(){var url=button.getAttribute('href');if(url.indexOf('#order')!==-1){var popupContainer=rec.querySelector('.t-popup__container');setTimeout(function(){while(popupContainer.firstChild){popupContainer.removeChild(popupContainer.firstChild)}},600)}
if(!url||url.substring(0,7)!=='#price:'){t868_closePopup(rec);if(!url||url.substring(0,7)==='#popup:'){setTimeout(function(){if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupShowed');document.body.classList.add('t-body_popupshowed')},300)}}})});document.addEventListener('keydown',function(event){if(event.keyCode===27){t868_closePopup(rec)}})}
function t868_closePopup(rec){var popup=rec.querySelector('.t-popup');var codeWrap=rec.querySelector('.t868 .t868__code-wrap');if(typeof t_triggerEvent==='function')t_triggerEvent(document.body,'popupHidden');document.body.classList.remove('t-body_popupshowed');popup.classList.remove('t-popup_show');setTimeout(function(){if(!popup.classList.contains('.t-popup_show')){popup.style.display='none';if(codeWrap){codeWrap.style.display='none'}}},300)}
function t868_setHeight(rec){var videoCarier=rec.querySelector('.t868__video-carier');if(!videoCarier)return;var paddingLeft=parseInt(videoCarier.style.paddingLeft,10)||0;var paddingRight=parseInt(videoCarier.style.paddingRight,10)||0;var height=(videoCarier.clientWidth-(paddingLeft+paddingRight))/(16/9);videoCarier.style.height=height;Array.prototype.forEach.call(videoCarier.closest,function(parent){parent.style.height=height})}
if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector}
if(!Element.prototype.closest){Element.prototype.closest=function(s){var el=this;while(el&&el.nodeType===1){if(Element.prototype.matches.call(el,s)){return el}
el=el.parentElement||el.parentNode}
return null}}