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 t281_initPopup(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t281');if(!container)return;rec.setAttribute('data-animationappear','off');rec.setAttribute('data-popup-subscribe-inited','y');rec.style.opacity=1;var documentBody=document.body;var hrefs=rec.querySelectorAll('a[href*="#"]');var popup=rec.querySelector('.t-popup');var popupCloseBtn=popup.querySelector('.t-popup__close');var popupTooltipHook=popup.getAttribute('data-tooltip-hook');var analitics=popup.getAttribute('data-track-popup');if(popupTooltipHook){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="'+popupTooltipHook+'"]')?target:!1;if(!href)return;event.preventDefault();t281_showPopup(recId);t281_resizePopup(recId);t281__lazyLoad();if(analitics){Tilda.sendEventToStatistics(analitics,popupTooltipHook)}})}}
popup.addEventListener('scroll',t_throttle(function(){t281__lazyLoad()}));popup.addEventListener('click',function(event){if(event.target===this)t281_closePopup()});popupCloseBtn.addEventListener('click',t281_closePopup);for(var i=0;i<hrefs.length;i++){hrefs[i].addEventListener('click',function(){var url=this.getAttribute('href');if(!url||(url.substring(0,7)!='#price:'&&url.substring(0,7)!='#order:')){t281_closePopup();if(!url||url.substring(0,7)=='#popup:'){setTimeout(function(){documentBody.classList.add('t-body_popupshowed')},300)}}})}}
function t281_lockScroll(){var documentBody=document.body;if(!documentBody.classList.contains('t-body_scroll-locked')){var bodyScrollTop=(typeof window.pageYOffset!=='undefined')?window.pageYOffset:(document.documentElement||documentBody.parentNode||documentBody).scrollTop;documentBody.classList.add('t-body_scroll-locked');documentBody.style.top='-'+bodyScrollTop+'px';documentBody.setAttribute('data-popup-scrolltop',bodyScrollTop)}}
function t281_unlockScroll(){var documentBody=document.body;if(documentBody.classList.contains('t-body_scroll-locked')){var bodyScrollTop=documentBody.getAttribute('data-popup-scrolltop');documentBody.classList.remove('t-body_scroll-locked');documentBody.style.top=null;documentBody.removeAttribute('data-popup-scrolltop');document.documentElement.scrollTop=parseInt(bodyScrollTop)}}
function t281_showPopup(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t281');if(!container)return;var popup=rec.querySelector('.t-popup');var popupContainer=popup.querySelector('.t-popup__container');var documentBody=document.body;popup.style.display='block';setTimeout(function(){popupContainer.classList.add('t-popup__container-animated');popup.classList.add('t-popup_show')},50);documentBody.classList.add('t-body_popupshowed');documentBody.classList.add('t281__body_popupshowed');if(/iPhone|iPad|iPod/i.test(navigator.userAgent)&&!window.MSStream){setTimeout(function(){t281_lockScroll()},500)}
document.addEventListener('keydown',t281_escClosePopup)}
function t281_escClosePopup(event){if(event.key==='Escape')t281_closePopup()}
function t281_closePopup(){var popupAll=document.querySelectorAll('.t-popup');document.body.classList.remove('t-body_popupshowed');document.body.classList.remove('t281__body_popupshowed');for(var i=0;i<popupAll.length;i++){popupAll[i].classList.remove('t-popup_show')}
if(/iPhone|iPad|iPod/i.test(navigator.userAgent)&&!window.MSStream){t281_unlockScroll()}
setTimeout(function(){var popupHide=document.querySelectorAll('.t-popup:not(.t-popup_show)');for(var i=0;i<popupHide.length;i++){popupHide[i].style.display='none'}},300);document.removeEventListener('keydown',t281_escClosePopup)}
function t281_resizePopup(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var popupContainer=rec.querySelector('.t-popup__container');if(!popupContainer)return;var popupStyle=getComputedStyle(popupContainer,null);var popupPaddingTop=parseInt(popupStyle.paddingTop)||0;var popupPaddingBottom=parseInt(popupStyle.paddingBottom)||0;var popupHeight=popupContainer.clientHeight-(popupPaddingTop+popupPaddingBottom);if(popupHeight>(window.innerHeight-120)){popupContainer.classList.add('t-popup__container-static')}else{popupContainer.classList.remove('t-popup__container-static')}}
function t281__lazyLoad(){if(window.lazy==='y'||document.getElementById('allrecords').getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}}
function t902_init(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t902');if(!container)return;t_onFuncLoad('t_card__moveClickOnCard',function(){t_card__moveClickOnCard(recId)});t_onFuncLoad('t_card__addFocusOnTab',function(){t_card__addFocusOnTab(recId)});t902_unifyHeights(recId);window.addEventListener('resize',t_throttle(function(){t902_unifyHeights(recId)}));container.addEventListener('displayChanged',function(){t902_unifyHeights(recId)})}
function t902_unifyHeights(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t902');if(!container)return;var wraps=rec.querySelectorAll('.t902__wrap');var rows=[];var chunkSize=2;var cols=Array.prototype.slice.call(rec.querySelectorAll('.t-card__col'));for(var i=0;i<cols.length;i+=chunkSize){rows.push(cols.slice(i,i+chunkSize))}
if(window.innerWidth>960){for(var i=0;i<rows.length;i++){var row=rows[i];var heightBox=0;var innerCols=[];var bgImages=[];for(var j=0;j<row.length;j++){innerCols.push(row[j].querySelector('.t902__inner-col'));bgImages.push(row[j].querySelector('.t902__bgimg'))}
for(var j=0;j<innerCols.length;j++){var col=innerCols[j];var wrap=col.querySelector('.t902__wrap');var wrapHeight=wrap.offsetHeight;if(wrapHeight>heightBox)heightBox=wrapHeight}
if(heightBox>0){for(var j=0;j<innerCols.length;j++){if(innerCols[j])innerCols[j].style.height=heightBox+'px'}
for(var j=0;j<bgImages.length;j++){if(bgImages[j])bgImages[j].style.height=heightBox+'px'}}}}else{var cols=rec.querySelectorAll('.t902__inner-col');var bgImages=rec.querySelectorAll('.t902__bgimg');for(var i=0;i<cols.length;i++){cols[i].style.height='auto'}
for(var i=0;i<bgImages.length;i++){bgImages[i].style.height='auto'}}
for(var i=0;i<wraps.length;i++){var wrap=wraps[i];var wrapHeight=wrap.offsetHeight;var content=wrap.querySelector('.t902__content');var contentHeight=content.offsetHeight;if(wrapHeight<contentHeight){wrap.style.minHeight=contentHeight+'px'}}}
function t354_createCookie(cookieName,cookieValue,cookieDays){var expires='';if(cookieDays){if(Number(cookieDays)>9999999){cookieDays=9999999}
var date=new Date();date.setTime(date.getTime()+cookieDays*24*60*60*1000);expires='; expires='+date.toGMTString()}
document.cookie=cookieName+'='+cookieValue+expires+'; path=/'}
function t354_readCookie(cookieName){cookieName=cookieName+'=';var allCookies=document.cookie.split(';');for(var i=0;i<allCookies.length;i++){var cookie=allCookies[i];while(cookie.charAt(0)===' '){cookie=cookie.substring(1,cookie.length)}
if(cookie.indexOf(cookieName)===0){return cookie.substring(cookieName.length,cookie.length)}}
return null}
function t354_checkPosition(recid){var rec=document.querySelector('#rec'+recid);if(!rec)return;var windowWidth=window.innerWidth;var screenMin=rec.getAttribute('data-screen-min');var screenMax=rec.getAttribute('data-screen-max');if(typeof screenMin==='string'){if(windowWidth<parseInt(screenMin,10)){return!0}}
if(typeof screenMax==='string'){if(windowWidth>parseInt(screenMax,10)){return!0}}
var openerLink=rec.querySelector('.t354__opener');if(!t354_isPopupRecVisible(openerLink))return;var cookieName=openerLink.getAttribute('data-cookie-name');var cookieTime=openerLink.getAttribute('data-cookie-time');var cookieValue='t354cookie';var multiplier=openerLink.getAttribute('data-trigger-position');var position=window.innerHeight*multiplier;var cookie=t354_readCookie(cookieName);var wrapperBlock=rec.querySelector('.t354');if(!wrapperBlock)return;if(cookie){wrapperBlock.innerHTML=''}else if(openerLink){var scrollOffset=document.scrollingElement.scrollTop+position;var openerLinkOffset=openerLink.getBoundingClientRect().top+window.pageYOffset;if(scrollOffset>=openerLinkOffset){var event=document.createEvent('HTMLEvents');event.initEvent('click',!0,!1);openerLink.dispatchEvent(event);wrapperBlock.innerHTML='';t354_createCookie(cookieName,cookieValue,cookieTime)}}}
function t354_isPopupRecVisible(openerLink){if(openerLink){var linkText=openerLink.getAttribute('href');var popupElement=document.querySelector('.t-popup[data-tooltip-hook="'+linkText+'"]');if(popupElement){var popupElementRec=popupElement.closest('.r');var minScreen=popupElementRec.getAttribute('data-screen-min');if(minScreen&&minScreen!==''){minScreen=minScreen.replace('px','');if(parseInt(minScreen,10)>window.innerWidth){return!1}}}
return!0}}
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}}