function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
var Checked_preferenze = Checked_marketing = Checked_statistiche = "";
var cookie_prechoice = getCookie("clion_cookie");
if(typeof cookie_prechoice !== 'undefined'){
var arrChoices = cookie_prechoice.split('-');
if(arrChoices[0]==1){ //checked
Checked_preferenze = "checked";
}
if(arrChoices[1]==1){ //checked
Checked_statistiche = "checked";
}
if(arrChoices[2]==1){ //checked
Checked_marketing = "checked";
}
}
function scriviCookie(nomeCookie,valoreCookie,durataCookie)
{
var scadenza = new Date();
var adesso = new Date();
scadenza.setTime(adesso.getTime() + (parseInt(durataCookie) * 60000));
document.cookie = nomeCookie + '=' + escape(valoreCookie) + '; expires=' + scadenza.toGMTString() + '; path=/';
console.log("cookie");
}
function scriviCookie_time(nomeCookie,valoreCookie,durataCookie)
{
var scadenza = new Date();
var adesso = new Date();
scadenza.setTime(adesso.getTime() + (parseInt(durataCookie)));
document.cookie = nomeCookie + '=' + escape(valoreCookie) + '; expires=' + scadenza.toGMTString() + '; path=/';
console.log("cookie");
}
function toggleCookiebar(){
console.log('toggleCookiebar');
var el = document.querySelector('#clion_cookieBar');
el.classList.toggle('clion_cookieBar__show');
}
function trayToggleCookiebar(){
console.log('trayToggleCookiebar');
var el = document.querySelector('#clion_cookieBar');
el.classList.toggle('clion_cookieBar__tray');
}
function richiesta_ajax()
{
var isChecked_preferenze = isChecked_marketing = isChecked_statistiche = 0;
if(document.getElementById('clion_preferenze').checked){ //checked
isChecked_preferenze = 1;
}
if(document.getElementById('clion_marketing').checked){ //checked
isChecked_marketing = 1;
}
if(document.getElementById('clion_statistiche').checked){ //checked
isChecked_statistiche = 1;
}
scriviCookie( 'clion_cookie' ,isChecked_preferenze+'-'+isChecked_statistiche+'-'+isChecked_marketing,43200);
var xmlhttp = new XMLHttpRequest();
xmlhttp.withCredentials = true;
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4
if (xmlhttp.status == 200) {
console.log("fatto");
document.getElementById('frame_cookie').contentWindow.location.reload(true);
}
else if (xmlhttp.status == 400) {
console.log("errore");
}
else {
alert('something else other than 200 was returned');
}
}
};
window.location.reload();
}
function richiesta_ajax_refuse()
{
var isChecked_preferenze = isChecked_marketing = isChecked_statistiche = 0;
isChecked_preferenze = 0;
isChecked_marketing = 0;
isChecked_statistiche = 0;
scriviCookie_time( 'clion_cookie' ,isChecked_preferenze+'-'+isChecked_statistiche+'-'+isChecked_marketing, 180 * 24 * 60 * 60 * 1000);
var xmlhttp = new XMLHttpRequest();
xmlhttp.withCredentials = true;
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4
if (xmlhttp.status == 200) {
console.log("fatto");
document.getElementById('frame_cookie').contentWindow.location.reload(true);
}
else if (xmlhttp.status == 400) {
console.log("errore");
}
else {
alert('something else other than 200 was returned');
}
}
};
window.location.reload();
}
if (document.cookie.length > 0)
{
var inizio = document.cookie.indexOf( "ade9efe5ec294d678b17591938dc4234" + "=");
var inizio_gdpr = document.cookie.indexOf( "clion_cookie" + "=");
var tray_if_compiled = "";
if ((inizio != -1)||(inizio_gdpr != -1))
{
// already compiled
tray_if_compiled = "clion_cookieBar__tray";
// /already compiled
}
//else {
// not compiled
document.write('');
document.write('
');
document.write('
');
document.write('
Le tue preferenze cookie
');
document.write('');
document.write('
Questo sito web utilizza i cookie ▴
');
document.write('
');
document.write('Utilizziamo i cookies per personalizzare contenuti ed annunci, per fornire funzionalità dei social media e per analizzare il nostro traffico. Condividiamo inoltre informazioni sul modo in cui utilizza il nostro sito con i nostri partner che si occupano di analisi dei dati web, pubblicità e social media, i quali potrebbero combinarle con altre informazioni che ha fornito loro o che hanno raccolto dal suo utilizzo dei loro servizi. Acconsenta ai nostri cookies se continua ad utilizzare il nostro sito web.');
document.write('
');
document.write('Utilizziamo i cookies per personalizzare contenuti ed annunci, per fornire funzionalità dei social media e per analizzare il nostro traffico. Condividiamo inoltre informazioni sul modo in cui utilizza il nostro sito con i nostri partner che si occupano di analisi dei dati web, pubblicità e social media, i quali potrebbero combinarle con altre informazioni che ha fornito loro o che hanno raccolto dal suo utilizzo dei loro servizi. Acconsenta ai nostri cookies se continua ad utilizzare il nostro sito web.');
document.write('