/* Google Consent Mode v2 - ADVANCED. Tags load; only storage is denied until consent. */ window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);} gtag('consent','default',{ad_storage:'denied',analytics_storage:'denied',ad_user_data:'denied',ad_personalization:'denied',functionality_storage:'denied',personalization_storage:'denied',security_storage:'granted',wait_for_update:500}); gtag('set','url_passthrough',true); /* restore a returning visitor's stored choice (w5 key + payload shape) */ (function(){try{var p=JSON.parse(localStorage.getItem('cc-prefs'));if(p){ gtag('consent','update',{ad_storage:p.ads?'granted':'denied',analytics_storage:p.analytics?'granted':'denied',ad_user_data:p.ads?'granted':'denied',ad_personalization:p.ads?'granted':'denied',functionality_storage:'granted',personalization_storage:p.analytics?'granted':'denied'}); gtag('set','ads_data_redaction',p.ads?false:true); window.__avinuConsentChosen=true;}}catch(e){}})(); /* ---- header: shrink-on-scroll (rAF + passive, no layout read) + drawer a11y ---- */ (function(){ var h=document.querySelector('.tt-header'); var t=document.querySelector('.tt-nav__toggle'); var n=document.getElementById('tt-nav'); if(h){ var tick=false; window.addEventListener('scroll',function(){ if(tick){return;} tick=true; requestAnimationFrame(function(){ h.classList.toggle('is-scrolled', window.scrollY>40); tick=false; }); },{passive:true}); } if(t){ if(n){ t.addEventListener('click',function(){ var open=n.classList.toggle('is-open'); t.setAttribute('aria-expanded', open?'true':'false'); t.setAttribute('aria-label', open?'סגירת תפריט':'פתיחת תפריט'); document.body.style.overflow = open?'hidden':''; }); document.addEventListener('keydown',function(e){ if(e.key==='Escape'){ if(n.classList.contains('is-open')){ t.click(); t.focus(); } } }); n.addEventListener('click',function(e){ if(e.target.closest('a')){ if(n.classList.contains('is-open')){ t.click(); } } }); }} })(); (function(){ var K="cc-prefs", B=document.getElementById('avinu-cc2'); if(!B) return; /* NOTE: the delay-JS marker literals are deliberately avoided below - avinu's delay pass defers any inline script that contains them, which would keep the banner from ever appearing. */ var DL='data'+'Layer'; function gtag(){var w=window;w[DL]=w[DL]||[];w[DL].push(arguments)} /* ---- language of THIS page, measured from the rendered text. `html lang` is not used: it lied on tzurtours (declared en-US) and it lies the other way on bilingual sites, where a Hebrew-declared site serves whole English sections. The card is still display:none here, so innerText excludes its own words. */ var TXT={"he": {"title": "אנחנו משתמשים בעוגיות", "body": "עוגיות חיוניות פועלות תמיד. עוגיות מדידה ופרסום ייטענו רק לאחר אישורך.", "accept": "אישור", "reject": "רק חיוני", "privacy": "מדיניות פרטיות", "cookies": "מדיניות עוגיות", "manage": "ניהול העדפות", "save": "שמירת בחירה", "c_ess": "עוגיות חיוניות", "c_ess_n": "(פועלות תמיד)", "c_ana": "מדידה וניתוח", "c_ads": "פרסום ושיווק", "privacy_url": "/privacy/", "cookie_url": ""}, "en": {"title": "We use cookies", "body": "Essential cookies keep the site working and are always on. Analytics and marketing cookies load only with your consent.", "accept": "Accept all", "reject": "Essential only", "privacy": "Privacy Policy", "cookies": "Cookie Policy", "manage": "Manage preferences", "save": "Save choices", "c_ess": "Strictly necessary", "c_ess_n": "(always on)", "c_ana": "Analytics", "c_ads": "Marketing", "privacy_url": "/privacy/", "cookie_url": ""}}, DEF="he"; /* Switching AWAY from the site default needs a clear majority, not a bare one: site chrome ("Skip to content", "0 items", social names) puts Latin on every Hebrew page. Measured 2026-08-02 - a real English article on a Hebrew site runs latin/hebrew 7.4, while a Hebrew page whose chrome is Latin runs 1.8 and a WP stub 2.6. 3x separates them with room to spare. */ function pageLang(){ try{var t=(document.body.innerText||'').slice(0,30000); var he=(t.match(/[֐-׿]/g)||[]).length, la=(t.match(/[A-Za-z]/g)||[]).length; var mine=(DEF==='he')?he:la, other=(DEF==='he')?la:he; if(other>=300 && other>=mine*3){return DEF==='he'?'en':'he'} return DEF;}catch(e){return DEF}} function applyLang(L){ var t=TXT[L]||TXT[DEF]; if(!t)return; B.setAttribute('lang',L); B.style.direction=(L==='he')?'rtl':'ltr'; B.style.textAlign=(L==='he')?'right':'left'; function put(id,v){var e=document.getElementById(id);if(e&&v!=null){e.textContent=v}} put('avinu-cc2-h',t.title); put('avinu-cc2-body',t.body); put('avinu-cc2-yes',t.accept); put('avinu-cc2-no',t.reject); put('avinu-cc2-manage',t.manage); put('avinu-cc2-save',t.save); var pp=document.getElementById('avinu-cc2-pp'); if(pp){pp.textContent=t.privacy; if(t.privacy_url){pp.setAttribute('href',t.privacy_url)}} var cp=document.getElementById('avinu-cc2-cp'); if(cp){ if(t.cookie_url===''){var sp=B.querySelector('.cc2-sep'); if(sp&&sp.parentNode){sp.parentNode.removeChild(sp)} cp.parentNode.removeChild(cp);} else{cp.textContent=t.cookies; if(t.cookie_url){cp.setAttribute('href',t.cookie_url)}}} var lb=B.querySelectorAll('.cc2-opt'); if(lb.length===3&&t.c_ess){ lb[0].lastChild&&(lb[0].childNodes[1].nodeValue=' '+t.c_ess+' '); lb[0].querySelector('.cc2-note')&&(lb[0].querySelector('.cc2-note').textContent=t.c_ess_n); lb[1].childNodes[1]&&(lb[1].childNodes[1].nodeValue=' '+t.c_ana); lb[2].childNodes[1]&&(lb[2].childNodes[1].nodeValue=' '+t.c_ads);}} applyLang(pageLang()); /* RAW=true for the sites whose stored choice is the plain string 'all'/'essential' (the older card); the rest keep their JSON object. Format must not change, or a returning visitor is asked again and the head-side restore stops matching. */ var RAW=false; function dec(v){if(v==null||v==='')return null;if(RAW)return v; try{return JSON.parse(v)}catch(e){return null}} function enc(p){return RAW?String(p):JSON.stringify(p)} function get(){try{var v=localStorage.getItem(K);var d=dec(v);if(d)return d}catch(e){} var m=document.cookie.match(new RegExp('(?:^|;\\s*)'+K+'=([^;]+)')); if(m){try{return dec(decodeURIComponent(m[1]))}catch(e){}}return null} function save(p){var d=new Date();d.setFullYear(d.getFullYear()+1); try{document.cookie=K+'='+encodeURIComponent(enc(p))+';expires='+d.toUTCString()+';path=/;SameSite=Lax'+(location.protocol==='https:'?';Secure':'')}catch(e){} try{localStorage.setItem(K,enc(p))}catch(e){}} function apply(p){var ana=!!p.analytics, ads=!!p.ads; window.__avinuConsentChosen=true; window.__avinuOwnUpdate=true; gtag('consent','update',{ad_storage:ads?'granted':'denied',analytics_storage:ana?'granted':'denied', ad_user_data:ads?'granted':'denied',ad_personalization:ads?'granted':'denied', functionality_storage:'granted',personalization_storage:ana?'granted':'denied'}); gtag('set','ads_data_redaction',ads?false:true); window.__avinuOwnUpdate=false; try{if(window.fbq){fbq('consent',ads?'grant':'revoke')}}catch(e){} try{window[DL].push({event:'avinu_consent',avinu_consent:ads?'all':(ana?'analytics':'essential')})}catch(e){}} /* ---- floating widgets: measure, never guess. A hard-coded selector list is what let the accessibility launcher / chat bubble / scroll-top sit on top of the card. */ var moved=[]; function isBar(r){return r.width>=innerWidth*0.9 && r.bottom>=innerHeight-6} /* A tall thin rail (UserWay wraps its 44x44 launcher in a 44x761 container) crosses a bottom card no matter where the card goes, so the wrapper box is a false collision. Judge such a rail by what it ACTUALLY renders: the union of its visible children. On shv the launcher renders at y=-77 (off-screen above), i.e. the rail covers nothing at all - measured 2026-08-02, and raising the card above it only pushed the card into the middle of the screen for no gain. */ function eff(e,r){ if(!(r.height>innerHeight*0.5 && r.width<150))return r; var kids=e.querySelectorAll('*'), best=null, n=Math.min(kids.length,300); for(var i=0;i220)continue; if(q.bottom<=0||q.top>=innerHeight)continue; if(!best){best={top:q.top,bottom:q.bottom,left:q.left,right:q.right}} else{best.top=Math.min(best.top,q.top);best.bottom=Math.max(best.bottom,q.bottom); best.left=Math.min(best.left,q.left);best.right=Math.max(best.right,q.right)}} return best||{top:-9e5,bottom:-9e5+1,left:-9e5,right:-9e5+1}} function hits(a,b){return !(a.bottom<=b.top+4||a.top>=b.bottom-4||a.right<=b.left+4||a.left>=b.right-4)} function lift(){ var bb=B.getBoundingClientRect(); if(!bb.height) return; var need=Math.round(innerHeight-bb.top+12); var els=document.querySelectorAll('body *'); var n=Math.min(els.length,20000); for(var i=0;iinnerHeight*0.7&&r.width>innerWidth*0.7)continue; if(!hits(eff(e,r),bb))continue; if(e.hasAttribute('data-avcc2')||e.hasAttribute('data-avcc2-stub'))continue; /* a full-width bottom bar cannot be lifted without stacking two bars: hide it for as long as the card is open, restore it the moment a choice is made */ if(isBar(r)){e.setAttribute('data-avcc2','hide');e.setAttribute('data-avcc2-d',e.style.display||''); e.style.setProperty('display','none','important');moved.push(e);continue} e.setAttribute('data-avcc2','lift'); e.setAttribute('data-avcc2-b',e.style.bottom||''); e.setAttribute('data-avcc2-t',e.style.transform||''); var before=r.top; e.style.setProperty('bottom',need+'px','important'); var after=e.getBoundingClientRect().top; if(Math.abs(after-before)<2){ /* anchored by top/transform: bottom has no effect */ e.style.removeProperty('bottom'); var d=Math.round(r.bottom-bb.top+12); e.style.setProperty('transform',(e.style.transform?e.style.transform+' ':'')+'translateY(-'+d+'px)','important');} moved.push(e);} } function restore(){for(var i=0;i-1){moved.splice(k,1)}} function guard(){ var bb=B.getBoundingClientRect(); if(!bb.height)return; var stub=[],mt=Infinity; var els=document.querySelectorAll('body *'), n=Math.min(els.length,20000); for(var i=0;iinnerHeight*0.7&&r.width>innerWidth*0.7)continue; if(!hits(q,bb))continue; stub.push(e); if(q.top0&&raise tag on tipulzugi (tag present, 0 chars) and the card dropped to position:static half-way down the page. Inline styles survive every CSS optimiser, so the geometry is re-asserted from JS. */ var CR={"d": {"#": {"position": "fixed", "z-index": "2147483600", "bottom": "20px", "left": "50%", "right": "auto", "top": "auto", "transform": "translateX(-50%)", "width": "calc(100% - 48px)", "max-width": "1120px", "box-sizing": "border-box", "background": "#FFFFFF", "border": "1px solid rgba(16,23,32,.10)", "border-top": "4px solid #8A6A18", "border-radius": "18px", "box-shadow": "0 18px 48px rgba(9,12,18,.16)", "padding": "20px 26px", "margin": "0"}, ".cc2-row": {"display": "flex", "align-items": "center", "justify-content": "space-between", "gap": "26px", "flex-direction": "row"}, ".cc2-txt": {"flex": "1 1 auto", "min-width": "0"}, ".cc2-act": {"display": "grid", "grid-template-columns": "repeat(2,1fr)", "gap": "12px", "width": "326px", "flex": "0 0 auto"}, ".cc2-btn": {"display": "inline-flex", "align-items": "center", "justify-content": "center", "width": "100%", "height": "48px", "min-height": "48px", "padding": "0 14px", "margin": "0", "border-radius": "999px", "font-size": "15px", "font-weight": "700", "line-height": "1", "cursor": "pointer"}, ".cc2-yes": {"background": "#12233D", "color": "#FFFFFF", "border": "1.6px solid #12233D"}, ".cc2-no": {"background": "transparent", "color": "#12233D", "border": "1.6px solid #12233D"}, ".cc2-h": {"display": "block", "margin": "0 0 5px 0", "padding": "0", "font-size": "17px", "font-weight": "700", "color": "#101720"}, ".cc2-p": {"margin": "0", "padding": "0", "font-size": "14.5px", "font-weight": "400", "line-height": "1.6", "color": "#414B59"}}, "m": {"#": {"width": "calc(100% - 20px)", "bottom": "10px", "padding": "16px 18px", "border-radius": "16px"}, ".cc2-row": {"flex-direction": "column", "align-items": "stretch", "gap": "14px"}, ".cc2-act": {"width": "100%", "gap": "10px"}, ".cc2-h": {"font-size": "16px"}, ".cc2-p": {"font-size": "13.5px", "line-height": "1.55"}}}; function critical(){ var m=innerWidth<=900, S=CR.d, M=CR.m; function put(sel,o){var els=(sel==='#')?[B]:B.querySelectorAll(sel); for(var i=0;i