<script>
document.addEventListener("DOMContentLoaded", function() {
$('[id=sw-email-capture-submit-btn]').click(function() {
if($('.sw-input-invalid').length) {
return;
}
setTimeout(function(){
const domain = window.location.host;
setCookie('emailCaptureForListOfEvents', 'done', 90);
window.location.href= 'https://' + domain + '/list-of-events';
}, 1500);
});
function setCookie(name, value, days) {
const date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
const expires = "expires="+ date.toUTCString();
document.cookie = name + "=" + value + ";" + expires + ";" + "samesite=none;secure;";
}
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
var domain = window.location.host;
const emailCaptureForListOfEvents = getCookie('emailCaptureForListOfEvents');
if(emailCaptureForListOfEvents !== 'done') {
window.location.href= 'https://' + domain + '/';
}
function getCookie(cookieName) {
var name = cookieName + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
});
</script>