1/* PH4L Pop Up */ 2var popupDiv = document.createElement('div'); 3popupDiv.setAttribute('id', 'popup-bg'); 4var popupHtml = '<div id="announcement-popup" class="consent-popup"></div>'; 5popupDiv.innerHTML = popupHtml; 6 7function getCookieNL(c_name) { 8 var i, x, y, ARRcookies = document.cookie.split(";"); 9 for (i = 0; i < ARRcookies.length; i++) 10 { 11 x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); 12 y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); 13 x = x.replace(/^\s+|\s+$/g, ""); 14 if (x == c_name) 15 { 16 return unescape(y); 17 } 18 } 19} 20 21function setCookieNL(c_name, value, exdays) { 22 var exdate = new Date(); 23 exdate.setDate(exdate.getDate() + exdays); 24 var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); 25 document.cookie = c_name + "=" + c_value + "; path=/"; 26} 27 28function checkCookieNL() { 29 var cookieName = "jsAnnouncementPopup"; 30 var cookieChk = getCookieNL(cookieName); 31 32 dev = false; 33 34 if (cookieChk == undefined) { 35 setCookieNL(cookieName, 'first', 1); 36 showPopup(); 37 } else if (cookieChk !== 'hide' || dev == true) { 38 showPopup(); 39 } 40} 41 42function showPopup() { 43 if (checkCookieNL) { 44 var target = document.querySelector('body'); 45 46 target.appendChild(popupDiv); 47 48 document.getElementById('popup-bg').classList.add('open'); 49 50 var popup = document.getElementById('announcement-popup'); 51 52 popup.innerHTML = '<a href="/marketing-consent" class="gtmpopupclick" onclick="popupClick()"><img src="/media/templates/site/clickingmad/images/consent-capture-popup.webp" alt="Helping you care for your pet, every day" width="650" height="488" /></a><a href="#" class="popup-close" onclick="closePopup()">X</a>'; 53 } 54} 55 56function closePopup() { 57 event.preventDefault(); 58 var cookieName = "jsAnnouncementPopup"; 59 setCookieNL(cookieName, 'hide', 1); 60 61 document.getElementById('popup-bg').classList.remove('open'); 62} 63 64function popupClick() { 65 event.preventDefault(); 66 var cookieName = "jsAnnouncementPopup"; 67 setCookieNL(cookieName, 'hide', 1); 68 69 // lets set a cookie which can be used for future tracking if the user allows it 70 setCookieNL("popupclicked", 'clicked', 1); 71 window.location.href = "https://www.norwoodvets.co.uk/marketing-consent"; 72 window.dataLayer = window.dataLayer || []; 73 74 dataLayer.push({ 75 'event': 'ckmpopupclick' 76 }); 77} 78 79document.addEventListener("DOMContentLoaded", function() { 80 checkCookieNL(); 81});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.