var $JQAttivaCookie = jQuery.noConflict(); $JQAttivaCookie(document).ready(function() { CookieAttivaScript(); }); function CookieAttivaScript() { var consensoString=getCookie('CookieConsensoInfo'); if(consensoString) { var consensoArray=JSON.parse(consensoString); delete consensoArray["dataora"]; delete consensoArray["stamp"]; var scriptEval=""; $JQAttivaCookie.each(consensoArray, function(cookiecategory, element) { if(element) { $JQAttivaCookie("script[data-cookiecategory='"+cookiecategory+"']").each(function() { $JQAttivaCookie.globalEval($JQAttivaCookie(this).text()); }); $JQAttivaCookie("iframe[data-cookiecategory='"+cookiecategory+"']").each(function() { //$JQAttivaCookie("+ aside.area-cookie2021-avviso-blocco", $JQAttivaCookie(this)).remove(); $JQAttivaCookie(this).attr('src', $JQAttivaCookie(this).attr('cookieIframe-src')); }); } else { $JQAttivaCookie("iframe[data-cookiecategory='"+cookiecategory+"']").each(function() { $JQAttivaCookie(this).attr('src', ''); //$JQAttivaCookie("+ aside.area-cookie2021-avviso-blocco", $JQAttivaCookie(this)).remove(); //$JQAttivaCookie(this).append(' '); $JQAttivaCookie(this).load(function(event){ $JQAttivaCookie(this).contents().find('body').html('
Accetta i cookies per visualizzare questo contenuto
'); }); }); } }); } } 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-impostazioni").hide(); $JQCookie("#area-cookie2021-selezionati").show(); return false; }); }); function setCookieConsensoInfo() { var arrayConsenso=new Array(); var index=0; $JQCookie("input[name^='consensocookie']").each(function() { arrayConsenso[index]='"'+$JQCookie(this).attr('data-category')+'":'+$JQCookie(this).prop('checked'); index++; }); var consenso='{'+arrayConsenso.join(', ')+'}'; $JQCookie.post("cookiebanner.php", {"azione": "setcookie", "consenso": consenso} , function( data ) { $JQCookie("#area-cookie2021").fadeOut(300); $JQCookie("#area-cookie2021-sfondo").hide(); $JQCookie("#area-cookie2021-promemoria").show(); CookieAttivaScript(); }); }