1 // Creare's 'Implied Consent' EU Cookie Law Banner v:2.4 2 // Conceived by Robert Kent, James Bavington & Tom Foyster 3 4 var dropCookie = true; // false disables the Cookie, allowing you to style the banner 5 var cookieDuration = 14; // Number of days before the cookie expires, and the banner reappears 6 var cookieName = 'haddenhamCookie'; // Name of our cookie 7 var cookieValue = 'on'; // Value of cookie 8 9 function createDiv(){ 10 var bodytag = document.getElementsByTagName('body')[0]; 11 var div = document.createElement('div'); 12 div.setAttribute('id','cookie-law'); 13 div.innerHTML = '<p>Our website uses cookies. By continuing we assume your permission to deploy cookies, as detailed in our <a href="\cookies" rel="nofollow" title="Privacy & Cookies Policy" target=_blank>privacy and cookies policy</a> <a class="close-cookie-banner" href="javascript:void(0);" onclick="removeMe();"><span>x</span></a></p>'; 14 // Be advised the Close Banner 'X' link requires jQuery 15 16 bodytag.appendChild(div); // Adds the Cookie Law Banner just before the closing </body> tag 17 // or 18 //bodytag.insertBefore(div,bodytag.firstChild); // Adds the Cookie Law Banner just after the opening <body> tag 19 20 document.getElementsByTagName('body')[0].className+=' cookiebanner'; //Adds a class tothe <body> tag when the banner is visible 21 22 createCookie(window.cookieName,window.cookieValue, window.cookieDuration); // Create the cookie 23 } 24 25 26 function createCookie(name,value,days) { 27 if (days) { 28 var date = new Date(); 29 date.setTime(date.getTime()+(days*24*60*60*1000)); 30 var expires = "; expires="+date.toGMTString(); 31 } 32 else var expires = ""; 33 if(window.dropCookie) { 34 document.cookie = name+"="+value+expires+"; path=/"; 35 } 36 } 37 38 function checkCookie2(name) { 39 var nameEQ = name + "="; 40 var ca = document.cookie.split(';'); 41 for(var i=0;i < ca.length;i++) { 42 var c = ca[i]; 43 while (c.charAt(0)==' ') c = c.substring(1,c.length); 44 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 45 } 46 return null; 47 } 48 49 function eraseCookie(name) { 50 createCookie(name,"",-1); 51 } 52 53 window.onload = function() { 54 if (checkCookie2(window.cookieName) != window.cookieValue) { 55 createDiv(); 56 } 57 } 58 59 function removeMe(){ 60 var element = document.getElementById('cookie-law'); 61 element.parentNode.removeChild(element); 62 } 63
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.