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 t856_init(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t856');if(!container)return;t_onFuncLoad('t_card__moveClickOnCard',function(){t_card__moveClickOnCard(recId)});t_onFuncLoad('t_card__addFocusOnTab',function(){t_card__addFocusOnTab(recId)});setTimeout(function(){t856_setHeight(recId);t856_updateLazyLoad(recId)},500);window.addEventListener('resize',t_throttle(function(){if(window.noAdaptive&&window.noAdaptive===!0&&window.isMobile)return;t856_setHeight(recId)}));if(typeof jQuery!=='undefined'){$(container).on('displayChanged',function(){t856_setHeight(recId)})}else{container.addEventListener('displayChanged',function(){t856_setHeight(recId)})}
if(container&&container.classList.contains('t856__previewmode')){setInterval(function(){t856_setHeight(recId)},5000)}}
function t856_setHeight(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t856');if(!container)return;var ratio=container.getAttribute('data-tile-ratio');var rows=rec.querySelectorAll('.t856__row');var col=rec.querySelector('.t856__col');var ratioHeight=0;if(col){ratioHeight=parseFloat(getComputedStyle(col,null).width)*ratio}
for(var i=0;i<rows.length;i++){var row=rows[i];var largestHeight=0;var tables=row.querySelectorAll('.t856__table');for(var j=0;j<tables.length;j++){var table=tables[j];var textHeight=table.querySelector('.t856__textwrapper').offsetHeight;if(table.querySelector('.t856__cell').classList.contains('t856__button-bottom')){textHeight+=table.querySelector('.t856__button-container').offsetHeight}
if(textHeight>largestHeight)largestHeight=textHeight}
if(window.innerWidth>=960){if(largestHeight>ratioHeight){for(var j=0;j<tables.length;j++){tables[j].style.height=largestHeight+'px';tables[j].style.minHeight='auto'}}else{for(var j=0;j<tables.length;j++){tables[j].style.height=ratioHeight+'px';tables[j].style.minHeight='auto'}}}else{for(var j=0;j<tables.length;j++){tables[j].style.minHeight=ratioHeight+'px';tables[j].style.height=null}}
if(t856_GetIEVersion()>0){var currentRowHeight=getComputedStyle(row.querySelector('.t856__table')).height;row.querySelector('.t856__bg').style.height=currentRowHeight+'px';row.querySelector('.t856__overlay').style.height=currentRowHeight+'px'}}}
function t856_GetIEVersion(){var userAgent=window.navigator.userAgent;var index=userAgent.indexOf('MSIE');if(index>0){return parseInt(userAgent.substring(index+5,userAgent.indexOf('.',index)))}else if(!!navigator.userAgent.match(/Trident\/7\./)){return 11}else{return 0}}
function t856_updateLazyLoad(recId){var scrollContainer=document.querySelector('#rec'+recId+' .t856__container_mobile-flex');var allRecords=document.getElementById('allrecords');var currentMode=allRecords.getAttribute('data-tilda-mode');if(scrollContainer&&currentMode!=='edit'&&currentMode!=='preview'){scrollContainer.addEventListener('scroll',t_throttle(function(){if(window.lazy==='y'||allRecords.getAttribute('data-tilda-lazy')==='yes'){t_onFuncLoad('t_lazyload_update',function(){t_lazyload_update()})}},500))}}
function t121_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var wrapperBlock=rec.querySelector('.t121');var videoLazy=rec.querySelector('.t-video-lazyload');if(videoLazy){t_onFuncLoad('t_video_lazyload__setHeight',function(){var videoHeight=videoLazy.getAttribute('data-videolazy-height');if(videoHeight!=='540px')return;t_video_lazyload__setHeight(videoLazy);window.addEventListener('resize',function(){t_video_lazyload__setHeight(videoLazy)});if(!wrapperBlock)return;wrapperBlock.addEventListener('displayChanged',function(){t_video_lazyload__setHeight(videoLazy)})})}
var videoCarrier=rec.querySelector('.t-video-carier');if(!videoCarrier)return;var screenMin=rec.getAttribute('data-screenmin');var screenMax=rec.getAttribute('data-screenmax');var isLoad=!1;if(window.innerWidth<parseInt(screenMin,10)||window.innerWidth>parseInt(screenMax,10))return;window.addEventListener('scroll',t_throttle(function(){if(!isLoad){var videoCarrierOffsetTop=videoCarrier.getBoundingClientRect().top+window.pageYOffset;var videoCarrierHeight=parseInt(window.getComputedStyle(videoCarrier).height,10);var windowScrollTop=window.pageYOffset;var windowHeight=window.innerHeight;if(windowScrollTop+windowHeight>videoCarrierOffsetTop-500&&windowScrollTop<videoCarrierOffsetTop+videoCarrierHeight+501){t_onFuncLoad('processYoutubeVideo',function(){processYoutubeVideo(videoCarrier,videoCarrier.style.height)});isLoad=!0}}}));var event=document.createEvent('HTMLEvents');event.initEvent('scroll',!0,!1);window.dispatchEvent(event)}
function t854_init(recid){var rec=document.querySelector('#rec'+recid);if(!rec)return;var btnNews=rec.querySelector('.t854__news-btn');var newsContent=rec.querySelector('.t854__news-content');var attrKeyTelegram=newsContent.getAttribute('data-telegram-key');var keyTelegram=attrKeyTelegram&&attrKeyTelegram.length?attrKeyTelegram:'V1J5MnVkSWJ2UW5nN1JZM';var attrCountNews=newsContent.getAttribute('data-telegram-news-amount');var symbolsAttr=newsContent.getAttribute('data-telegram-symbols-preview');var countNews=attrCountNews&&attrCountNews.length?+attrCountNews:5;var dateFormat=newsContent.getAttribute('data-telegram-date');var currentFromNews=0;var currentShlop=0;var symbolsAmount=40;if(symbolsAttr===''){symbolsAmount=200}else if(symbolsAttr<40){symbolsAmount=40}else if(symbolsAttr>1000){symbolsAmount=1000}else{symbolsAmount=symbolsAttr}
var totalNews=t854_showNews(rec,newsContent,keyTelegram,countNews,currentFromNews,currentShlop,dateFormat,symbolsAmount);newsContent.removeAttribute('data-telegram-key');newsContent.removeAttribute('data-telegram-news-amount');newsContent.removeAttribute('data-telegram-symbols-preview');newsContent.removeAttribute('data-telegram-date');t854_hideBtn(btnNews,totalNews,currentFromNews,countNews);btnNews.addEventListener('click',function(event){event.preventDefault();currentFromNews=currentFromNews+countNews;currentShlop=event.target.closest('.t854__news-wrap').getAttribute('data-news-shlop');t854_hideBtn(btnNews,totalNews,currentFromNews,countNews);if(currentFromNews<totalNews){t854_showNews(rec,newsContent,keyTelegram,countNews,currentFromNews,currentShlop,dateFormat,symbolsAmount)}})}
function t854_hideBtn(btnNews,totalNews,currentFromNews,countNews){if(totalNews-currentFromNews<=countNews){btnNews.style.display='none'}}
function t854_formatDate(date,dateFormat){var dateParts=date.split('-');var newDate=new Date(dateParts[0],dateParts[1]-1,dateParts[2]);var newMonth=newDate.getMonth();var newDay=newDate.getDay();var dayOfWeek=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];var month=['January','February','March','April','May','June','July','August','September','October','November','December'];switch(+dateFormat){case 1:return dateParts[1]+'-'+dateParts[2]+'-'+dateParts[0];case 2:return dateParts[2]+'-'+dateParts[1]+'-'+dateParts[0];case 3:return dateParts[2]+'/'+dateParts[1]+'/'+dateParts[0];case 4:return dateParts[2]+'.'+dateParts[1]+'.'+dateParts[0];case 5:return month[newMonth]+' '+dateParts[2]+', '+dateParts[0];default:return dayOfWeek[newDay]+', '+month[newMonth]+' '+dateParts[2]}}
function t854_getNews(rec,keyTelegram,count,from,shlop,symbolsAmount){var language=window.navigator?window.navigator.language||window.navigator.systemLanguage||window.navigator.userLanguage:'ru';language=language.substr(0,2).toLowerCase();var btnNews=rec.querySelector('.t854__news-btn');var newsWrap=rec.querySelector('.t854__news-wrap');var newsContainer=rec.querySelector('.t854__news-wrap-container');var loader=rec.querySelector('.t854__news-loader');var urlNews='https://news.tildacdn.com/feed/'+keyTelegram+'/'+count+'/'+(parseInt(from)+parseInt(shlop))+'/'+symbolsAmount;var dataJSON='';loader.classList.add('t854__news-btn-loader_show');if(keyTelegram.indexOf('telegram')===-1){if(language=='ru'){newsWrap.innerHTML='<div style="font-family:Georgia,serif;font-size:20px;color:red;">Вы ввели неправильный ключ</div>'}
return}
var request=new XMLHttpRequest();request.open('GET',urlNews,!1);request.onload=function(){var data=request.response;if(this.status>=200&&this.status<400){try{dataJSON=JSON.parse(data)}catch(e){}
newsWrap.setAttribute('data-news-shlop',dataJSON.shlop);if(dataJSON.status=='fail'){console.log('You entered an '+dataJSON.error);btnNews.style.display='none';if(language=='ru'){newsWrap.innerHTML='<div style="font-family:Georgia,serif;font-size:20px;color:red;">Вы ввели неправильный ключ</div>'}else{newsWrap.innerHTML='<div style="font-family:Georgia,serif;font-size:20px;color:red;">You entered an '+dataJSON.error+'</div>'}}
if(dataJSON.total==0){console.log('You haven\'t a publication')}
loader.classList.remove('t854__news-btn-loader_show');newsContainer.style.opacity=1;loader.style.display='none'}};request.onerror=function(){console.log('Error!')};request.send();return dataJSON}
function t854_showNews(rec,newsContent,keyTelegram,count,from,shlop,dateFormat,symbolsAmount){var news=t854_getNews(rec,keyTelegram,count,from,shlop,symbolsAmount);if(!news)return;var newsMessages=news.messages;var totalNews=news.total;if(newsMessages){for(var i=0;i<newsMessages.length;i++){var dateNews=newsMessages[i].date.split(' ');var dayNews=dateNews[0];var textNews=newsMessages[i].text;var shortTextNews=newsMessages[i].short_text;var imageIdNews=newsMessages[i].files;var timeHTML='<div class="t854__news-time t-descr t-descr_xxs">'+t854_formatDate(dayNews,dateFormat)+'</div>';var blockImageArr=[];var imagesHTML=t854_addImage(newsMessages[i],imageIdNews,blockImageArr);var textHTML=t854_addText(textNews,shortTextNews);if(shortTextNews){if(imageIdNews.length!==1){newsContent.innerHTML+='<div class="t854__news-message t854__news-message_popup t854__news-message_short">'+timeHTML+imagesHTML+textHTML+'</div>'}else{newsContent.innerHTML+='<div class="t854__news-message t854__news-message_popup t854__news-message_short">'+timeHTML+'<div class="t854__news-message-flex">'+imagesHTML+textHTML+'</div>'+'</div>'}}else if(imageIdNews.length!==1){newsContent.innerHTML+='<div class="t854__news-message">'+timeHTML+imagesHTML+textHTML+'</div>'}else{newsContent.innerHTML+='<div class="t854__news-message">'+timeHTML+'<div class="t854__news-message-flex">'+imagesHTML+textHTML+'</div>'+'</div>'}}
t854_addPopup(rec);t854_closePopup(rec)}
return totalNews}
function t854_addText(textNews,shortTextNews){var textHTML;if(textNews.length===0){textHTML=''}else if(shortTextNews){textHTML='<div class="t854__news-text t-descr t-descr_xs">'+shortTextNews+'</div><div class="t854__news-text_short-hide t-descr t-descr_xs">'+textNews+'</div>'}else{textHTML='<div class="t854__news-text t-descr t-descr_xs">'+textNews+'</div>'}
return textHTML}
function t854_addImage(item,imageIdNews,blockImageArr){var images='';var imgHTML='';var imageUrl;if(item.files[0]){imageUrl='https://news.tildacdn.com/'+item.files[0]}
for(var i=0;i<imageIdNews.length;i++){imageUrl='https://news.tildacdn.com/'+imageIdNews[i]+'/-/resize/x900/';var blockImage='<div class="t854__news-image-wrap"><img src="'+imageUrl+'" class="t854__news-image"></div>';blockImageArr.push(blockImage)}
if(blockImageArr.length!==0){for(var i=0;i<blockImageArr.length;i++){images+=blockImageArr[i];if(blockImageArr.length>2){imgHTML='<div class="t854__news-images t854__news-images_col3">'+images+'</div>'}else{imgHTML='<div class="t854__news-images">'+images+'</div>'}}}
return imgHTML}
function t854_addPopup(rec){var popupBlock=rec.querySelectorAll('.t854__news_publish.t854__news_short .t854__news-message');var wrapTextPopup=rec.querySelector('.t854__news-popup-bg');var textPopup=rec.querySelector('.t854__news-popup');var messageWrap=rec.querySelector('.t854__news_publish .t854__news-popup-message-wrap');Array.prototype.forEach.call(popupBlock,function(popup){var textShortLength=popup.querySelector('.t854__news-text_short-hide');popup.addEventListener('click',function(event){document.querySelector('body').classList.add('t854__body_overflow');if(wrapTextPopup)wrapTextPopup.style.display='block';if(textPopup&&textShortLength){textPopup.classList.add('t854__news-popup_short')}
var popupShortContent=popup.innerHTML;messageWrap.innerHTML=popupShortContent;event.preventDefault()});var link=popup.querySelector('a');if(link){link.addEventListener('click',function(event){event.stopPropagation()})}})}
function t854_closePopup(rec){var wrapTextPopup=rec.querySelector('.t854__news-popup-bg');var textPopup=rec.querySelector('.t854__news-popup');var contentTextPopup=rec.querySelector('.t854__news-popup-content');var close=rec.querySelector('.t854__news-popup-close');if(wrapTextPopup){wrapTextPopup.addEventListener('click',function(event){t854_closeContent(wrapTextPopup,contentTextPopup,textPopup);event.preventDefault()})}
if(textPopup){textPopup.onclick=function(event){event.stopPropagation()}}
if(close){close.addEventListener('click',function(event){t854_closeContent(wrapTextPopup,contentTextPopup,textPopup);event.preventDefault()})}
document.querySelector('body').addEventListener('keyup',function(event){if(event.keyCode==27){t854_closeContent(wrapTextPopup,contentTextPopup,textPopup);event.preventDefault()}})}
function t854_closeContent(wrapTextPopup,contentTextPopup,textPopup){document.querySelector('body').classList.remove('t854__body_overflow');if(wrapTextPopup)wrapTextPopup.style.display='none';textPopup.classList.remove('t854__news-popup_short');if(contentTextPopup)contentTextPopup.innerHTML=''}
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}}
function t698_onSuccess(form){t_onFuncLoad('t_forms__onSuccess',function(){t_forms__onSuccess(form)})}
function t698_fixcontentheight(recId){var rec=document.getElementById('rec'+recId);var cover=rec.querySelector('.t-cover');var coverFilter=rec.querySelector('.t-cover__filter');var coverCarrier=rec.querySelector('.t-cover__carrier');var coverWrapper=rec.querySelector('.t-cover__wrapper');var coverContainer=rec.querySelector('.t-cover__container');var coverStyle=getComputedStyle(cover,null);var coverPaddingTop=parseInt(coverStyle.paddingTop)||0;var coverPaddingBottom=parseInt(coverStyle.paddingBottom)||0;var coverHeight=cover.clientHeight-(coverPaddingTop+coverPaddingBottom);var hookContent=rec.querySelector('div[data-hook-content]');var hookContentHeight=hookContent.offsetHeight;if(hookContentHeight>300&&coverHeight<hookContentHeight){var newHookContentHeight=hookContentHeight+120;if(newHookContentHeight>1000)newHookContentHeight+=100;console.log('auto correct cover height: '+newHookContentHeight);cover.style.height=newHookContentHeight+'px';if(coverFilter)coverFilter.style.height=newHookContentHeight+'px';if(coverCarrier)coverCarrier.style.height=newHookContentHeight+'px';if(coverWrapper)coverWrapper.style.height=newHookContentHeight+'px';if(coverContainer)coverContainer.style.height=newHookContentHeight+'px';if(window.isMobile===!1){setTimeout(function(){if(coverCarrier.querySelector('iframe')){console.log('correct video from cover_fixcontentheight');setWidthHeightYoutubeVideo(coverCarrier,newHookContentHeight+'px')}},2000)}}}
function t490_init(recId){t_onFuncLoad('t_card__moveClickOnCard',function(){t_card__moveClickOnCard(recId)});t_onFuncLoad('t_card__addFocusOnTab',function(){t_card__addFocusOnTab(recId)})}
function t1046_init(recId){var rec=document.getElementById('rec'+recId);if(!rec)return;var container=rec.querySelector('.t1046');if(!container)return;container.classList.remove('t1046__beforeready');window.addEventListener('scroll',t_throttle(function(){t1046_appearMenu(rec)},200));t1046_appearMenu(rec)}
function t1046_appearMenu(rec){var container=rec.querySelector('.t1046');var appearOffset=container.getAttribute('data-appearoffset');var scrollTop=window.pageYOffset;var windowHeight=window.innerHeight;var body=document.body;var html=document.documentElement;var documentHeight=Math.max(body.scrollHeight,body.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight);if(window.innerWidth<=980&&appearOffset)appearOffset='150';if(!appearOffset)appearOffset='0';if(appearOffset.indexOf('vh')>-1){appearOffset=Math.floor((windowHeight*(parseInt(appearOffset)/100)))}
appearOffset=parseInt(appearOffset,10);if(scrollTop>=appearOffset&&scrollTop+windowHeight+70<=documentHeight){if(getComputedStyle(container,null).visibility==='hidden'){container.style.bottom='-100px';container.style.visibility='visible';t1046__fadeIn(container);t1046__animate(container,'bottom')}}else{container.style.visibility='hidden';container.style.opacity='0'}}
function t1046__animate(element,animate){var duration=400;var start=parseInt(getComputedStyle(element,null)[animate]);var change=0-start;var currentTime=0;var increment=16;function t1046__easeInOutCubic(currentTime,start,change){if((currentTime/=duration/2)<1){return change/2*currentTime*currentTime*currentTime+start}else{return change/2*((currentTime-=2)*currentTime*currentTime+2)+start}}
function t1046__animateElement(){currentTime+=increment;element.style[animate]=t1046__easeInOutCubic(currentTime,start,change)+'px';if(currentTime<duration){setTimeout(t1046__animateElement,increment)}else{element.style[animate]='0px'}}
t1046__animateElement()}
function t1046__fadeIn(el){if(el.style.display==='block')return;var opacity=0;el.style.opacity=opacity;el.style.display='block';var timer=setInterval(function(){el.style.opacity=opacity;opacity+=0.1;if(opacity>=1.0){clearInterval(timer);el.style.display=''}},40)}
function t1046_onSuccess(form){if(!(form instanceof Element))form=form[0];var inputsWrapper=form.querySelector('.t-form__inputsbox');var inputsWrapperStyle=getComputedStyle(inputsWrapper,null);var inputsWrapperPaddingTop=parseInt(inputsWrapperStyle.paddingTop)||0;var inputsWrapperPaddingBottom=parseInt(inputsWrapperStyle.paddingBottom)||0;var inputsWrapperHeight=inputsWrapper.clientHeight-(inputsWrapperPaddingTop+inputsWrapperPaddingBottom);var inputsOffset=inputsWrapper.getBoundingClientRect().top+window.pageYOffset;var inputsBottom=inputsWrapperHeight+inputsOffset;var successBox=form.querySelector('.t-form__successbox');var successBoxOffset=successBox.getBoundingClientRect().top+window.pageYOffset;var target=0;var windowHeight=window.innerHeight;var body=document.body;var html=document.documentElement;var documentHeight=Math.max(body.scrollHeight,body.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight);if(window.innerWidth>960){target=successBoxOffset-200}else{target=successBoxOffset-100}
var tildaLabel=document.querySelector('.t-tildalabel');if(successBoxOffset>window.scrollY||(documentHeight-inputsBottom)<(windowHeight-100)){inputsWrapper.classList.add('t1046__inputsbox_hidden');setTimeout(function(){if(windowHeight>documentHeight&&tildaLabel){t1046__fadeOut(tildaLabel)}},300)}else{t1046__scroll(target);setTimeout(function(){inputsWrapper.classList.add('t1046__inputsbox_hidden')},400)}
var successUrl=form.getAttribute('data-success-url');if(successUrl){setTimeout(function(){window.location.href=successUrl},500)}}
function t1046__fadeOut(el){if(el.style.display==='none')return;var opacity=1;var timer=setInterval(function(){el.style.opacity=opacity;opacity-=0.1;if(opacity<=0.1){clearInterval(timer);el.style.display='none';el.style.opacity=null}},50)}
function t1046__scroll(target){var duration=400;var start=(window.pageYOffset||document.documentElement.scrollTop)-(document.documentElement.clientTop||0);var change=target-start;var currentTime=0;var increment=16;document.body.setAttribute('data-scrollable','true');function t1046__easeInOutCubic(currentTime,change){if((currentTime/=duration/2)<1){return change/2*currentTime*currentTime*currentTime+start}else{return change/2*((currentTime-=2)*currentTime*currentTime+2)+start}}
function t1046__animateScroll(){currentTime+=increment;window.scrollTo(0,t1046__easeInOutCubic(currentTime,change));if(currentTime<duration){setTimeout(t1046__animateScroll,increment)}else{document.body.removeAttribute('data-scrollable')}}
t1046__animateScroll()}
function t886_init(recid){var rec=document.querySelector('#rec'+recid);if(!rec)return;var notificationBlock=rec.querySelector('.t886');var closeButton=rec.querySelector('.t886__btn');var storageItem=notificationBlock.getAttribute('data-storage-item');var lastOpen;try{lastOpen=localStorage.getItem(storageItem)}catch(error){console.log('Your web browser does not support localStorage. Error status: ',error)}
if(!lastOpen){notificationBlock.classList.remove('t886_closed')}
if(closeButton){closeButton.addEventListener('click',function(event){notificationBlock.classList.add('t886_closed');try{localStorage.setItem(storageItem,Math.floor(Date.now()/1000))}catch(error){console.log('Your web browser does not support localStorage. Error status: ',error)}
event.preventDefault()})}}
function t770_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var menu=rec.querySelector('.t770');var burger=rec.querySelector('.t-menuburger');var logo=menu?menu.querySelector('.t770__imglogo'):null;var menuPosition=menu?menu.style.position||window.getComputedStyle(menu).position:'';var isEditMode=menu?menu.classList.contains('t770_redactor-mode'):!1;if(!isEditMode){t_onFuncLoad('t_menu__highlightActiveLinks',function(){t_menu__highlightActiveLinks('.t770__list_item a')});if(menu)menu.classList.remove('t770__beforeready');if(menu&&menuPosition==='fixed'){t_onFuncLoad('t_menu__findAnchorLinks',function(){t_menu__findAnchorLinks(recid,'.t770__desktoplist .t770__list_item a')});if(menu.getAttribute('data-bgopacity-two')){t_onFuncLoad('t_menu__changeBgOpacity',function(){t_menu__changeBgOpacity(recid,'.t770');window.addEventListener('scroll',t_throttle(function(){t_menu__changeBgOpacity(recid,'.t770')},200))})}
if(menu.getAttribute('data-appearoffset')){menu.classList.remove('t770__beforeready');t_onFuncLoad('t_menu__showFixedMenu',function(){t_menu__showFixedMenu(recid,'.t770');window.addEventListener('scroll',t_throttle(function(){t_menu__showFixedMenu(recid,'.t770')},200))})}}}
if(logo&&logo.getAttribute('data-img-width')){t770_setLogoPadding(recid)}
if(burger){t_onFuncLoad('t_menu__createMobileMenu',function(){t_menu__createMobileMenu(recid,'.t770')})}
t_onFuncLoad('t_menu__setBGcolor',function(){t_menu__setBGcolor(recid,'.t770');window.addEventListener('resize',t_throttle(function(){t_menu__setBGcolor(recid,'.t770')},200))})}
function t770_setLogoPadding(recid){var rec=document.getElementById('rec'+recid);if(!rec||window.innerWidth<=980)return;var menu=rec.querySelector('.t770');var logo=menu?menu.querySelector('.t770__logowrapper'):null;var leftSide=menu?menu.querySelector('.t770__leftwrapper'):null;var rightSide=menu?menu.querySelector('.t770__rightwrapper'):null;var logoWidth=logo?logo.clientWidth:0;if(leftSide)leftSide.style.paddingRight=((logoWidth/2)+50)+'px';if(rightSide)rightSide.style.paddingLeft=((logoWidth/2)+50)+'px'}
function t966_init(recid){var rec=document.getElementById('rec'+recid);var menu=rec?rec.querySelector('.t966'):null;var hook=menu?menu.getAttribute('data-tooltip-hook'):'';if(!hook)return;var hookLinks=document.querySelectorAll('a[href="'+hook+'"]');hookLinks=Array.prototype.filter.call(hookLinks,function(hookLink){var isSubmenuAllowed=hookLink.getAttribute('data-submenu-disallowed')!=='yes';if(isSubmenuAllowed){hookLink.classList.add('t966__tm-link');hookLink.setAttribute('data-tooltip-menu-id',recid);return!0}
return!1});var parentMenu=hookLinks.length?hookLinks[0].closest('[data-menu]'):null;var tooltipMenu=rec.querySelector('.t966__tooltip-menu');var isParentFixed=parentMenu&&window.getComputedStyle(parentMenu).position==='fixed';if(tooltipMenu)tooltipMenu.setAttribute('data-pos-fixed',isParentFixed?'yes':'no');t966_addArrow(recid,hookLinks);t966_setUpMenu(recid,hookLinks);t_onFuncLoad('t_submenublocks__highlightActiveLinks',function(){t_submenublocks__highlightActiveLinks('.t966__menu-link')});var isT804Exist=!!document.querySelector('.t804');if(isT804Exist){document.addEventListener('replacingCompleted',function(){t966_init(recid)})}
if(menu.hasAttribute('data-full-submenu-mob')&&(window.isMobile||'ontouchend' in document)){t_onFuncLoad('t_submenublocks__setFullScreenMenu',function(){t_submenublocks__setFullScreenMenu(menu)})}}
function t966_divideMenu(recid,rows){var rec=document.getElementById('rec'+recid);if(!rec)return;if(!rows)rows=1;var menu=rec.querySelector('.t966');if(menu&&menu.getAttribute('data-sort-mobile')==='yes'&&window.innerWidth<980)return;var items=rec.querySelectorAll('.t966__menu-item-wrapper');var list=rec.querySelector('.t966__menu-list');var maxItemsCountInRow=Math.ceil(items.length/rows);var rowClass='t966__menu-list-row_'+(100/rows).toFixed();for(var i=0;i<maxItemsCountInRow;i++){var row=document.createElement('div');row.classList.add('t966__menu-list-row');row.classList.add(rowClass);if(list)list.appendChild(row)}
var listRows=list?list.querySelectorAll('.t966__menu-list-row'):[];Array.prototype.forEach.call(items,function(item,i){if(listRows[i%maxItemsCountInRow])listRows[i%maxItemsCountInRow].appendChild(item)});var allRec=document.getElementById('allrecords');var currentMode=allRec?allRec.getAttribute('data-tilda-mode'):'';if(currentMode==='edit'){var tooltipItems=document.querySelectorAll('.t966__tooltip-menu');Array.prototype.forEach.call(tooltipItems,function(item){item.style.display='block'})}}
function t966_addArrow(recid,hookLinks){var rec=document.getElementById('rec'+recid);var submenuBlock=rec?rec.querySelector('.t966'):null;var isArrowAppend=submenuBlock.getAttribute('data-add-arrow');if(!isArrowAppend)return;hookLinks=Array.prototype.slice.call(hookLinks);hookLinks.forEach(function(hookLink){if(hookLink.querySelector('.t966__arrow'))return;var arrow=document.createElement('div');arrow.classList.add('t966__arrow');hookLink.appendChild(arrow);var isInsideZero=hookLink.closest('.tn-atom');var hasCustomBorderColor=window.getComputedStyle(hookLink).borderColor!=='rgba(0, 0, 0, 0)';if(isInsideZero&&!hasCustomBorderColor){hookLink.style.borderColor='initial';hookLink.style.border='none'}})}
function t966_setUpMenu(recid,hookLinks){var rec=document.getElementById('rec'+recid);var submenu=rec?rec.querySelector('.t966__tooltip-menu'):null;if(!submenu)return;var content=submenu.querySelector('.t966__content');var menu=rec.querySelector('.t966');var verticalIndent=menu?menu.getAttribute('data-tooltip-margin'):'';var hooksAndSubmenu=hookLinks.concat(submenu);var timer;if(window.innerWidth>980&&!('ontouchend' in document)){t_onFuncLoad('t_submenublocks__addEventsDesktop',function(){t_submenublocks__addEventsDesktop(submenu,hooksAndSubmenu,verticalIndent,'.t966')})}else{t_onFuncLoad('t_submenublocks__addEventsMobile',function(){t_submenublocks__addEventsMobile(submenu,hookLinks,verticalIndent,'.t966')})}
document.addEventListener('click',function(e){if(submenu.getAttribute('data-mobiletooltip')!=='yes')return;if(!e.target.closest('.t966__tooltip-menu')&&!e.target.classList.contains('t966__tm-link')&&!e.target.closest('.t966__tm-link')){t_onFuncLoad('t_submenublocks__hideSubmenu',function(){t_submenublocks__hideSubmenu(submenu,'.t966')})}});window.addEventListener('scroll',t_throttle(function(){if(content){content.addEventListener('mouseleave',function(){var activeEl=hookLinks.filter(function(el){return el.classList.contains('t966__tm-link_active')});var afterActiveEl=activeEl.length?activeEl[0].nextElementSibling:null;if(submenu.classList.contains('t966__tooltip-menu_show')||(afterActiveEl&&afterActiveEl.classList.contains('t966__tooltip-menu_mobile'))){t_onFuncLoad('t_submenublocks__hideSubmenu',function(){t_submenublocks__hideSubmenu(afterActiveEl,'.t966')})}})}},300));window.addEventListener('resize',t_throttle(function(){if(window.isMobile||window.innerWidth<980)return;var mobileMenu=document.querySelector('.t966__tooltip-menu_mobile');t_onFuncLoad('t_submenublocks__hideSubmenu',function(){t_submenublocks__hideSubmenu(mobileMenu,'.t966')})},300));var submenuLinks=submenu.querySelectorAll('a[href*="#"]');Array.prototype.forEach.call(submenuLinks,function(link){link.addEventListener('click',function(){t_onFuncLoad('t_submenublocks__hideSubmenu',function(){t_submenublocks__hideSubmenu(submenu,'.t966',link)});var clickedInTooltipMenuEls=document.querySelectorAll('.t450, .t199__mmenu, .t280, .t282, .t204__burger, .t451, .t466');Array.prototype.forEach.call(clickedInTooltipMenuEls,function(el){var event=document.createEvent('Event');event.initEvent('clickedAnchorInTooltipMenu',!0,!0);el.dispatchEvent(event)});Array.prototype.forEach.call(submenuLinks,function(otherLink){var linkTitle=otherLink.querySelector('.t966__menu-item-title');if(otherLink!==link){if(linkTitle)linkTitle.classList.remove('t-active')}else{if(linkTitle)linkTitle.classList.add('t-active')}})})})}