1// Creare's 'Implied Consent' EU Cookie Law Banner v:2.4 2// Conceived by Robert Kent, James Bavington & Tom Foyster 3 4var dropCookie = true; // false disables the Cookie, allowing you to style the banner 5var cookieDuration = 365; // Number of days before the cookie expires, and the banner reappears 6var cookieName = 'complianceCookie'; // Name of our cookie 7var cookieValue = 'on'; // Value of cookie 8 9function createDiv(){ 10 var bodytag = document.getElementsByTagName('body')[0]; 11 var div = document.createElement('div'); 12 div.setAttribute('id','cookie-law'); 13 div.innerHTML = '<p>Questo sito utilizza i cookie per rendere migliore la tua esperienza di navigazione. Continuando la navigazione accetti l\'utilizzo dei cookie secondo quanto descritto nei <a href="/termini-condizioni" rel="nofollow" title="Termini e condizioni" target="_blank">Termini e condizioni</a>. <a class="close-cookie-banner btn btn-primary" href="javascript:void(0);" onclick="removeMe();"><span>Chiudi</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 // Create the cookie 23} 24 25 26function 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 38function checkCookie(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 49function eraseCookie(name) { 50 createCookie(name,"",-1); 51} 52 53window.onload = function(){ 54 if(checkCookie(window.cookieName) != window.cookieValue){ 55 createDiv(); 56 } 57} 58 59function removeMe(){ 60 var element = document.getElementById('cookie-law'); 61 element.parentNode.removeChild(element); 62 63 createCookie(window.cookieName,window.cookieValue, window.cookieDuration); 64}
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.