var $JQAttivaCookie = jQuery.noConflict(); $JQAttivaCookie(document).ready(function() { CookieAttivaScript(); }); function CookieAttivaScript() { var consensoString=''; $JQAttivaCookie("#area-cookie2021-promemoria").hide(); $JQAttivaCookie("#area-cookie2021-sfondo").show(); $JQAttivaCookie("#area-cookie2021").show(); }; var $JQCookie = jQuery.noConflict(); $JQCookie(document).ready(function() { $JQCookie("#area-cookie2021-chiudi").unbind("click"); $JQCookie("#area-cookie2021-necessari").unbind("click"); $JQCookie("#area-cookie2021-selezionati").unbind("click"); $JQCookie("#area-cookie2021-tutti").unbind("click"); $JQCookie("#area-cookie2021-promemoria").unbind("click"); $JQCookie("#area-cookie2021-impostazioni").unbind("click"); var ScreenHeight=window.innerHeight; var bottomAreaCookie=$JQCookie("#area-cookie2021").css("bottom").replace('px',''); if(bottomAreaCookie==0) { bottomAreaCookie=$JQCookie(".area-cookie2021-contenuto").css("bottom").replace('px',''); } if(bottomAreaCookie<0 || bottomAreaCookie=='auto') { bottomAreaCookie=0; } var heightAreaCookie=$JQCookie("#area-cookie2021").outerHeight(true); if(heightAreaCookie==0) { heightAreaCookie=$JQCookie(".area-cookie2021-contenuto").outerHeight(true); } var heightDettagliCookie=0; if($JQCookie(".area-cookie2021-contenuto-dettagli-cookie").css('display')!='none') { heightDettagliCookie=$JQCookie(".area-cookie2021-contenuto-dettagli-cookie").outerHeight(true); } var heightAreaCookie2=heightAreaCookie-heightDettagliCookie; var maxHeight=ScreenHeight-heightAreaCookie2-(bottomAreaCookie*2); $JQCookie(".area-cookie2021-contenuto-dettagli-cookie").css({"max-height":maxHeight+"px"}); //consenso solo ai necessari + chiusura banner $JQCookie("#area-cookie2021-chiudi, #area-cookie2021-necessari").click(function(){ $JQCookie("input:not([disabled])[name^='consensocookie']").prop('checked',false); setCookieConsensoInfo(); }); //consenso solo ai selezionati $JQCookie("#area-cookie2021-selezionati").click(function(){ setCookieConsensoInfo(); }); //consenso tutti $JQCookie("#area-cookie2021-tutti").click(function(){ $JQCookie("input:not([disabled])[name^='consensocookie']").prop('checked',true); setCookieConsensoInfo(); }); // bannerino promemoria $JQCookie("#area-cookie2021-promemoria").click(function(){ $JQCookie("#area-cookie2021-sfondo").show(); $JQCookie("#area-cookie2021").show(); $JQCookie("#area-cookie2021-promemoria").hide(); }); $JQCookie("#area-cookie2021-impostazioni").click(function(e, first){ e.preventDefault(); $JQCookie(".area-cookie2021-contenuto-dettagli-cookie").slideToggle(first ? 0 : 400); $JQCookie(".area-cookie2021-contenuto-dettagli-cookie").css({"overflow-y":"auto"}); $JQCookie("#area-cookie2021-impostazioni").hide(); $JQCookie("#area-cookie2021-selezionati").show(); return false; }); }); function setCookieConsensoInfo(txtconsenso='') { $JQCookie("#area-cookie2021").fadeOut(300); $JQCookie("#area-cookie2021-sfondo").hide(); $JQCookie("#area-cookie2021-promemoria").show(); }; function RemoveCookie() { var cookies = document.cookie.split("; "); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; var eqPos = cookie.indexOf("="); var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; //console.log(cookie) //console.log(eqPos) //console.log(name) if(name!='PHPSESSID') { document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } } }