1var config = {}; 2config.enabled = 1; 3config.text = 'Cookies help us deliver our services. By using our services, you agree to our use of cookies.'; 4config.moreLinkUrl = '/privacy-policy.html'; 5config.moreLinkLabel = 'Learn more'; 6config.buttonLabel = 'Got it!'; 7config.position = 'top'; 8 9if (config.enabled) { 10 11 var euCookieInitialized = false; 12 13 var hasCookie = function(key, value) { 14 var regexp = new RegExp(key + '=' + value); 15 return regexp.test(document.cookie); 16 }; 17 18 var addEuCookieWidget = function(config) { 19 if (hasCookie('eucookieconsent', '1') || euCookieInitialized) { 20 return; 21 } 22 var body = document.querySelector('body'); 23 var head = document.querySelector('head'); 24 var css = document.createElement('STYLE'); 25 var widgetBar = document.createElement('DIV'); 26 var widgetText = document.createElement('P'); 27 var widgetMoreLink = document.createElement('A'); 28 var widgetButton = document.createElement('button'); 29 30 widgetBar.className = 'eucookiebar'; 31 if (config.position === 'bottom') { 32 widgetBar.className = widgetBar.className + ' bottom'; 33 } 34 widgetText.innerHTML = config.text + ' '; 35 widgetMoreLink.href = config.moreLinkUrl; 36 widgetMoreLink.target = '_blank'; 37 widgetMoreLink.innerHTML = config.moreLinkLabel; 38 widgetButton.innerHTML = config.buttonLabel; 39 widgetText.appendChild(widgetMoreLink); 40 widgetText.innerHTML += '.'; 41 widgetBar.appendChild(widgetText); 42 widgetBar.appendChild(widgetButton); 43 44 css.type = 'text/css'; 45 css.innerHTML = '.eucookiebar button,.eucookiebar p{display:inline-block;margin:.25em .5em !important;font-family:"Lucida Grande",Geneva,Arial,Verdana,sans-serif !important;}' + 46 '.eucookiebar{text-align:center;position:absolute;top:-100px;left:0;right:0;background:#fff;padding:.5% 2%;box-shadow:0 4px 10px 1px rgba(0,0,0,.2);z-index:1000;font-size:12px;font-family:"Lucida Grande",Geneva,Arial,Verdana,sans-serif;color:#666;transition:top .5s ease,bottom .5s ease}' + 47 '.eucookiebar a{color:#00f;font-weight:400;text-decoration:underline}' + 48 '.eucookiebar a:visited{color:#551A8B}' + 49 '.eucookiebar a:active{color:red}' + 50 '.eucookiebar button{background:#eee;border:1px solid #888;border-radius:4px;font-size:100%;font-weight:700;color:#666}' + 51 '.eucookiebar button:hover{background:#666;color:#fff}' + 52 '.eucookiebar.show{top:0;}' + 53 '.eucookiebar.hide{top:-100px;}' + 54 '.eucookiebar.bottom{top:auto;bottom:-100px;position:fixed;}' + 55 '.eucookiebar.bottom.show{bottom:0;}' + 56 '.eucookiebar.bottom.hide{bottom:-100px;}'; 57 58 head.appendChild(css); 59 body.appendChild(widgetBar); 60 61 // Without the setTimeout the animation would not work. 62 setTimeout(function() { 63 widgetBar.className = widgetBar.className + ' show'; 64 }, 10); 65 66 widgetButton.addEventListener("click", function () { 67 var expires = new Date(); 68 expires.setFullYear(expires.getFullYear() + 10); 69 document.cookie = 'eucookieconsent=1; expires=' + expires.toUTCString(); 70 widgetBar.className = widgetBar.className + ' hide'; 71 }, false); 72 73 euCookieInitialized = true; 74 }; 75 76 var euCookieInit = function() { 77 document.addEventListener("DOMContentLoaded", function () {
78 addEuCookieWidget(config); 79 }, false); 80 81 // Make sure the bar is added if the JS file loads after DOMContentLoaded. 82 if (!euCookieInitialized) { 83 addEuCookieWidget(config); 84 } 85 }; 86 87 var xhrSuccess = function() { 88 this.callback.apply(this, this.arguments); 89 }; 90 91 var xhrError = function() { 92 console.error(this.statusText); 93 }; 94 95 var loadURL = function(sURL, fCallback /*, argumentToPass1, argumentToPass2, etc. */) { 96 var oReq = new XMLHttpRequest(); 97 oReq.callback = fCallback; 98 oReq.arguments = Array.prototype.slice.call(arguments, 2); 99 oReq.onload = xhrSuccess; 100 oReq.onerror = xhrError; 101 oReq.open("get", sURL, true); 102 oReq.send(null); 103 }; 104 105 var testCountry = function() { 106 var country = this.getResponseHeader('x-request-country'); 107 var euVisitor = /Austria|Belgium|Bulgaria|Croatia|Cyprus|Czech Republic|Denmark|Estonia|Finland|France|Germany|Greece|Hungary|Ireland|Italy|Latvia|Lithuania|Luxembourg|Malta|Netherlands|Poland|Portugal|Romania|Slovakia|Slovenia|Spain|Sweden|United Kingdom/.test(country); 108 if (euVisitor) { 109 euCookieInit(); 110 } 111 }; 112 113 if (hasCookie('ss_beta_ui', '1')) { 114 euCookieInit(); 115 } else { 116 loadURL('/sd/support-files/eucookie.js', testCountry); 117 } 118}
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.