function t658_init(recid){var rec=document.querySelector('#rec'+recid);if(!rec)return;rec.setAttribute('data-animationappear','off');rec.classList.remove('r_hidden');rec.classList.remove('r_anim');var wrapperBlock=rec.querySelector('.t658');var confirmPopup=rec.querySelector('.t658__popup_confirm');var denyPopup=rec.querySelector('.t658__popup_deny');var yesButton=rec.querySelector('.t658__btn_yes');var noButton=rec.querySelector('.t658__btn_no');var storageItem=wrapperBlock.getAttribute('data-storage-item');var lastOpen;try{lastOpen=localStorage.getItem(storageItem)}catch(e){console.log('Your web browser does not support localStorage.')}
if(!lastOpen||wrapperBlock.getAttribute('data-unpublish')){wrapperBlock.style.display='block';setTimeout(function(){wrapperBlock.classList.remove('t658_closed')},500);document.querySelector('body').classList.add('t658__body_popupshowed')}
if(yesButton){yesButton.addEventListener('click',function(e){wrapperBlock.classList.add('t658_closed');setTimeout(function(){wrapperBlock.style.display='none'},300);document.querySelector('body').classList.remove('t658__body_popupshowed');try{localStorage.setItem(storageItem,Math.floor(Date.now()/1000))}catch(e){console.log('Your web browser does not support localStorage.')}
e.preventDefault()})}
if(noButton){noButton.addEventListener('click',function(e){setTimeout(function(){confirmPopup.style.display='none';denyPopup.style.display='block'},300);e.preventDefault()})}}
function t975_init(recid){var rec=document.getElementById('rec'+recid);if(!rec)return;var tildaCopy=document.getElementById('tildacopy');var menu=rec.querySelector('.t975');t_onFuncLoad('t_menu__highlightActiveLinks',function(){t_menu__highlightActiveLinks('.t975__list-item a')});if(menu)menu.classList.remove('t975__beforeready');t975_checkAnchorLinks(recid,'.t975__list-item a');var isIphone=t975_detectIphone();var scrollHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight);if(menu&&menu.getAttribute('data-hidemenuonscroll')||isIphone){t975_handleScroll(menu,tildaCopy)}
if(tildaCopy&&scrollHeight>document.documentElement.clientHeight){t975_addCopyrightMargin(menu,tildaCopy);t975_handleScroll(menu,tildaCopy)}
window.addEventListener('resize',function(){t975_changeCopyrightMargin(menu,tildaCopy)})}
function t975_addCopyrightMargin(menu,tildaCopy){if(!tildaCopy||!menu)return;var paddingElement=document.createElement('div');paddingElement.style.backgroundColor='#000';paddingElement.style.height=menu.offsetHeight+'px';paddingElement.classList.add('t-tildalabel-padding');document.body.appendChild(paddingElement)}
function t975_changeCopyrightMargin(menu,tildaCopy){var paddingElement=document.querySelector('.t-tildalabel-padding');if(!paddingElement||!tildaCopy||!menu)return;paddingElement.style.height=menu.offsetHeight+'px'}
function t975_detectIphone(){var isIphone=/iPhone/.test(navigator.userAgent)&&!window.MSStream;var aspect=window.screen.width/window.screen.height;var iphoneAspect='0.462';if(isIphone&&aspect.toFixed(3)===iphoneAspect){return!0}}
function t975_checkAnchorLinks(recid,selector){var rec=document.getElementById('rec'+recid);var anchorSelector=selector+'[href*="#"]:not(.tooltipstered)';var navLinks=rec?rec.querySelectorAll(anchorSelector):[];if(navLinks.length){t_onFuncLoad('t_menu__updateActiveLinks',function(){t_menu__updateActiveLinks(navLinks,selector)})}}
function t975_handleScroll(menu){var lastScrollTop=0;var delta=5;var timerID;var diff;window.addEventListener('scroll',function(){var scrollHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight);var isClicked=menu?menu.getAttribute('data-clicked-link'):'';var currentScrollTop=window.pageYOffset;if(Math.abs(lastScrollTop-currentScrollTop)<=delta||window.pageYOffset<0||window.pageYOffset>scrollHeight-window.innerHeight){return}
if(menu&&menu.getAttribute('data-hidemenuonscroll')&&!isClicked){var menuHeight=menu.offsetHeight;var currentTransformValue=menu.style.transform;if(currentScrollTop>lastScrollTop&&window.pageYOffset<=scrollHeight-(window.innerHeight+menuHeight)){diff=0;if(currentTransformValue){diff=parseInt(currentTransformValue.replace('translateY(',''),10)}
clearInterval(timerID);timerID=setInterval(function(){menu.style.transform='translateY('+diff+'px)';diff+=menuHeight/50;if(diff>=menuHeight){menu.style.transform='translateY('+menuHeight+'px)';clearInterval(timerID)}})}else{diff=menuHeight;if(currentTransformValue){diff=parseInt(currentTransformValue.replace('translateY(',''),10)}
clearInterval(timerID);timerID=setInterval(function(){menu.style.transform='translateY('+diff+'px)';diff-=menuHeight/50;if(diff<=0){menu.style.transform='translateY(0px)';clearInterval(timerID)}})}}
lastScrollTop=currentScrollTop})}