$(document).ready(function(){ var hasCookies = false; // verifica se il browser accetta i cookie if (document.cookie == '') { document.cookie = 'hasCookies=yes'; if (document.cookie.indexOf('hasCookies=yes') != -1) hasCookies = true; } else hasCookies = true; // sets a cookie in the browser. function setCookie(sName, sValue, iHours, sPath) { if (hasCookies) { var numHours = false; if (iHours) { if ((typeof(iHours) == 'string') && Date.parse(iHours)) numHours = iHours; else if (typeof(iHours) == 'number') numHours = (new Date((new Date()).getTime() + iHours * 3600000)).toGMTString(); } document.cookie = sName + '=' + escape(sValue) + (numHours ? (';expires=' + numHours) : '') + ((sPath) ? (';path=' + sPath) : ('')); } } // reads a cookie from the browser function readCookie(name) { if (document.cookie == '') return ''; else { var firstChar, lastChar; var theBigCookie = document.cookie; firstChar = theBigCookie.indexOf(name); if (firstChar != -1) { firstChar += name.length + 1; lastChar = theBigCookie.indexOf(';', firstChar); if (lastChar == -1) lastChar = theBigCookie.length; return unescape(theBigCookie.substring(firstChar, lastChar)); } else return ''; } } var privacymodaltitle = 'Abbiamo aggiornato la Privacy Policy'; var privacymodaltext = 'Abbiamo riscritto la Privacy Policy per spiegare in modo ancora piĆ¹ chiaro come proteggiamo i tuoi dati. Puoi consultarla dal menu, alla voce Privacy.'; var privacymodalbutton = 'Chiudi'; var contentmodal = ''; contentmodal += '
'; contentmodal += '

'+privacymodaltitle+'

'; contentmodal += '

'+privacymodaltext+'

'; contentmodal += '

'+privacymodalbutton+'

'; contentmodal += '
'; var ckiavvisoprivacy = readCookie('avvisoprivacy'); if(ckiavvisoprivacy != 1){ $.magnificPopup.open({ items: { src: $(contentmodal), }, type: 'inline', modal: true, callbacks: { close: function () { setCookie('avvisoprivacy', 1, 4300); }, } }) } })