function setCookie(name, value, days) { const expires = new Date(); expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000); document.cookie = name + "=" + value + ";expires=" + expires.toUTCString() + ";path=/"; } function getCookie(name) { const nameEQ = name + "="; const ca = document.cookie.split(";"); for (let i = 0; i < ca.length; i++) { let c = ca[i]; while (c.charAt(0) === " ") c = c.substring(1, c.length); if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); } return null; } if (getCookie("bannerDismissed") === "true") { // Inject CSS to hide the banner before page renders const style = document.createElement("style"); style.innerHTML = ".banner2_wrapper { display: none !important; }"; document.head.appendChild(style); }