PageSourceSearch

https://www.campanialandtelling.it/wp-content/plugins/cookie-webag/assets/tarteaucitron.js?ver=7.1.3

js campanialandtelling.it collected 2026-10-07 13:16:11 UTC 51,481 bytes, 1,423 lines download raw bytes

1/*jslint browser: true, evil: true */
2
3
4/* Se non è presente il cookie tarteaucitron_uid, introdotto nel gennaio 2022, cancello il vecchio cookie tarteaucitron e faccio effettuare nuovamente la scelta all'utente */
5
6var tarte_uid_miss = (document.cookie.indexOf('tarteaucitron_uid') >= 0) ? false : true;
7
8function setCookie(cname, cvalue, exMins) {
9    var d = new Date();
10    d.setTime(d.getTime() + (exMins*60*1000));
11    var expires = "expires="+d.toUTCString();  
12    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
13}
14
15if (tarte_uid_miss) {
16	setCookie('tarteaucitron','',0) // this will delete the cookie.
17}
18
19
20
21// define correct path for files inclusion
22var scripts = document.getElementsByTagName('script');
23var script_index = scripts.length - 1;
24for (script in scripts) {
25	// questo script non si limita a prendere l'ultimo script caricato, ma ricerca proprio l'insert di tartaucitron
26	// così che sistemi che cachano o che injectano script sul dom in maniera asincrona non influiscano su tarteaucitron
27	if (scripts[script].src !== undefined && scripts[script].src.indexOf('tarteaucitron.js') !== -1) {
28		script_index = script;
29	}
30}
31var path = scripts[script_index].src.split('?')[0],
32	cdn = path.split('/').slice(0, -1).join('/') + '/',
33	alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
34	tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
35	tarteaucitronProLoadServices,
36	tarteaucitronNoAdBlocker = false;
37
38var tarteaucitron = {
39	"version": pluginInfo.version,
40	"cdn": cdn,
41	"user": {},
42	"lang": {},
43	"services": {},
44	"added": [],
45	"idprocessed": [],
46	"state": [],
47	"launch": [],
48	"implicitCookie": false,
49	"parameters": {},
50	"isAjax": false,
51	"reloadThePage": false,
52	"init": function (params) {
53		"use strict";
54		var origOpen;
55
56		tarteaucitron.parameters = params;
57		if (alreadyLaunch === 0) {
58			alreadyLaunch = 1;
59			if (window.addEventListener) {
60				window.addEventListener("load", function () {
61					tarteaucitron.load();
62					tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
63						elem.addEventListener("click", function (event) {
64							tarteaucitron.userInterface.openPanel();
65							event.preventDefault();
66						}, false);
67					}, true);
68				}, false);
69				if (cookieSettings.acceptFocusForm) {
70					var xforms = document.getElementsByTagName("form");
71					var i;
72					for (i = 0; i < xforms.length; i++) {
73						var e;
74						for (e = 0; e < xforms[i].elements.length; e++) {
75							xforms[i].elements[e].addEventListener('focus', function (e) {
76								if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) {
77									if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') {
78										tarteaucitron.userInterface.respondAll(true, 'focusAll');
79									}
80								}
81							});
82						}
83					}
84				}
85
86				window.addEventListener("keydown", function (evt) {
87					if (evt.keyCode === 27) {
88						tarteaucitron.userInterface.closePanel();
89					}
90				}, false);
91				window.addEventListener("hashchange", function () {
92					if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
93						tarteaucitron.userInterface.openPanel();
94					}
95				}, false);
96				window.addEventListener("resize", function () {
97					if (document.getElementById('tarteaucitron') !== null) {
98						if (document.getElementById('tarteaucitron').style.display === 'block') {
99							tarteaucitron.userInterface.jsSizing('main');
100						}
101					}
102
103					if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
104						if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') {
105							tarteaucitron.userInterface.jsSizing('cookie');
106						}
107					}
108				}, false);
109			} else {
110				window.attachEvent("onload", function () {
111					tarteaucitron.load();
112					tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
113						elem.attachEvent("onclick", function (event) {
114							tarteaucitron.userInterface.openPanel();
115							event.preventDefault();
116						});
117					}, true);
118				});
119				window.attachEvent("onkeydown", function (evt) {
120					if (evt.keyCode === 27) {
121						tarteaucitron.userInterface.closePanel();
122					}
123				});
124				window.attachEvent("onhashchange", function () {
125					if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
126						tarteaucitron.userInterface.openPanel();
127					}
128				});
129				window.attachEvent("onresize", function () {
130					if (document.getElementById('tarteaucitron') !== null) {
131						if (document.getElementById('tarteaucitron').style.display === 'block') {
132							tarteaucitron.userInterface.jsSizing('main');
133						}
134					}
135
136					if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
137						if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') {
138							tarteaucitron.userInterface.jsSizing('cookie');
139						}
140					}
141				});
142			}
143
144			if (typeof XMLHttpRequest !== 'undefined') {
145				origOpen = XMLHttpRequest.prototype.open;
146				XMLHttpRequest.prototype.open = function () {
147
148					if (window.addEventListener) {
149						this.addEventListener("load", function () {
150							if (typeof tarteaucitronProLoadServices === 'function') {
151								tarteaucitronProLoadServices();
152							}
153						}, false);
154					} else if (typeof this.attachEvent !== 'undefined') {
155						this.attachEvent("onload", function () {
156							if (typeof tarteaucitronProLoadServices === 'function') {
157								tarteaucitronProLoadServices();
158							}
159						});
160					} else {
161						if (typeof tarteaucitronProLoadServices === 'function') {
162							setTimeout(tarteaucitronProLoadServices, 1000);
163						}
164					}
165
166					try {
167						origOpen.apply(this, arguments);
168					} catch (err) {
169					}
170				};
171			}
172		}
173	},
174	"load": function () {
175		"use strict";
176		var cdn = tarteaucitron.cdn,
177			language = tarteaucitron.getLanguage(),
178			pathToLang = cdn + 'lang/tarteaucitron.' + language + '.js?v=' + tarteaucitron.version,
179			pathToServices = cdn + 'tarteaucitron.services.js?v=' + tarteaucitron.version,
180			linkElement = document.createElement('link'),
181			defaults = {
182				"adblocker": false,
183				"hashtag": '#tarteaucitron',
184				"highPrivacy": false,
185				"orientation": "top",
186				"removeCredit": false,
187				"customButton": false,
188				"customButtonHtml": '',
189				"cookieversion": '',
190				"customDirettiva": '',
191				"saveCookieChoice": '',
192				"customAlertBigClick": '',
193				"subServices": {},
194				"disableConfirmCookie": [],
195				"customTextForCookie": {},
196				"showAlertSmall": true,
197				"cookieslist": true
198			},
199			params = tarteaucitron.parameters;
200
201		// Step 0: get params
202		if (params !== undefined) {
203			tarteaucitron.extend(defaults, params);
204		}
205
206		// global
207		tarteaucitron.orientation = defaults.orientation;
208		tarteaucitron.hashtag = defaults.hashtag;
209		tarteaucitron.highPrivacy = defaults.highPrivacy;
210
211		// Step 2: load language and services
212		tarteaucitron.addScript(pathToLang, '', function () {
213			tarteaucitron.addScript(pathToServices, '', function () {
214
215				var body = document.body,
216					div = document.createElement('div'),
217					html = '',
218					index,
219					orientation = 'Top',
220					cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other', 'system'],
221					i;
222
223				cat = cat.sort(function (a, b) {
224					if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) {
225						return 1;
226					}
227					if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) {
228						return -1;
229					}
230					return 0;
231				});
232
233				// Step 3: prepare the html
234				html += '<div id="tarteaucitronPremium"></div>';
235				html += '<div id="tarteaucitronBack" onclick="tarteaucitron.userInterface.closePanel();"></div>';
236				html += '<div id="tarteaucitron">';
237				html += '   <div id="tarteaucitronClosePanel" onclick="tarteaucitron.userInterface.closePanel();">';
238				html += '       ' + tarteaucitron.lang.close;
239				html += '   </div>';
240				html += '   <div id="tarteaucitronServices">';
241				html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
242				html += '         <div class="tarteaucitronName">';
243				html += '            <b><a href="#" onclick="tarteaucitron.userInterface.toggle(\'tarteaucitronInfo\', \'tarteaucitronInfoBox\');return false">&#10011;</a> ' + tarteaucitron.lang.all + '</b>';
244				html += '         </div>';
245				if (!cookieSettings.infoVersion) {
246				html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
247				html += '            <div id="tarteaucitronAllAllowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respondAll(true);">';
248				html += '               &#10003; ' + tarteaucitron.lang.allow;
249				html += '            </div> ';
250				html += '            <div id="tarteaucitronAllDenied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respondAll(false);">';
251				html += '               &#10007; ' + tarteaucitron.lang.deny;
252				html += '            </div>';
253				html += '         </div>';
254				}
255				html += '         <div id="tarteprivacy-dd">';
256				if (tarteaucitron.parameters.customDirettiva) {
257					html += '         	<p>' + tarteaucitron.parameters.customDirettiva + '</p>';
258				} else {
259					html += '         	<p>' + tarteaucitron.lang.direttiva + '</p>';
260				}
261				html += '         </div>';
262				html += '      </div>';
263				html += '      <div id="tarteaucitronInfo" class="tarteaucitronInfoBox">';
264				html += '         ' + tarteaucitron.lang.disclaimer;
265				if (defaults.removeCredit === false) {
266					html += '        <br/><br/>';
267					html += '        <a href="https://opt-out.ferank.eu/" rel="nofollow" target="_blank" rel="noopener">' + tarteaucitron.lang.credit + '</a>';
268				}
269				html += '      </div>';
270				html += '      <div class="tarteaucitronBorder" id="tarteaucitronScrollbarParent">';
271				html += '         <div class="clear"></div>';
272				for (i = 0; i < cat.length; i += 1) {
273					html += '         <div id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
274					html += '            <div class="tarteaucitronTitle">';
275					html += '               <a href="#" onclick="tarteaucitron.userInterface.toggle(\'tarteaucitronDetails' + cat[i] + '\', \'tarteaucitronInfoBox\');return false">&#10011;</a> ' + tarteaucitron.lang[cat[i]].title;
276					html += '            </div>';
277					html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails tarteaucitronInfoBox">';
278					html += '               ' + tarteaucitron.lang[cat[i]].details;
279					html += '            </div>';
280					html += '         </div>';
281					html += '         <div id="tarteaucitronServices_' + cat[i] + '"></div>';
282				}
283				html += '         <div class="tarteaucitronHidden" id="tarteaucitronScrollbarChild" style="height:20px;
283display:block"></div>';
284				html += '      <div class="tarteaucitronLine tarteaucitronMainLine">';
285				html += '       	<p class="testo">' + tarteaucitron.lang.gestire + '</p>';
286				html += '      </div>';
287				html += '       </div>';
288				html += '   </div>';
289				html += '</div>';
290
291				if (defaults.orientation === 'bottom') {
292					orientation = 'Bottom';
293				}
294
295				/* devo usare questo controllo non per la highPrivacy (che ormai è di default) ma per gestire
296				la doppia modalità con registro cookie (e scelte) e senza registro cookie (senza scelte, solo banner informativo)
297				*/
298				if (!cookieSettings.infoVersion) {
299					html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
300					html += ' <div id="tarteaucitronAlertBigContent">';
301					html += '   <span id="tarteaucitronDisclaimerAlert">';
302					if (tarteaucitron.parameters.customAlertBigClick) {
303						html += '       ' + tarteaucitron.parameters.customAlertBigClick;
304					} else {
305						if (cookieSettings.acceptFocusForm) {
306							var alertFocus = tarteaucitron.lang.alertFocus;
307						} else {
308							var alertFocus = '';
309						}
310						html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + alertFocus + ' ' + tarteaucitron.lang.alertBig;
311					}
312					html += '   </span>';
313					html += '   <div id="pulsanti">';
314					html += '     <div class="tarteaucitronPersonalize allinea-sx" onclick="tarteaucitron.userInterface.openPanel
314();" style="margin-right:8px">';
315					html += '  &#9998; ' + tarteaucitron.lang.personalize;
316					html += '   </div>';
317					html += '  <div class="allinea-dx">';
318					html += '   <span class="tarteaucitronPersonalize allinea-dx" onclick="tarteaucitron.userInterface.respondAll(false);" style="margin-right:8px">';
319					html += '       &#10005; ' + tarteaucitron.lang.rejectAll;
320					html += '   </span>';
321					html += '   <span class="tarteaucitronPersonalize allinea-dx" onclick="tarteaucitron.userInterface.respondAll(true);">';
322					html += '       &#10003; ' + tarteaucitron.lang.acceptAll;
323					html += '    </span>';
324					html += '   </div>';
325					html += '  </div>';
326					html += ' </div>';
327					html += '</div>';
328				} else {
329					html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
330					html += ' <div id="tarteaucitronAlertBigContent">';
331					html += '   <span id="tarteaucitronDisclaimerAlert">';
332					html += '       ' + tarteaucitron.lang.alertSmall;
333					html += '   </span>';
334					html += '   <span class="tarteaucitronPersonalize allinea-dx" onclick="tarteaucitron.userInterface.openPanel
334();" style="margin-right:8px">';
335					html += '      ' + tarteaucitron.lang.discover;
336					html += '    </span>';
337					html += '   <span class="tarteaucitronPersonalize allinea-dx" onclick="tarteaucitron.userInterface.respondAll(true);">';
338					html += '       OK ';
339					html += '    </span>';
340					html += ' </div>';
341					html += '</div>';
342				}
343
344				if (defaults.customButton) {
345					var d1 = document.getElementById(defaults.customButton);
346					if (d1 === null) {
347						document.body.insertAdjacentHTML('beforeend', defaults.customButtonHtml);
348					} else {
349						d1.insertAdjacentHTML('beforeend', defaults.customButtonHtml);
350					}
351				}
352
353				tarteaucitron.addScript(tarteaucitron.cdn + 'adb.js?v=' + tarteaucitron.version, '', function () {
354					if (tarteaucitronNoAdBlocker === true || !defaults.adblocker) {
355						div.id = 'tarteaucitronRoot';
356						body.appendChild(div, body);
357						div.innerHTML = html;
358
359						if (tarteaucitron.job !== undefined) {
360							tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
361							for (index = 0; index < tarteaucitron.job.length; index += 1) {
362								tarteaucitron.addService(tarteaucitron.job[index]);
363							}
364							tarteaucitron.afterload();
365						}
366
367						tarteaucitron.isAjax = true;
368						tarteaucitron.job.push = function (id) {
369
370							// ie <9 hack
371							if (typeof tarteaucitron.job.indexOf === 'undefined') {
372								tarteaucitron.job.indexOf = function (obj, start) {
373									var i,
374										j = this.length;
375									for (i = (start || 0); i < j; i += 1) {
376										if (this[i] === obj) {
377											return i;
378										}
379									}
380									return -1;
381								};
382							}
383
384							if (tarteaucitron.job.indexOf(id) === -1) {
385								Array.prototype.push.call(this, id);
386							}
387							tarteaucitron.launch[id] = false;
388							tarteaucitron.addService(id);
389						};
390
391						if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
392							tarteaucitron.userInterface.openPanel();
393						}
394
395						tarteaucitron.cookie.number();
396						setInterval(tarteaucitron.cookie.number, 60000);
397					}
398				}, defaults.adblocker);
399				if (defaults.adblocker) {
400					setTimeout(function () {
401						if (tarteaucitronNoAdBlocker === false) {
402							html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '" style="display:block">';
403							html += '   <span id="tarteaucitronDisclaimerAlert">';
404							html += '       ' + tarteaucitron.lang.adblock + '<br/>';
405							html += '       <b>' + tarteaucitron.lang.adblock_call + '</b>';
406							html += '   </span>';
407							html += '   <span id="tarteaucitronPersonalize" onclick="location.reload();">';
408							html += '       ' + tarteaucitron.lang.reload;
409							html += '   </span>';
410							html += '</div>';
411							html += '<div id="tarteaucitronPremium"></div>';
412							div.id = 'tarteaucitronRoot';
413							body.appendChild(div, body);
414							div.innerHTML = html;
415							tarteaucitron.pro('!adblocker=true');
416						} else {
417							tarteaucitron.pro('!adblocker=false');
418						}
419					}, 1500);
420				}
421			});
422		});
423	},
424	"addService": function (serviceId) {
425		"use strict";
426		var bDisableCookieConfirm = tarteaucitron.parameters.disableConfirmCookie.indexOf(serviceId);
427
428		var custom_text = tarteaucitron.parameters.customTextForCookie[serviceId];
429		var html = '',
430			s = tarteaucitron.services,
431			service = s[serviceId],
432			cookie = tarteaucitron.cookie.read(),
433			hostname = document.location.hostname,
434			hostRef = document.referrer.split('/')[2],
435			isNavigating = (hostRef === hostname) ? true : false,
436			isAutostart = (!service.needConsent) ? true : false,
437			isWaiting = (cookie.indexOf(service.key + '=wait') >= 0) ? true : false,
438			isDenied = (cookie.indexOf(service.key + '=false') >= 0) ? true : false,
439			isAllowed = (cookie.indexOf(service.key + '=true') >= 0) ? true : false,
440			isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0) ? true : false;
441
442		if (tarteaucitron.added[service.key] !== true) {
443			tarteaucitron.added[service.key] = true;
444
445			var subServices = tarteaucitron.parameters.subServices[serviceId];
446//			console.log(subServices);
447			html += '<div id="' + service.key + 'Line" class="tarteaucitronLine">';
448			html += '   <div class="tarteaucitronName">';
449			html += '       <b>' + service.name + '</b><br/>';
450			if (custom_text !== undefined) {
451				html += '       <span id="customText' + service.key + '" class="tarteaucitronListCookies">' + custom_text + '</span><br/>';
452			}
453			if (subServices !== undefined) {
454				var subs = subServices.split("-");
455				html += '<div class="tarteaucitronSubServices"><ul>';
456				var i;
457				for (i = 0; i < subs.length; i++) {
458					html += '       <li><span>' + s[subs[i]].name + '</span> - <a href="' + s[subs[i]].uri + '" target="_blank" rel="noopener">';
459					html += '           ' + tarteaucitron.lang.source;
460					html += '       </a></li>';
461				}
462				html += '</ul></div>';
463			}else{
464				if (service.key != 'cookie_tecnici') {		
465					html += '       <a href="' + service.uri + '" target="_blank" rel="noopener">';
466					html += '           ' + tarteaucitron.lang.source;
467					html += '       </a>';
468				}
469			}
470			html += '   </div>';
471			//se è strettamente uguale a -1 significa che non è da escludere
472			if (service.key != 'cookie_tecnici') {
473				if (bDisableCookieConfirm === -1) {
474					html += '   <div class="tarteaucitronAsk">';
475					html += '       <div id="' + service.key + 'Allowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respond(this, true);">';
476					html += '           &#10003; ' + tarteaucitron.lang.allow;
477					html += '       </div> ';
478					html += '       <div id="' + service.key + 'Denied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respond(this, false);">';
479					html += '           &#10007; ' + tarteaucitron.lang.deny;
480					html += '       </div>';
481					html += '   </div>';
482				}
483			}
484			html += '</div>';
485
486			tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');
487
488			if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
489				document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
490			}
491
492			tarteaucitron.userInterface.order(service.type);
493		}
494
495		// allow by default for non EU
496		if (isResponded === false && tarteaucitron.user.bypass === true) {
497			isAllowed = true;
498			tarteaucitron.cookie.create(service.key, true);
499		}
500//		console.log(isResponded );
501//		console.log(isAutostart);
502//		console.log(isNavigating);
503//		console.log(isWaiting);
504//		console.log(tarteaucitron.highPrivacy);
505//		console.log(isAllowed);
506		if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
507			if (!isAllowed) {
508				//qui ci passa solo quando implicitamente vengono accettati i cookie, navigando nel sito.
509//				console.log('default true');
510				if (!tarteaucitron.implicitCookie) {
511					tarteaucitron.implicitCookie = true;
512				}
513				tarteaucitron.cookie.create(service.key, true);
514			}
515				
516			if (tarteaucitron.launch[service.key] !== true) {
517				tarteaucitron.launch[service.key] = true;
518				service.js();
519			}
520			tarteaucitron.state[service.key] = true;
521			tarteaucitron.userInterface.color(service.key, true);
522		} else if (isDenied) {
523			if (typeof service.fallback === 'function') {
524				service.fallback();
525			}
526			tarteaucitron.state[service.key] = false;
527			tarteaucitron.userInterface.color(service.key, false);
528		} else if (!isResponded) {
529			tarteaucitron.cookie.create(service.key, 'wait');
530			if (typeof service.fallback === 'function') {
531				service.fallback();
532			}
533			tarteaucitron.userInterface.color(service.key, 'wait');
534			tarteaucitron.userInterface.openAlert();
535		}
536
537		tarteaucitron.cookie.checkCount(service.key);
538	},
539	"afterload": function () {
540		"use strict";
541		//after load
542		if (tarteaucitron.implicitCookie === true) {
543			tarteaucitron.cookie.save(tarteaucitron.state, 'navigateSite');
544		}
545	},
546	"cleanArray": function cleanArray(arr) {
547		"use strict";
548		var i,
549			len = arr.length,
550			out = [],
551			obj = {},
552			s = tarteaucitron.services;
553
554		for (i = 0; i < len; i += 1) {
555			if (!obj[arr[i]]) {
556				obj[arr[i]] = {};
557				if (tarteaucitron.services[arr[i]] !== undefined) {
558					out.push(arr[i]);
559				}
560			}
561		}
562
563		out = out.sort(function (a, b) {
564			if (s[a].type + s[a].key > s[b].type + s[b].key) {
565				return 1;
566			}
567			if (s[a].type + s[a].key < s[b].type + s[b].key) {
568				return -1;
569			}
570			return 0;
571		});
572
573		return out;
574	},
575	"userInterface": {
576		"css": function (id, property, value) {
577			"use strict";
578			if (document.getElementById(id) !== null) {
579				document.getElementById(id).style[property] = value;
580			}
581		},
582		"respondAll": function (status, from) {
583			"use strict";
584			if (from === undefined) {
585				from = 'respondAll';
586			}
587			var s = tarteaucitron.services,
588				service,
589				key,
590				index = 0;
591
592			for (index = 0; index < tarteaucitron.job.length; index += 1) {
593				service = s[tarteaucitron.job[index]];
594				key = service.key;
595				if (tarteaucitron.state[key] !== status) {
596					if (status === false && tarteaucitron.launch[key] === true) {
597						tarteaucitron.launch[key] = true;
598						if (typeof tarteaucitron.services[key].fallback === 'function') {
599							tarteaucitron.services[key].fallback();
600						}
601						tarteaucitron.reloadThePage = true;
602					}
603					if (tarteaucitron.launch[key] !== true && status === true) {
604						tarteaucitron.launch[key] = true;
605						tarteaucitron.services[key].js();
606					}
607					tarteaucitron.state[key] = status;
608					tarteaucitron.cookie.create(key, status);
609					tarteaucitron.userInterface.color(key, status);
610				}
611			}
612			tarteaucitron.cookie.save(tarteaucitron.state, from);
613		},
614		"respond": function (el, status) {
615			"use strict";
616			var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
617
618			// return if same state
619			if (tarteaucitron.state[key] === status) {
620				return;
621			}
622
623			if (status === false && tarteaucitron.launch[key] === true) {
624				tarteaucitron.launch[key] = true;
625				if (typeof tarteaucitron.services[key].fallback === 'function') {
626					tarteaucitron.services[key].fallback();
627				}
628				tarteaucitron.reloadThePage = true;
629			}
630
631			// if not already launched... launch the service
632			if (status === true) {
633				if (tarteaucitron.launch[key] !== true) {
634					tarteaucitron.launch[key] = true;
635					tarteaucitron.services[key].js();
636				}
637			}
638			tarteaucitron.state[key] = status;
639			tarteaucitron.cookie.create(key, status);
640			tarteaucitron.userInterface.color(key, status);
641			tarteaucitron.cookie.save(tarteaucitron.state, 'respond');
642		},
643		"color": function (key, status) {
644			"use strict";
645			var gray = '#808080',
646				greenDark = '#1B870B',
647				greenLight = '#E6FFE2',
648				redDark = '#9C1A1A',
649				redLight = '#FFE2E2',
650				yellowDark = '#FBDA26',
651				c = 'tarteaucitron',
652				nbDenied = 0,
653				nbPending = 0,
654				nbAllowed = 0,
655				sum = tarteaucitron.job.length,
656				index;
657
658			if (status === true) {
659				tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + greenDark);
660				tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', greenDark);
661				tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', gray);
662			} else if (status === false) {
663				tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + redDark);
664				tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', gray);
665				tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', redDark);
666			}
667
668			// check if all services are allowed
669			for (index = 0; index < sum; index += 1) {
670				if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
671					nbDenied += 1;
672				} else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
673					nbPending += 1;
674				} else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
675					nbAllowed += 1;
676				}
677			}
678
679			tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
680			tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
681			tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
682
683			if (nbDenied === 0 && nbPending === 0) {
684				tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', greenDark);
685				tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray);
686			} else if (nbAllowed === 0 && nbPending === 0) {
687				tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray);
688				tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', redDark);
689			} else {
690				tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray);
691				tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray);
692			}
693
694			// close the alert if all service have been reviewed
695			if (nbPending === 0) {
696				tarteaucitron.userInterface.closeAlert();
697			}
698
699			if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
700				tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
701			}
702
703			if (status === true) {
704				if (document.getElementById('tacCL' + key) !== null) {
705					document.getElementById('tacCL' + key).innerHTML = '...';
706				}
707				setTimeout(function () {
708					tarteaucitron.cookie.checkCount(key);
709				}, 2500);
710			} else {
711				tarteaucitron.cookie.checkCount(key);
712			}
713		},
714		"openPanel": function () {
715			"use strict";
716			tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
717			tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
718			tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
719			tarteaucitron.userInterface.jsSizing('main');
720		},
721		"closePanel": function () {
722			"use strict";
723
724			if (document.location.hash === tarteaucitron.hashtag) {
725				document.location.hash = '';
726			}
727			tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
728			tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
729
730			tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
731				elem.style.display = 'none';
732			}, true);
733
734			if (tarteaucitron.reloadThePage === true) {
735				window.location.reload();
736			} else {
737				tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
738			}
739		},
740		"openAlert": function () {
741			"use strict";
742			var c = 'tarteaucitron';
743			//tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
744			tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
745			tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'block');
746		},
747		"closeAlert": function () {
748			"use strict";
749			var c = 'tarteaucitron';
750			//tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
751			tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
752			tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none');
753			tarteaucitron.userInterface.jsSizing('box');
754		},
755		"toggleCookiesList": function () {
756			"use strict";
757			var div = document.getElementById('tarteaucitronCookiesListContainer');
758
759			if (div === null) {
760				return;
761			}
762
763			if (div.style.display !== 'block') {
764				tarteaucitron.cookie.number();
765				div.style.display = 'block';
766				tarteaucitron.userInterface.jsSizing('cookie');
767				tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
768				tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
769				tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
770					elem.style.display = 'none';
771				}, true);
772			} else {
773				div.style.display = 'none';
774				tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
775				tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
776			}
777		},
778		"toggle": function (id, closeClass) {
779			"use strict";
780			var div = document.getElementById(id);
781
782			if (div === null) {
783				return;
784			}
785
786			if (closeClass !== undefined) {
787				tarteaucitron.fallback([closeClass], function (elem) {
788					if (elem.id !== id) {
789						elem.style.display = 'none';
790					}
791				}, true);
792			}
793
794			if (div.style.display !== 'block') {
795				div.style.display = 'block';
796			} else {
797				div.style.display = 'none';
798			}
799		},
800		"order": function (id) {
801			"use strict";
802			var main = document.getElementById('tarteaucitronServices_' + id),
803				allDivs,
804				store = [],
805				i;
806
807			if (main === null) {
808				return;
809			}
810
811			allDivs = main.childNodes;
812
813			if (typeof Array.prototype.map === 'function') {
814				Array.prototype.map.call(main.children, Object).sort(function (a, b) {
815					if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) {
816						return 1;
817					}
818					if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) {
819						return -1;
820					}
821					return 0;
822				}
822).forEach(function (element) {
823					main.appendChild(element);
824				});
825			}
826		},
827		"jsSizing": function (type) {
828			"use strict";
829			var scrollbarMarginRight = 10,
830				scrollbarWidthParent,
831				scrollbarWidthChild,
832				servicesHeight,
833				e = window,
834				a = 'inner',
835				windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
836				mainTop,
837				mainHeight,
838				closeButtonHeight,
839				headerHeight,
840				cookiesListHeight,
841				cookiesCloseHeight,
842				cookiesTitleHeight,
843				paddingBox,
844				alertSmallHeight,
845				cookiesNumberHeight;
846
847			if (type === 'box') {
848				if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) {
849
850					// reset
851					tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');
852
853					// calculate
854					alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight;
855					cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight;
856					paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;
857
858					// apply
859					tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
860				}
861			} else if (type === 'main') {
862
863				// get the real window width for media query
864				if (window.innerWidth === undefined) {
865					a = 'client';
866					e = document.documentElement || document.body;
867				}
868
869				// height of the services list container
870				if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) {
871
872					// reset
873					tarteaucitron.userInterface.css('tarteaucitronScrollbarParent', 'height', 'auto');
874
875					// calculate
876					mainHeight = document.getElementById('tarteaucitron').offsetHeight;
877					closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight;
878					headerHeight = document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
879
880					// apply
881					servicesHeight = (mainHeight - closeButtonHeight - headerHeight + 1);
882					tarteaucitron.userInterface.css('tarteaucitronScrollbarParent', 'height', servicesHeight + 'px');
883				}
884
885				// align the main allow/deny button depending on scrollbar width
886				if (document.getElementById('tarteaucitronScrollbarParent') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) {
887
888					// media query
889					if (e[a + 'Width'] <= 479) {
890						tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
891					} else if (e[a + 'Width'] <= 767) {
892						scrollbarMarginRight = 12;
893					}
894
895					scrollbarWidthParent = document.getElementById('tarteaucitronScrollbarParent').offsetWidth;
896					scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth;
897					tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px');
898				}
899
900				// center the main panel
901				if (document.getElementById('tarteaucitron') !== null) {
902
903					// media query
904					if (e[a + 'Width'] <= 767) {
905						mainTop = 0;
906					} else {
907						mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21;
908					}
909
910					// correct
911					if (mainTop < 0) {
912						mainTop = 0;
913					}
914
915					if (document.getElementById('tarteaucitronMainLineOffset') !== null) {
916						if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) {
917							mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
918						}
919					}
920
921					// apply
922					tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px');
923				}
924
925
926			} else if (type === 'cookie') {
927
928				// put cookies list at bottom
929				if (document.getElementById('tarteaucitronAlertSmall') !== null) {
930					tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px');
931				}
932
933				// height of cookies list
934				if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
935
936					// reset
937					tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');
938
939					// calculate
940					cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight;
941					cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight;
942					cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight;
943
944					// apply
945					tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
945sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px');
946				}
947			}
948		}
949	},
950	"cookie": {
951		"owner": {},
952		"save": function (s, type) {
953			function getCookie(name) {
954				const value = `; ${document.cookie}`;
955				const parts = value.split(`; ${name}=`);
956				if (parts.length === 2) return parts.pop().split(';').shift();
957			  }
958			
959			// creo nel client un cookie con dei campi univoci, lo salvo in una variabile; se è impostato il salvataggio nel db lo salvo insieme al contenuto del cookie con le scelte effettuate dal client
960			var d = new Date(),
961			time = d.getTime(),
962			expireTime = time + 15897600000; // 183 days
963			d.setTime(expireTime);
964			//uid: numero casuale che identifica il singolo salvataggio di preferenze; se salvato anche nel db può essere confrontato con il cookie presente nel browser dell'utente per identificare il salvataggio; se il salvataggio nel db non è impostato non ha un'utilità. 
965			var uid = Math.floor(Math.random() * 1000000000);
966			var cookieversion = cookieSettings.cookieversion;
967			var timestamp = new Date().getTime();
968			document.cookie = 'tarteaucitron_uid=uid=' + uid + '!timestamp=' + timestamp + '!cookieversion=' + cookieversion + '; expires=' + d.toGMTString() + '; path=/;';
969			var uid_data = getCookie("tarteaucitron_uid");
970
971			if (cookieSettings.saveCookieChoice) {
972				//console.log(s);
973				cookie_choice = {};
974				for (var key in s) {
975					pos = tarteaucitron.parameters.disableConfirmCookie.indexOf(key);
976					if (pos === -1) {
977						cookie_choice[key] = s[key];
978					}
979				}
980//				console.log(cookie_choice);
981				jQuery.ajax({
982					url: pluginInfo.ajaxUrl,
983					type: 'POST',
984					dataType: 'json',
985					data: {
986						action: 'webag_cookie_choice',
987						sec_cookie: pluginInfo.ajax_nonce,
988						type: type,
989						cookie_choice: cookie_choice,
990						uid_data: uid_data
991					},
992					success: function (data) {
993//						console.log(data);
994					},
995					error: function (xhr, ajaxOptions, thrownError) {
996						// code goes here;
997						console.log('failed:');
998						console.log(xhr);
999						console.log(ajaxOptions);
1000						console.log(thrownError);
1001					}
1002				});
1003			}
1004			window.dataLayer = window.dataLayer || [];
1005			window.dataLayer.push({
1006				'event': 'cookiecheck'
1007			});
1008		},
1009		"create": function (key, status) {
1010			//console.log(key);
1011			"use strict";
1012			var d = new Date(),
1013				time = d.getTime(),
1014				expireTime = time + 15897600000, // 183 days
1015				regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
1016				cookie = tarteaucitron.cookie.read().replace(regex, ""),
1017				value = 'tarteaucitron=' + cookie + '!' + key + '=' + status;
1018
1019			if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
1020				tarteaucitron.pro('!' + key + '=' + status);
1021			}
1022
1023			d.setTime(expireTime);
1024			document.cookie = value + '; expires=' + d.toGMTString() + '; path=/;';
1025
1026		},
1027		"read": function () {
1028			"use strict";
1029			var nameEQ = "tarteaucitron=",
1030				ca = document.cookie.split(';'),
1031				i,
1032				c;
1033
1034			for (i = 0; i < ca.length; i += 1) {
1035				c = ca[i];
1036				while (c.charAt(0) === ' ') {
1037					c = c.substring(1, c.length);
1038				}
1039				if (c.indexOf(nameEQ) === 0) {
1040					return c.substring(nameEQ.length, c.length);
1041				}
1042			}
1043			return '';
1044		},
1045		"purge": function (arr) {
1046			"use strict";
1047			var i;
1048
1049			for (i = 0; i < arr.length; i += 1) {
1050				document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
1051				document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
1052				document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
1053			}
1054		},
1055		"checkCount": function (key) {
1056			"use strict";
1057			var arr = tarteaucitron.services[key].cookies,
1058				nb = arr.length,
1059				nbCurrent = 0,
1060				html = '',
1061				i,
1062				status = document.cookie.indexOf(key + '=true');
1063
1064			if (status >= 0 && nb === 0) {
1065				html += tarteaucitron.lang.useNoCookie;
1066			} else if (status >= 0) {
1067				for (i = 0; i < nb; i += 1) {
vendor: 7,218 bytes, lines 1068-1291
1068					if (document.cookie.indexOf(arr[i] + '=') !== -1) {
1069						nbCurrent += 1;
1070						if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
1071							tarteaucitron.cookie.owner[arr[i]] = [];
1072						}
1073						if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
1074							tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
1075						}
1076					}
1077				}
1078
1079				if (nbCurrent > 0) {
1080					html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie';
1081					if (nbCurrent > 1) {
1082						html += 's';
1083					}
1084					html += '.';
1085				} else {
1086					html += tarteaucitron.lang.useNoCookie;
1087				}
1088			} else if (nb === 0) {
1089				html = tarteaucitron.lang.noCookie;
1090			} else {
1091				html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
1092				if (nb > 1) {
1093					html += 's';
1094				}
1095				html += '.';
1096			}
1097
1098			if (document.getElementById('tacCL' + key) !== null) {
1099				document.getElementById('tacCL' + key).innerHTML = html;
1100			}
1101		},
1102		"crossIndexOf": function (arr, match) {
1103			"use strict";
1104			var i;
1105			for (i = 0; i < arr.length; i += 1) {
1106				if (arr[i] === match) {
1107					return true;
1108				}
1109			}
1110			return false;
1111		},
1112		"number": function () {
1113			"use strict";
1114			var cookies = document.cookie.split(';'),
1115				nb = (document.cookie !== '') ? cookies.length : 0,
1116				html = '',
1117				i,
1118				name,
1119				namea,
1120				nameb,
1121				c,
1122				d,
1123				s = (nb > 1) ? 's' : '',
1124				savedname,
1125				regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
1126				regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
1127				host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;
1128
1129			cookies = cookies.sort(function (a, b) {
1130				namea = a.split('=', 1).toString().replace(/ /g, '');
1131				nameb = b.split('=', 1).toString().replace(/ /g, '');
1132				c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
1133				d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
1134				if (c + a > d + b) {
1135					return 1;
1136				}
1137				if (c + a < d + b) {
1138					return -1;
1139				}
1140				return 0;
1141			});
1142
1143			if (document.cookie !== '') {
1144				for (i = 0; i < nb; i += 1) {
1145					name = cookies[i].split('=', 1).toString().replace(/ /g, '');
1146					if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
1147						savedname = tarteaucitron.cookie.owner[name].join(' // ');
1148						html += '<div class="tarteaucitronHidden">';
1149						html += '     <div class="tarteaucitronTitle">';
1150						html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
1151						html += '    </div>';
1152						html += '</div>';
1153					} else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
1154						savedname = host;
1155						html += '<div class="tarteaucitronHidden">';
1156						html += '     <div class="tarteaucitronTitle">';
1157						html += '        ' + host;
1158						html += '    </div>';
1159						html += '</div>';
1160					}
1161					html += '<div class="tarteaucitronCookiesListMain">';
1162					html += '    <div class="tarteaucitronCookiesListLeft"><a href="#" onclick="tarteaucitron.cookie.purge([\'' + cookies[i].split('=', 1) + '\']);tarteaucitron.cookie.number();tarteaucitron.userInterface.jsSizing(\'cookie\');return false"><b>&times;</b></a> <b>' + name + '</b>';
1163					html += '    </div>';
1164					html += '    <div class="tarteaucitronCookiesListRight">' + cookies[i].split('=').slice(1).join('=') + '</div>';
1165					html += '</div>';
1166				}
1167			} else {
1168				html += '<div class="tarteaucitronCookiesListMain">';
1169				html += '    <div class="tarteaucitronCookiesListLeft"><b>-</b></div>';
1170				html += '    <div class="tarteaucitronCookiesListRight"></div>';
1171				html += '</div>';
1172			}
1173
1174			html += '<div class="tarteaucitronHidden" style="height:20px;display:block"></div>';
1175
1176			if (document.getElementById('tarteaucitronCookiesList') !== null) {
1177				document.getElementById('tarteaucitronCookiesList').innerHTML = html;
1178			}
1179
1180			if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
1181				document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
1182			}
1183
1184			if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
1185				document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
1186			}
1187
1188			for (i = 0; i < tarteaucitron.job.length; i += 1) {
1189				tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
1190			}
1191		}
1192	},
1193	"getLanguage": function () {
1194		"use strict";
1195		if (!navigator) {
1196			return 'en';
1197		}
1198
1199		var availableLanguages = 'en,fr,es,it,de,pt',
1200			defaultLanguage = 'en',
1201			lang = navigator.language || navigator.browserLanguage ||
1202			navigator.systemLanguage || navigator.userLang || null,
1203			userLanguage = lang.substr(0, 2);
1204
1205		if (tarteaucitronForceLanguage !== '') {
1206			if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
1207				return tarteaucitronForceLanguage;
1208			}
1209		}
1210
1211		if (availableLanguages.indexOf(userLanguage) === -1) {
1212			return defaultLanguage;
1213		}
1214		return userLanguage;
1215	},
1216	"getLocale": function () {
1217		"use strict";
1218		if (!navigator) {
1219			return 'en_US';
1220		}
1221
1222		var lang = navigator.language || navigator.browserLanguage ||
1223			navigator.systemLanguage || navigator.userLang || null,
1224			userLanguage = lang.substr(0, 2);
1225
1226		if (userLanguage === 'fr') {
1227			return 'fr_FR';
1228		} else if (userLanguage === 'en') {
1229			return 'en_US';
1230		} else if (userLanguage === 'de') {
1231			return 'de_DE';
1232		} else if (userLanguage === 'es') {
1233			return 'es_ES';
1234		} else if (userLanguage === 'it') {
1235			return 'it_IT';
1236		} else if (userLanguage === 'pt') {
1237			return 'pt_PT';
1238		} else {
1239			return 'en_US';
1240		}
1241	},
1242	"addScript": function (url, id, callback, execute, attrName, attrVal) {
1243		"use strict";
1244		var script,
1245			done = false;
1246
1247		if (execute === false) {
1248			if (typeof callback === 'function') {
1249				callback();
1250			}
1251		} else {
1252			script = document.createElement('script');
1253			script.type = 'text/javascript';
1254			script.id = (id !== undefined) ? id : '';
1255			script.async = true;
1256			script.src = url;
1257
1258			if (attrName !== undefined && attrVal !== undefined) {
1259				script.setAttribute(attrName, attrVal);
1260			}
1261
1262			if (typeof callback === 'function') {
1263				script.onreadystatechange = script.onload = function () {
1264					var state = script.readyState;
1265					if (!done && (!state || /loaded|complete/.test(state))) {
1266						done = true;
1267						callback();
1268					}
1269				};
1270			}
1271
1272			document.getElementsByTagName('head')[0].appendChild(script);
1273		}
1274	},
1275	"makeAsync": {
1276		"antiGhost": 0,
1277		"buffer": '',
1278		"init": function (url, id) {
1279			"use strict";
1280			var savedWrite = document.write,
1281				savedWriteln = document.writeln;
1282
1283			document.write = function (content) {
1284				tarteaucitron.makeAsync.buffer += content;
1285			};
1286			document.writeln = function (content) {
1287				tarteaucitron.makeAsync.buffer += content.concat("\n");
1288			};
1289
1290			setTimeout(function () {
1291				document.write = savedWrite;
1292				document.writeln = savedWriteln;
1293			}, 20000);
1294
1295			tarteaucitron.makeAsync.getAndParse(url, id);
1296		},
1297		"getAndParse": function (url, id) {
1298			"use strict";
1299			if (tarteaucitron.makeAsync.antiGhost > 9) {
1300				tarteaucitron.makeAsync.antiGhost = 0;
1301				return;
1302			}
1303			tarteaucitron.makeAsync.antiGhost += 1;
1304			tarteaucitron.addScript(url, '', function () {
1305				if (document.getElementById(id) !== null) {
1306					document.getElementById(id).innerHTML += "<span style='display:none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
1307					tarteaucitron.makeAsync.buffer = '';
1308					tarteaucitron.makeAsync.execJS(id);
1309				}
1310			});
1311		},
1312		"execJS": function (id) {
1313			/* not strict because third party scripts may have errors */
1314			var i,
1315				scripts,
1316				childId,
1317				type;
1318
1319			if (document.getElementById(id) === null) {
1320				return;
1321			}
1322
1323			scripts = document.getElementById(id).getElementsByTagName('script');
1324			for (i = 0; i < scripts.length; i += 1) {
1325				type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
1326				if (type === '') {
1327					type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
1328				}
1329				if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
1330					childId = id + Math.floor(Math.random() * 99999999999);
1331					document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
1332					tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
1333				} else if (type.indexOf('javascript') !== -1 || type === '') {
1334					eval(scripts[i].innerHTML);
1335				}
1336			}
1337		}
1338	},
1339	"fallback": function (matchClass, content, noInner) {
1340		"use strict";
1341		var elems = document.getElementsByTagName('*'),
1342			i,
1343			index = 0;
1344
1345		for (i in elems) {
1346			if (elems[i] !== undefined) {
1347				for (index = 0; index < matchClass.length; index += 1) {
1348					if ((' ' + elems[i].className + ' ')
1349						.indexOf(' ' + matchClass[index] + ' ') > -1) {
1350						if (typeof content === 'function') {
1351							if (noInner === true) {
1352								content(elems[i]);
1353							} else {
1354								elems[i].innerHTML = content(elems[i]);
1355							}
1356						} else {
1357							elems[i].innerHTML = content;
1358						}
1359					}
1360				}
1361			}
1362		}
1363	},
1364	"engage": function (id) {
1365		"use strict";
1366		var html = '',
1367			r = Math.floor(Math.random() * 100000);
1368
1369		html += '<div class="tac_activate">';
1370		html += '   <div class="tac_float">';
1371		html += '      <b>' + tarteaucitron.services[id].name + '</b> ' + tarteaucitron.lang.fallback;
1372		html += '      <div class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">';
1373		html += '          &#10003; ' + tarteaucitron.lang.allow;
1374		html += '       </div>';
1375		html += '   </div>';
1376		html += '</div>';
1377
1378		return html;
1379	},
1380	"extend": function (a, b) {
1381		"use strict";
1382		var prop;
1383		for (prop in b) {
1384			if (b.hasOwnProperty(prop)) {
1385				a[prop] = b[prop];
1386			}
1387		}
1388	},
1389	"proTemp": '',
1390	"proTimer": function () {
1391		"use strict";
1392		setTimeout(tarteaucitron.proPing, 1000);
1393	},
1394	"pro": function (list) {
1395		"use strict";
1396		tarteaucitron.proTemp += list;
1397		clearTimeout(tarteaucitron.proTimer);
1398		tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 2500);
1399	},
1400	"proPing": function () {
1401		"use strict";
1402		if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') {
1403			var div = document.getElementById('tarteaucitronPremium'),
1404				timestamp = new Date().getTime(),
1405				url = '//opt-out.ferank.eu/premium.php?';
1406
1407			if (div === null) {
1408				return;
1409			}
1410
1411			url += 'domain=' + tarteaucitron.domain + '&';
1412			url += 'uuid=' + tarteaucitron.uuid + '&';
1413			url += 'c=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
1414			url += '_' + timestamp;
1415
1416			div.innerHTML = '<img src="' + url + '" style="display:none" />';
1417
1418			tarteaucitron.proTemp = '';
1419		}
1420
1421		tarteaucitron.cookie.number();
1422	}
1423};

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.