document.addEventListener('DOMContentLoaded', function() { const cookieConsent = document.getElementById('cookie-consent'); const acceptButton = document.getElementById('accept-cookies'); const rejectButton = document.getElementById('reject-cookies'); function setCookie(name, value, days) { let expires = ""; if (days) { const date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; 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('cookieConsent')) { cookieConsent.style.display = 'block'; } acceptButton.addEventListener('click', function() { setCookie('cookieConsent', 'accepted', 365); cookieConsent.style.display = 'none'; // Here you would enable your cookies and tracking scripts }); rejectButton.addEventListener('click', function() { //setCookie('cookieConsent', 'rejected', 365); //cookieConsent.style.display = 'none'; window.location.href = 'about:blank'; // Here you would ensure cookies are disabled (except necessary ones) }); });