Search The Site

Showing 1 of 1



Showing 1 of 1

function getCookie(name) { const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); return match ? match[2] : null; } function showContestPopup() { console.log("contestpopup"); // Prevent popup inside iframes if (window.self !== window.top) return; // Check if the contest popup was already shown (based on cookie) if (getCookie('contestPopupShown')) return; // Delay popup display — show after 15 seconds on site setTimeout(() => { $('#NewsLetterPopup').modal('show'); // Set cookie to remember popup shown for 100 days const expirationDate = new Date(); expirationDate.setDate(expirationDate.getDate() + 100); document.cookie = 'contestPopupShown=1; expires=' + expirationDate.toUTCString() + '; path=/; SameSite=Lax; Secure'; }, 1000); // 15000ms = 15 seconds } // Trigger when page fully loads window.addEventListener('load', showContestPopup);