(function() { /* Boot marker — check window.IXU_BUILD in the console to confirm which version of this head markup is actually executing on the page. */ window.IXU_BUILD = '2026-11-27-popup-v2'; /* Popup banner config. Set linkUrl to '' to make the popup display-only (not clickable). Change storageKey for each new campaign so returning visitors see it. */ var POPUP = { enabled: true, imageUrl: '/sfsites/c/resource/ixupopupbannerblackfriday', linkUrl: '/category/sport/0ZGSe0000001CGrOAM', newTab: false, altText: 'IXU Sport Black Friday', storageKey: 'ixu_popup_v2', oncePer: 'session', /* 'session' or 'forever' */ homeOnly: false, delayMs: 1200 }; function popupSeen() { try { var store = POPUP.oncePer === 'forever' ? localStorage : sessionStorage; return !!store.getItem(POPUP.storageKey); } catch (e) { return false; } } function markPopupSeen() { try { var store = POPUP.oncePer === 'forever' ? localStorage : sessionStorage; store.setItem(POPUP.storageKey, '1'); } catch (e) {} } function isHome() { var p = window.location.pathname.replace(/\/+$/, ''); return p === '' || p === '/s' || p === '/home'; } function showPopup() { if (!POPUP.enabled || popupSeen()) return; if (POPUP.homeOnly && !isHome()) return; if (document.querySelector('.ixu-popup-overlay')) return; var img = new Image(); img.alt = POPUP.altText; img.onload = function() { var overlay = document.createElement('div'); overlay.className = 'ixu-popup-overlay'; overlay.setAttribute('role', 'dialog'); overlay.setAttribute('aria-modal', 'true'); overlay.setAttribute('aria-label', POPUP.altText); var box = document.createElement('div'); box.className = 'ixu-popup-box'; var btn = document.createElement('button'); btn.className = 'ixu-popup-close'; btn.setAttribute('type', 'button'); btn.setAttribute('aria-label', 'Close'); btn.innerHTML = '×'; box.appendChild(btn); if (POPUP.linkUrl) { var a = document.createElement('a'); a.href = POPUP.linkUrl; if (POPUP.newTab) { a.target = '_blank'; a.rel = 'noopener'; } img.style.cursor = 'pointer'; a.appendChild(img); a.addEventListener('click', function() { close(); }); box.appendChild(a); } else { box.appendChild(img); } overlay.appendChild(box); document.body.appendChild(overlay); requestAnimationFrame(function() { overlay.classList.add('ixu-popup-show'); }); markPopupSeen(); function close() { overlay.classList.remove('ixu-popup-show'); document.removeEventListener('keydown', onKey); setTimeout(function() { if (overlay.parentNode) overlay.parentNode.removeChild(overlay); }, 300); } function onKey(e) { if (e.key === 'Escape') close(); } btn.addEventListener('click', close); overlay.addEventListener('click', function(e) { if (e.target === overlay) close(); }); document.addEventListener('keydown', onKey); }; img.src = POPUP.imageUrl; } function schedulePopup() { setTimeout(showPopup, POPUP.delayMs); } if (document.readyState === 'complete') { schedulePopup(); } else { window.addEventListener('load', schedulePopup); } function fixImages() { var imgs = document.querySelectorAll('.ixu-constrained-img img'); for (var i = 0; i < imgs.length; i++) { imgs[i].style.width = '100%'; imgs[i].style.height = '200px'; imgs[i].style.objectFit = 'fill'; imgs[i].style.maxWidth = 'none'; var imgDiv = imgs[i].closest('.image') || imgs[i].parentElement; if (imgDiv) { imgDiv.style.width = '100%'; } } } function updatePill() { var pill = document.querySelector('.ixu-pill-auto'); if (!pill) return; var items = document.querySelectorAll('[class*="breadcrumb"] li'); var crumbs = Array.from(items).map(function(li) { return li.textContent.trim(); }); if (!crumbs.length) return; var label = ''; if (crumbs.length === 1) { label = crumbs[0]; } else if (crumbs.length === 2) { label = crumbs[0] + ' - ' + crumbs[1].toUpperCase(); } else { label = crumbs[crumbs.length - 2] + ' - ' + crumbs[crumbs.length - 1].toUpperCase(); } if (label && pill.textContent !== label) { pill.textContent = label; } } /* Fix mobile video playback */ function fixVideos() { var videos = document.querySelectorAll('video'); for (var i = 0; i < videos.length; i++) { if (!videos[i].hasAttribute('playsinline')) { videos[i].setAttribute('playsinline', ''); videos[i].setAttribute('webkit-playsinline', ''); videos[i].setAttribute('disableRemotePlayback', ''); videos[i].removeAttribute('controls'); } } } setInterval(function() { updatePill(); fixVideos(); fixImages(); }, 300); var pushState = history.pushState; history.pushState = function() { pushState.apply(history, arguments); setTimeout(updatePill, 100); setTimeout(updatePill, 300); setTimeout(updatePill, 600); }; var replaceState = history.replaceState; history.replaceState = function() { replaceState.apply(history, arguments); setTimeout(updatePill, 100); setTimeout(updatePill, 300); setTimeout(updatePill, 600); }; })();