(function() {const configuration = {}; const fragmentElement = document.querySelector('#fragment-77152e56-1a47-78c0-6f80-e3acad62edf9'); const fragmentEntryLinkNamespace = 'amsu'; const fragmentNamespace = 'amsu'; const layoutMode = 'view'; var divElements = document.getElementById('myDiv').getElementsByTagName('*'); if (divElements.length >= 2) { divElements[1].classList.add('Cher'); } const urlSegments = window.location.pathname.split('/'); const hasCookieConsent = urlSegments.includes('cookie-concent'); const hasDataProtection = urlSegments.includes('general-data-protection-policy'); const hasCookieDefinition = urlSegments.includes('cookies-definition'); $( document ).ready(function() { function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); let expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { let name = cname + "="; let ca = document.cookie.split(';'); for(let i = 0; i < ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function checkCookie() { let isPopup = getCookie("policy-popup"); let isVedioPopup = getCookie("vedio-popup"); if((isPopup != "true" || isPopup == "") && !hasCookieDefinition && !hasDataProtection) { if(!sessionStorage.getItem('cookieRejected') || hasCookieConsent){ $("#cookie-consent-wrap").addClass("active-popup"); } else if((isVedioPopup != "true" || isVedioPopup == "")) { //openVedioPopup(); setCookie("vedio-popup", true, 7); } //setCookie("policy-popup", false, 365); } else if((isVedioPopup != "true" || isVedioPopup == "")) { //openVedioPopup(); setCookie("vedio-popup", true, 7); } /*if (isPopup == "") { $("#cookie-consent-wrap").addClass("active-popup"); } else { if (isPopup == "" && isPopup == null) { setCookie("policy-popup", true, 365); } }*/ } checkCookie(); $( "#acceptCookie" ).on( "click", function() { setCookie("policy-popup", true, 365); let isPopup = getCookie("policy-popup"); $("#cookie-consent-wrap").removeClass("active-popup"); sessionStorage.setItem('cookieRejected', false); if (hasCookieConsent) { // history.back(); window.location.href = sessionStorage.getItem('currentUrl-cookie-concent'); } //openVedioPopup(); setCookie("vedio-popup", true, 7); document.querySelector('.ChatBoxButon').click(); }); $( "#declineCookie" ).on( "click", function() { $("#cookie-consent-wrap").removeClass("active-popup"); sessionStorage.setItem('cookieRejected', true); if (hasCookieConsent) { history.go(-2); } document.querySelector('.ChatBoxButon').click(); //openVedioPopup(); setCookie("vedio-popup", true, 7); }); $('#privacy-check').change(function() { let isPrivacyChecked = $('#privacy-check').is(':checked'); console.log(isPrivacyChecked); if(!isPrivacyChecked) { $("#privacy-btn-wrap").addClass("active-btn"); } else { $("#privacy-btn-wrap").removeClass("active-btn"); } }); }); ;}());