PageSourceSearch

https://www.edmill.com/wp-content/themes/html5blank-cw/tarteaucitron/tarteaucitron_en.js

js edmill.com collected 2026-10-02 16:18:32 UTC 76,996 bytes, 1,618 lines download raw bytes

1/*jslint browser: true, evil: true */
2
3// define correct path for files inclusion
4var scripts = document.getElementsByTagName('script'),
5    path = scripts[scripts.length - 1].src.split('?')[0],
6    tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
7    cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
8    alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
9    tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
10    tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
11    tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
12    // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value
13    tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay,
14    timeExpire = 31536000000,
15    tarteaucitronProLoadServices,
16    tarteaucitronNoAdBlocker = false;
17
18
19
20var tarteaucitron = {
21    "version": 20191031,
22    "cdn": cdn,
23    "user": {},
24    "lang": {},
25    "services": {},
26    "added": [],
27    "idprocessed": [],
28    "state": [],
29    "launch": [],
30    "parameters": {},
31    "isAjax": false,
32    "reloadThePage": false,
33    "events": {
34        "init": function () {},
35        "load": function () {},
36    },
37    "init": function (params) {
38        "use strict";
39        var origOpen;
40
41        tarteaucitron.parameters = params;
42        if (alreadyLaunch === 0) {
43            alreadyLaunch = 1;
44            if (window.addEventListener) {
45                window.addEventListener("load", function () {
46                    tarteaucitron.load();
47                    tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
48                        elem.addEventListener("click", function (event) {
49                            tarteaucitron.userInterface.openPanel
49();
50                            event.preventDefault();
51                        }, false);
52                    }, true);
53                }, false);
54                window.addEventListener("scroll", function () {
55                    var scrollPos = window.pageYOffset || document.documentElement.scrollTop,
56                        heightPosition;
57                    if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) {
58                        if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') {
59                            heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px';
60
61                            if (scrollPos > (screen.height * 2)) {
62                                tarteaucitron.userInterface.respondAll(true);
63                            } else if (scrollPos > (screen.height / 2)) {
64                                document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
65                            }
66
67                            if (tarteaucitron.orientation === 'top') {
68                                document.getElementById('tarteaucitronPercentage').style.top = heightPosition;
69                            } else {
70                                document.getElementById('tarteaucitronPercentage').style.bottom = heightPosition;
71                            }
72                            document.getElementById('tarteaucitronPercentage').style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
73                        }
74                    }
75                }, false);
76
77                window.addEventListener("keydown", function (evt) {
78                    if (evt.keyCode === 27) {
79                        tarteaucitron.userInterface.closePanel();
80                    }
81                }, false);
82                window.addEventListener("hashchange", function () {
83                    if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
84                        tarteaucitron.userInterface.openPanel();
85                    }
86                }, false);
87                window.addEventListener("resize", function () {
88                    if (document.getElementById('tarteaucitron') !== null) {
89                        if (document.getElementById('tarteaucitron').style.display === 'block') {
90                            tarteaucitron.userInterface.jsSizing('main');
91                        }
92                    }
93
94                    if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
95                        if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') {
96                            tarteaucitron.userInterface.jsSizing('cookie');
97                        }
98                    }
99                }, false);
100            } else {
101                window.attachEvent("onload", function () {
102                    tarteaucitron.load();
103                    tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
104                        elem.attachEvent("onclick", function (event) {
105                            tarteaucitron.userInterface.openPanel
105();
106                            event.preventDefault();
107                        });
108                    }, true);
109                });
110                window.attachEvent("onscroll", function () {
111                    var scrollPos = window.pageYOffset || document.documentElement.scrollTop,
112                        heightPosition;
113                    if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) {
114                        if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') {
115                            heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px';
116
117                            if (scrollPos > (screen.height * 2)) {
118                                tarteaucitron.userInterface.respondAll(true);
119                            } else if (scrollPos > (screen.height / 2)) {
120                                document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
121                            }
122                            if (tarteaucitron.orientation === 'top') {
123                                document.getElementById('tarteaucitronPercentage').style.top = heightPosition;
124                            } else {
125                                document.getElementById('tarteaucitronPercentage').style.bottom = heightPosition;
126                            }
127                            document.getElementById('tarteaucitronPercentage').style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
128                        }
129                    }
130                });
131                window.attachEvent("onkeydown", function (evt) {
132                    if (evt.keyCode === 27) {
133                        tarteaucitron.userInterface.closePanel();
134                    }
135
136                    if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) {
137                        if ( evt.shiftKey ) /* shift + tab */ {
138                            if (document.activeElement === firstFocusableEl) {
139                                lastFocusableEl.focus();
140                                evt.preventDefault();
141                            }
142                        } else /* tab */ {
143                            if (document.activeElement === lastFocusableEl) {
144                                firstFocusableEl.focus();
145                                evt.preventDefault();
146                            }
147                        }
148                    }
149
150                });
151                window.attachEvent("onhashchange", function () {
152                    if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
153                        tarteaucitron.userInterface.openPanel();
154                    }
155                });
156                window.attachEvent("onresize", function () {
157                    if (document.getElementById('tarteaucitron') !== null) {
158                        if (document.getElementById('tarteaucitron').style.display === 'block') {
159                            tarteaucitron.userInterface.jsSizing('main');
160                        }
161                    }
162
163                    if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
164                        if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') {
165                            tarteaucitron.userInterface.jsSizing('cookie');
166                        }
167                    }
168                });
169            }
170
171            if (typeof XMLHttpRequest !== 'undefined') {
172                origOpen = XMLHttpRequest.prototype.open;
173                XMLHttpRequest.prototype.open = function () {
174
175                    if (window.addEventListener) {
176                        this.addEventListener("load", function () {
177                            if (typeof tarteaucitronProLoadServices === 'function') {
178                                tarteaucitronProLoadServices();
179                            }
180                        }, false);
181                    } else if (typeof this.attachEvent !== 'undefined') {
182                        this.attachEvent("onload", function () {
183                            if (typeof tarteaucitronProLoadServices === 'function') {
184                                tarteaucitronProLoadServices();
185                            }
186                        });
187                    } else {
188                        if (typeof tarteaucitronProLoadServices === 'function') {
189                            setTimeout(tarteaucitronProLoadServices, 1000);
190                        }
191                    }
192
193                    try {
194                        origOpen.apply(this, arguments);
195                    } catch (err) {}
196                };
197            }
198        }
199
200        if(tarteaucitron.events.init) {
201            tarteaucitron.events.init();
202        }
203    },
204    "load": function () {
205        "use strict";
206        var cdn = tarteaucitron.cdn,
207            language = tarteaucitron.getLanguage(),
208            pathToLang = cdn + 'lang/tarteaucitron.' + language + '.js?v=' + tarteaucitron.version,
209            pathToServices = cdn + 'tarteaucitron.services.js?v=' + tarteaucitron.version,
210            linkElement = document.createElement('link'),
211            defaults = {
212                "adblocker": false,
213                "hashtag": '#tarteaucitron',
214                "cookieName": 'tarteaucitron',
215                "highPrivacy": true,
216                "orientation": "middle",
217                "removeCredit": false,
218                "showAlertSmall": true,
219                "cookieslist": true,
220                "handleBrowserDNTRequest": false,
221                "AcceptAllCta" : true,
222                "moreInfoLink": true,
223                "privacyUrl": "",
224                "useExternalCss": false,
225                "useExternalJs": false
226            },
227            params = tarteaucitron.parameters;
228
229        // Step -1      
230        if (typeof tarteaucitronCustomPremium !== 'undefined') {        
231            tarteaucitronCustomPremium();       
232        }
233        
234        // Step 0: get params
235        if (params !== undefined) {
236
237            for (var k in defaults) {
238                if(!tarteaucitron.parameters.hasOwnProperty(k)) {
239                    tarteaucitron.parameters[k] = defaults[k];
240                }
241            }
242        }
243
244        // global
245        tarteaucitron.orientation = tarteaucitron.parameters.orientation;
246        tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
247        tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
248        tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest;
249
250        // Step 1: load css
251        if ( !tarteaucitron.parameters.useExternalCss ) {
252            linkElement.rel = 'stylesheet';
253            linkElement.type = 'text/css';
254            linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version;
255            document.getElementsByTagName('head')[0].appendChild(linkElement);
256        }
257        // Step 2: load language and services
258        tarteaucitron.addScript(pathToLang, '', function () {
259
260          if(tarteaucitronCustomText !== ''){
261            tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
262          }
263            tarteaucitron.addScript(pathToServices, '', function () {
264
265
266                // css for new middle bar
267                if (tarteaucitron.orientation === 'middle') {
268                    var customThemeMiddle = document.createElement('style'),
269                        cssRuleMiddle = 'div#tarteaucitronRoot.tarteaucitronBeforeVisible:before {content: \'\';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 999;opacity: 0.5;}div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 50px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: auto;margin: auto;left: 50%;top: 50%;transform: translate(-50%, -50%);box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 50px 0;}
269span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 50px 0;display: block;text-align: center;font-size: 21px;}';
270
271                    customThemeMiddle.type = 'text/css';
272                    if (customThemeMiddle.styleSheet) {
273                        customThemeMiddle.styleSheet.cssText = cssRuleMiddle;
274                    } else {
275                        customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle));
276                    }
277                    document.getElementsByTagName('head')[0].appendChild(customThemeMiddle);
278                }
279
280                var body = document.body,
281                    div = document.createElement('div'),
282                    html = '',
283                    index,
284                    orientation = 'Top',
285                    cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other'],
286                    i;
287
288                cat = cat.sort(function (a, b) {
289                    if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; }
290                    if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; }
291                    return 0;
292                });
293
294                // Step 3: prepare the html
295                html += '<div id="tarteaucitronPremium"></div>';
296                html += '<button type="button" id="tarteaucitronBack" onclick="tarteaucitron.userInterface.closePanel();" aria-label="' + tarteaucitron.lang.close + '"></button>';
297                html += '<div id="tarteaucitron" role="dialog" aria-labelledby="dialogTitle">';
298                html += '   <button type="button" id="tarteaucitronClosePanel" onclick="tarteaucitron.userInterface.closePanel();">';
299                html += '       ' + tarteaucitron.lang.close;
300                html += '   </button>';
301                html += '   <div id="tarteaucitronServices">';
302                html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
303                html += '         <span class="tarteaucitronH1" role="heading" aria-level="1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>';
304                html += '         <div id="tarteaucitronInfo" class="tarteaucitronInfoBox">';
305                html += '         ' + tarteaucitron.lang.disclaimer;
306                if (tarteaucitron.parameters.privacyUrl !== "") {
307                    html += '   <br/><br/>';
308                    html += '   <button type="button" id="tarteaucitronPrivacyUrlDialog" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
309                    html += '       ' + tarteaucitron.lang.privacyUrl;
310                    html += '   </button>';
311                }
312                html += '         </div>';
313                html += '         <div class="tarteaucitronName">';
314                html += '            <span class="tarteaucitronH2" role="heading" aria-level="2">' + tarteaucitron.lang.all + '</span>';
315                html += '         </div>';
316                html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
317                html += '            <button type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respondAll(true);">';
318                html += '               &#10003; ' + tarteaucitron.lang.allowAll;
319                html += '            </button> ';
320                html += '            <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respondAll(false);">';
321                html += '               &#10007; ' + tarteaucitron.lang.denyAll;
322                html += '            </button>';
323                html += '         </div>';
324                html += '      </div>';
325                html += '      <div class="tarteaucitronBorder">';
326                html += '         <div class="clear"></div><ul>';
327                for (i = 0; i < cat.length; i += 1) {
328                    html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
329                    html += '            <div class="tarteaucitronTitle">';
330                    html += '               <button type="button" onclick="tarteaucitron.userInterface.toggle(\'tarteaucitronDetails' + cat[i] + '\', \'tarteaucitronInfoBox\');return false">&#10011; ' + tarteaucitron.lang[cat[i]].title + '</button>';
331                    html += '            </div>';
332                    html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails tarteaucitronInfoBox">';
333                    html += '               ' + tarteaucitron.lang[cat[i]].details;
334                    html += '            </div>';
335                    html += '         <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>';
336                }
337                html += '             <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>';
338                html += '         </ul>';
339                html += '         <div class="tarteaucitronHidden" id="tarteaucitronScrollbarChild" style="height:20px;
339display:block"></div>';
340                if (tarteaucitron.parameters.removeCredit === false) {
341                    html += '     <a class="tarteaucitronSelfLink" href="https://opt-out.ferank.eu/" rel="nofollow noreferrer noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '">🍋 ' + tarteaucitron.lang.credit + '</a>';
342                }
343                html += '       </div>';
344                html += '   </div>';
345                html += '</div>';
346
347                if (tarteaucitron.parameters.orientation === 'bottom') {
348                    orientation = 'Bottom';
349                }
350
351                if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
352                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
353                    //html += '<div class="tarteaucitronAlertBigWrapper">';
354                    html += '   <span class="titre">Hello,</span>';
355                    html += '   <span class="titre">wa are cookies...</span>';
356                    html += '   <span id="tarteaucitronDisclaimerAlert">';
357                    html += '       ' + tarteaucitron.lang.alertBigPrivacy;
358                    html += '   </span>';
359                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
360                    html += '   <button type="button" id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.openPanel
vendor: 1,792 bytes, lines 360-390
360();">';
361                    html += '       ' + tarteaucitron.lang.personalize;
362                    html += '   </button>';
363
364                    if (tarteaucitron.parameters.privacyUrl !== "") {
365                        html += '   <button type="button" id="tarteaucitronPrivacyUrl" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
366                        html += '       ' + tarteaucitron.lang.privacyUrl;
367                        html += '   </button>';
368                    }
369                    
370                    //html += '   </span>';
371                    //html += '</div>';
372                    html += '</div>';
373                } else {
374                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
375                    //html += '<div class="tarteaucitronAlertBigWrapper">';
376                    html += '   <span class="titre">Hello,</span><br>';
377                    html += '   <span class="titre">We are cookies...</span><br>';
378                    html += '   <span id="tarteaucitronDisclaimerAlert">';
379
380                    if (tarteaucitron.parameters.highPrivacy) {
381                        html += '       ' + tarteaucitron.lang.alertBigPrivacy;
382                    } else {
383                        html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
384                    }
385
386                    html += '   </span><br>';
387                    html += '   <span class="lire"><a href="./en/legal-information/">More information</a></span><br>';
388                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
389                    
390                    html += '   <button type="button" id="tarteaucitronCloseAlert" onclick="tarteaucitron.userInterface.openPanel
390();">';
391                    html += '       ' + tarteaucitron.lang.personalize;
392                    html += '   </button>';
393                    html += '   <button type="button" id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.respondAll(true);">';
394                    html += '       &#10003; ' + tarteaucitron.lang.acceptAll;
395                    html += '   </button>';
396
397                    if (tarteaucitron.parameters.privacyUrl !== "") {
398                        html += '   <button type="button" id="tarteaucitronPrivacyUrl" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
399                        html += '       ' + tarteaucitron.lang.privacyUrl;
400                        html += '   </button>';
401                    }
402
403                    //html += '   </span>';
404                    //html += '</div>';
405                    html += '</div>';
406                    html += '<div id="tarteaucitronPercentage"></div>';
407                }
408
409                if (tarteaucitron.parameters.showAlertSmall === true) {
410                    html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">';
411                    html += '   <button type="button" id="tarteaucitronManager" onclick="tarteaucitron.userInterface.openPanel
411();">';
412                    html += '       ' + tarteaucitron.lang.alertSmall;
413                    html += '       <span id="tarteaucitronDot">';
414                    html += '           <span id="tarteaucitronDotGreen"></span>';
415                    html += '           <span id="tarteaucitronDotYellow"></span>';
416                    html += '           <span id="tarteaucitronDotRed"></span>';
417                    html += '       </span>';
418                    if (tarteaucitron.parameters.cookieslist === true) {
419                        html += '   </button><!-- @whitespace';
420                        html += '   --><button type="button" id="tarteaucitronCookiesNumber" onclick="tarteaucitron.userInterface.toggleCookiesList();">0</button>';
421                        html += '   <div id="tarteaucitronCookiesListContainer">';
422                        html += '       <button type="button" id="tarteaucitronClosePanelCookie" onclick="tarteaucitron.userInterface.closePanel();">';
423                        html += '           ' + tarteaucitron.lang.close;
424                        html += '       </button>';
425                        html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
426                        html += '            <span class="tarteaucitronH2" role="heading" aria-level="2" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
427                        html += '       </div>';
428                        html += '       <div id="tarteaucitronCookiesList"></div>';
429                        html += '    </div>';
430                    } else {
431                        html += '   </div>';
432                    }
433                    html += '</div>';
434                }
435
436                tarteaucitron.addScript(tarteaucitron.cdn + 'advertising.js?v=' + tarteaucitron.version, '', function () {
437                    if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {
438
439                        // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
440                        /*var wrapper = document.createElement('div');
441                        wrapper.id = "contentWrapper";
442
443                        while (document.body.firstChild)
444                        {
445                            wrapper.appendChild(document.body.firstChild);
446                        }
447
448                        // Append the wrapper to the body
449                        document.body.appendChild(wrapper);*/
450
451                        div.id = 'tarteaucitronRoot';
452                        body.appendChild(div, body);
453                        div.innerHTML = html;
454                        
455                        //ie compatibility
456                        var tacRootAvailableEvent;
457                        if(typeof(Event) === 'function') {
458                            tacRootAvailableEvent = new Event("tac.root_available");
459                        }else{
460                            tacRootAvailableEvent = document.createEvent('Event');
461                            tacRootAvailableEvent.initEvent("tac.root_available", true, true);
462                        }
463                        //end ie compatibility
464                        
465                        window.dispatchEvent(tacRootAvailableEvent);
466
467                        if (tarteaucitron.job !== undefined) {
468                            tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
469                            for (index = 0; index < tarteaucitron.job.length; index += 1) {
470                                tarteaucitron.addService(tarteaucitron.job[index]);
471                            }
472                        } else {
473                            tarteaucitron.job = []
474                        }
475
476                        tarteaucitron.isAjax = true;
477
478                        tarteaucitron.job.push = function (id) {
479
480                            // ie <9 hack
481                            if (typeof tarteaucitron.job.indexOf === 'undefined') {
482                                tarteaucitron.job.indexOf = function (obj, start) {
483                                    var i,
484                                        j = this.length;
485                                    for (i = (start || 0); i < j; i += 1) {
486                                        if (this[i] === obj) { return i; }
487                                    }
488                                    return -1;
489                                };
490                            }
491
492                            if (tarteaucitron.job.indexOf(id) === -1) {
493                                Array.prototype.push.call(this, id);
494                            }
495                            tarteaucitron.launch[id] = false;
496                            tarteaucitron.addService(id);
497                        };
498
499                        if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
500                            tarteaucitron.userInterface.openPanel();
501                        }
502
503                        tarteaucitron.cookie.number();
504                        setInterval(tarteaucitron.cookie.number, 60000);
505                    }
506                }, tarteaucitron.parameters.adblocker);
507
508                if (tarteaucitron.parameters.adblocker === true) {
509                    setTimeout(function () {
510                        if (tarteaucitronNoAdBlocker === false) {
511                            html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '" style="display:block" role="alert" aria-live="polite">';
512                            html += '   <p id="tarteaucitronDisclaimerAlert">';
513                            html += '       ' + tarteaucitron.lang.adblock + '<br/>';
514                            html += '       <strong>' + tarteaucitron.lang.adblock_call + '</strong>';
515                            html += '   </p>';
516                            html += '   <button type="button" id="tarteaucitronPersonalize" onclick="location.reload();">';
517                            html += '       ' + tarteaucitron.lang.reload;
518                            html += '   </button>';
519                            html += '</div>';
520                            html += '<div id="tarteaucitronPremium"></div>';
521
522                            div.id = 'tarteaucitronRoot';
523                            body.appendChild(div, body);
524                            div.innerHTML = html;
525                        }
526                    }, 1500);
527                }
528            });
529        });
530
531        if(tarteaucitron.events.load) {
532            tarteaucitron.events.load();
533        }
534    },
535    "addService": function (serviceId) {
536        "use strict";
537        var html = '',
538            s = tarteaucitron.services,
539            service = s[serviceId],
540            cookie = tarteaucitron.cookie.read(),
541            hostname = document.location.hostname,
542            hostRef = document.referrer.split('/')[2],
543            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl),
544            isAutostart = (!service.needConsent),
545            isWaiting = (cookie.indexOf(service.key + '=wait') >= 0),
546            isDenied = (cookie.indexOf(service.key + '=false') >= 0),
547            isAllowed = (cookie.indexOf(service.key + '=true') >= 0),
548            isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
549            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1");
550
551        if (tarteaucitron.added[service.key] !== true) {
552            tarteaucitron.added[service.key] = true;
553
554            html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
555            html += '   <div class="tarteaucitronName">';
556            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>';
557            html += '       <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
558
559            if (tarteaucitron.parameters.moreInfoLink == true) {
560
561                var link = 'https://opt-out.ferank.eu/service/' + service.key + '/';
562                if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
563                    link = service.readmoreLink;
564                }
565                if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
566                    link = tarteaucitron.parameters.readmoreLink;
567                }
568                html += '       <a href="' + link + '" target="_blank" rel="noreferrer noopener" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'">';
569                html += '           ' + tarteaucitron.lang.more;
570                html += '       </a>';
571                html += '        - ';
572                html += '       <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + service.name + ' ' + tarteaucitron.lang.newWindow + '">';
573                html += '           ' + tarteaucitron.lang.source;
574                html += '       </a>';
575            }
576
577            html += '   </div>';
578            html += '   <div class="tarteaucitronAsk">';
579            html += '       <button type="button" id="' + service.key + 'Allowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respond(this, true);">';
580            html += '           &#10003; ' + tarteaucitron.lang.allow;
581            html += '       </button> ';
582            html += '       <button type="button" id="' + service.key  + 'Denied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respond(this, false);">';
583            html += '           &#10007; ' + tarteaucitron.lang.deny;
584            html += '       </button>';
585            html += '   </div>';
586            html += '</li>';
587
588            tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');
589
590            if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
591                document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
592            }
593
594            tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
595
596            tarteaucitron.userInterface.order(service.type);
597        }
598
599        tarteaucitron.pro('!' + service.key + '=' + isAllowed);
600
601        // allow by default for non EU
602        if (isResponded === false && tarteaucitron.user.bypass === true) {
603            isAllowed = true;
604            tarteaucitron.cookie.create(service.key, true);
605        }
606
607        if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
608            if (!isAllowed) {
609                tarteaucitron.cookie.create(service.key, true);
610            }
611            if (tarteaucitron.launch[service.key] !== true) {
612                tarteaucitron.launch[service.key] = true;
613                service.js();
614                tarteaucitron.sendEvent(service.key + '_loaded');
615            }
616            tarteaucitron.state[service.key] = true;
617            tarteaucitron.userInterface.color(service.key, true);
618        } else if (isDenied) {
619            if (typeof service.fallback === 'function') {
620                service.fallback();
621            }
622            tarteaucitron.state[service.key] = false;
623            tarteaucitron.userInterface.color(service.key, false);
624        } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
625            tarteaucitron.cookie.create(service.key, 'false');
626            if (typeof service.fallback === 'function') {
627                service.fallback();
628            }
629            tarteaucitron.state[service.key] = false;
630            tarteaucitron.userInterface.color(service.key, false);
631        } else if (!isResponded) {
632            tarteaucitron.cookie.create(service.key, 'wait');
633            if (typeof service.fallback === 'function') {
634                service.fallback();
635            }
636            tarteaucitron.userInterface.color(service.key, 'wait');
637            tarteaucitron.userInterface.openAlert();
638        }
639
640        tarteaucitron.cookie.checkCount(service.key);
641    },
642    "sendEvent" : function(event_key) {
643        if(event_key !== undefined) {
644            //ie compatibility
645            var send_event_item;
646            if(typeof(Event) === 'function') {
647                send_event_item = new Event(event_key);
648            }else{
649                send_event_item = document.createEvent('Event');
650                send_event_item.initEvent(event_key, true, true);
651            }
652            //end ie compatibility
653
654            document.dispatchEvent(send_event_item);
655        }
656    },
657    "cleanArray": function cleanArray(arr) {
658        "use strict";
659        var i,
660            len = arr.length,
661            out = [],
662            obj = {},
663            s = tarteaucitron.services;
664
665        for (i = 0; i < len; i += 1) {
666            if (!obj[arr[i]]) {
667                obj[arr[i]] = {};
668                if (tarteaucitron.services[arr[i]] !== undefined) {
669                    out.push(arr[i]);
670                }
671            }
672        }
673
674        out = out.sort(function (a, b) {
675            if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
676            if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; }
677            return 0;
678        });
679
680        return out;
681    },
682    "userInterface": {
683        "css": function (id, property, value) {
684            "use strict";
685            if (document.getElementById(id) !== null) {
686                document.getElementById(id).style[property] = value;
687            }
688        },
689        "addClass": function (id, className) {
690            "use strict";
691            if (document.getElementById(id) !== null) {
692                document.getElementById(id).classList.add(className);
693            }
694        },
695        "removeClass": function (id, className) {
696            "use strict";
697            if (document.getElementById(id) !== null) {
698                document.getElementById(id).classList.remove(className);
699            }
700        },
701        "respondAll": function (status) {
702            "use strict";
703            var s = tarteaucitron.services,
704                service,
705                key,
706                index = 0;
707
708            for (index = 0; index < tarteaucitron.job.length; index += 1) {
709                service = s[tarteaucitron.job[index]];
710                key = service.key;
711                if (tarteaucitron.state[key] !== status) {
712                    if (status === false && tarteaucitron.launch[key] === true) {
713                        tarteaucitron.reloadThePage = true;
714                    }
715                    if (tarteaucitron.launch[key] !== true && status === true) {
716
717                        tarteaucitron.pro('!' + key + '=engage');
718
719                        tarteaucitron.launch[key] = true;
720                        tarteaucitron.services[key].js();
721                    }
722                    tarteaucitron.state[key] = status;
723                    tarteaucitron.cookie.create(key, status);
724                    tarteaucitron.userInterface.color(key, status);
725                }
726            }
727        },
728        "respond": function (el, status) {
729            "use strict";
730            var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
731
732            // return if same state
733            if (tarteaucitron.state[key] === status) {
734                return;
735            }
736
737            if (status === false && tarteaucitron.launch[key] === true) {
738                tarteaucitron.reloadThePage = true;
739            }
740
741            // if not already launched... launch the service
742            if (status === true) {
743                if (tarteaucitron.launch[key] !== true) {
744
745                    tarteaucitron.pro('!' + key + '=engage');
746
747                    tarteaucitron.launch[key] = true;
748                    tarteaucitron.services[key].js();
749                }
750            }
751            tarteaucitron.state[key] = status;
752            tarteaucitron.cookie.create(key, status);
753            tarteaucitron.userInterface.color(key, status);
754        },
755        "color": function (key, status) {
756            "use strict";
757            var c = 'tarteaucitron',
758                nbDenied = 0,
759                nbPending = 0,
760                nbAllowed = 0,
761                sum = tarteaucitron.job.length,
762                index;
763
764            if (status === true) {
765                document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed');
766                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied');
767            } else if (status === false) {
768                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsAllowed');
769                document.getElementById(key + 'Line').classList.add('tarteaucitronIsDenied');
770            }
771
772            // check if all services are allowed
773            for (index = 0; index < sum; index += 1) {
774                if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
775                    nbDenied += 1;
776                } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
777                    nbPending += 1;
778                } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
779                    nbAllowed += 1;
780                }
781            }
782
783            tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
784            tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
785            tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
786
787            if (nbDenied === 0 && nbPending === 0) {
788                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
789                tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected');
790
791                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
792                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
793            } else if (nbAllowed === 0 && nbPending === 0) {
794                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
795                tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
796
797                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
798                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
799            } else {
800                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
801                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
802
803                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
804                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
805            }
806
807            // close the alert if all service have been reviewed
808            if (nbPending === 0) {
809                tarteaucitron.userInterface.closeAlert();
810            }
811
812            if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
813                tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
814            }
815
816            if (status === true) {
817                if (document.getElementById('tacCL' + key) !== null) {
818                    document.getElementById('tacCL' + key).innerHTML = '...';
819                }
820                setTimeout(function () {
821                    tarteaucitron.cookie.checkCount(key);
822                }, 2500);
823            } else {
824                tarteaucitron.cookie.checkCount(key);
825            }
826        },
827        "openPanel": function () {
828            "use strict";
829
830            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
831            tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
832            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
833
834            document.getElementById('tarteaucitronClosePanel').focus();
835            document.getElementsByTagName('body')[0].classList.add('modal-open');
836            tarteaucitron.userInterface.focusTrap();
837            tarteaucitron.userInterface.jsSizing('main');
838            
839            //ie compatibility
840            var tacOpenPanelEvent;
841            if(typeof(Event) === 'function') {
842                tacOpenPanelEvent = new Event("tac.open_panel");
843            }else{
844                tacOpenPanelEvent = document.createEvent('Event');
845                tacOpenPanelEvent.initEvent("tac.open_panel", true, true);
846            }
847            //end ie compatibility
848            
849            window.dispatchEvent(tacOpenPanelEvent);
850        },
851        "closePanel": function () {
852            "use strict";
853
854            if (document.location.hash === tarteaucitron.hashtag) {
855                if (window.history) {
856                    window.history.replaceState('', document.title, window.location.pathname + window.location.search);
857                } else {
858                    document.location.hash = '';
859                }
860            }
861            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
862            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
863
864            tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
865                elem.style.display = 'none';
866            }, true);
867
868            if (tarteaucitron.reloadThePage === true) {
869                window.location.reload();
870            } else {
871                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
872            }
873            if (document.getElementById('tarteaucitronCloseAlert') !== null) {
874                document.getElementById('tarteaucitronCloseAlert').focus();
875            }
876            document.getElementsByTagName('body')[0].classList.remove('modal-open');
877            
878            //ie compatibility
879            var tacClosePanelEvent;
880            if(typeof(Event) === 'function') {
881                tacClosePanelEvent = new Event("tac.close_panel");
882            }else{
883                tacClosePanelEvent = document.createEvent('Event');
884                tacClosePanelEvent.initEvent("tac.close_panel", true, true);
885            }
886            //end ie compatibility
887            
888            window.dispatchEvent(tacClosePanelEvent);
889        },
890        "focusTrap": function() {
891            "use strict";
892
893            var focusableEls,
894                firstFocusableEl,
895                lastFocusableEl,
896                filtered;
897
898            focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button');
899            filtered = [];
900
901            // get only visible items
vendor: 5,646 bytes, lines 902-1036
902            for (var i = 0, max = focusableEls.length; i < max; i++) {
903                if (focusableEls[i].offsetHeight > 0) {
904                   filtered.push(focusableEls[i]);
905                }
906            }
907
908            firstFocusableEl = filtered[0];
909            lastFocusableEl = filtered[filtered.length - 1];
910
911            //loop focus inside tarteaucitron
912            document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) {
913
914                if ( evt.key === 'Tab' || evt.keyCode === 9 ) {
915
916                    if ( evt.shiftKey ) /* shift + tab */ {
917                        if (document.activeElement === firstFocusableEl) {
918                            lastFocusableEl.focus();
919                            evt.preventDefault();
920                        }
921                    } else /* tab */ {
922                        if (document.activeElement === lastFocusableEl) {
923                            firstFocusableEl.focus();
924                            evt.preventDefault();
925                        }
926                    }
927                }
928            })
929        },
930        "openAlert": function () {
931            "use strict";
932            var c = 'tarteaucitron';
933            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
934            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
935            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'block');
936            tarteaucitron.userInterface.addClass(c + 'Root',   'tarteaucitronBeforeVisible');
937
938            //ie compatibility
939            var tacOpenAlertEvent;
940            if(typeof(Event) === 'function') {
941                tacOpenAlertEvent = new Event("tac.open_alert");
942            }else{
943                tacOpenAlertEvent = document.createEvent('Event');
944                tacOpenAlertEvent.initEvent("tac.open_alert", true, true);
945            }
946            //end ie compatibility
947            
948            window.dispatchEvent(tacOpenAlertEvent);
949        },
950        "closeAlert": function () {
951            "use strict";
952            var c = 'tarteaucitron';
953            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
954            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
955            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'none');
956            tarteaucitron.userInterface.removeClass(c + 'Root',   'tarteaucitronBeforeVisible');
957            tarteaucitron.userInterface.jsSizing('box');
958            
959            //ie compatibility
960            var tacCloseAlertEvent;
961            if(typeof(Event) === 'function') {
962                tacCloseAlertEvent = new Event("tac.close_alert");
963            }else{
964                tacCloseAlertEvent = document.createEvent('Event');
965                tacCloseAlertEvent.initEvent("tac.close_alert", true, true);
966            }
967            //end ie compatibility
968            
969            window.dispatchEvent(tacCloseAlertEvent);
970        },
971        "toggleCookiesList": function () {
972            "use strict";
973            var div = document.getElementById('tarteaucitronCookiesListContainer');
974
975            if (div === null) {
976                return;
977            }
978
979            if (div.style.display !== 'block') {
980                tarteaucitron.cookie.number();
981                div.style.display = 'block';
982                tarteaucitron.userInterface.jsSizing('cookie');
983                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
984                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
985                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
986                    elem.style.display = 'none';
987                }, true);
988            } else {
989                div.style.display = 'none';
990                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
991                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
992            }
993        },
994        "toggle": function (id, closeClass) {
995            "use strict";
996            var div = document.getElementById(id);
997
998            if (div === null) {
999                return;
1000            }
1001
1002            if (closeClass !== undefined) {
1003                tarteaucitron.fallback([closeClass], function (elem) {
1004                    if (elem.id !== id) {
1005                        elem.style.display = 'none';
1006                    }
1007                }, true);
1008            }
1009
1010            if (div.style.display !== 'block') {
1011                div.style.display = 'block';
1012            } else {
1013                div.style.display = 'none';
1014            }
1015        },
1016        "order": function (id) {
1017            "use strict";
1018            var main = document.getElementById('tarteaucitronServices_' + id),
1019                allDivs,
1020                store = [],
1021                i;
1022
1023            if (main === null) {
1024                return;
1025            }
1026
1027            allDivs = main.childNodes;
1028
1029            if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') {
1030                Array.prototype.map.call(main.children, Object).sort(function (a, b) {
1031                //var mainChildren = Array.from(main.children);
1032                //mainChildren.sort(function (a, b) {
1033                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
1034                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
1035                    return 0;
1036                }
1036).forEach(function (element) {
1037                    main.appendChild(element);
1038                });
1039            }
1040        },
1041        "jsSizing": function (type) {
1042            "use strict";
1043            var scrollbarMarginRight = 10,
1044                scrollbarWidthParent,
1045                scrollbarWidthChild,
1046                servicesHeight,
1047                e = window,
1048                a = 'inner',
1049                windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
1050                mainTop,
1051                mainHeight,
1052                closeButtonHeight,
1053                headerHeight,
1054                cookiesListHeight,
1055                cookiesCloseHeight,
1056                cookiesTitleHeight,
1057                paddingBox,
1058                alertSmallHeight,
1059                cookiesNumberHeight;
1060
1061            if (type === 'box') {
1062                if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) {
1063
1064                    // reset
1065                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');
1066
1067                    // calculate
1068                    alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight;
1069                    cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight;
1070                    paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;
1071
1072                    // apply
1073                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
1074                }
1075            } else if (type === 'main') {
1076
1077                // get the real window width for media query
1078                if (window.innerWidth === undefined) {
1079                    a = 'client';
1080                    e = document.documentElement || document.body;
1081                }
1082
1083                // height of the services list container
1084                if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) {
1085
1086                    // reset
1087                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto');
1088
1089                    // calculate
1090                    mainHeight = document.getElementById('tarteaucitron').offsetHeight;
1091                    closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight;
1092
1093                    // apply
1094                    servicesHeight = (mainHeight - closeButtonHeight + 2);
1095                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px');
1096                    tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto');
1097                }
1098
1099                // align the main allow/deny button depending on scrollbar width
1100                if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) {
1101
1102                    // media query
1103                    if (e[a + 'Width'] <= 479) {
1104                        tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
1105                    } else if (e[a + 'Width'] <= 767) {
1106                        scrollbarMarginRight = 12;
1107                    }
1108
1109                    scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth;
1110                    scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth;
1111                    tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px');
1112                }
1113
1114                // center the main panel
1115                if (document.getElementById('tarteaucitron') !== null) {
1116
1117                    // media query
1118                    if (e[a + 'Width'] <= 767) {
1119                        mainTop = 0;
1120                    } else {
1121                        mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21;
1122                    }
1123
1124                    if (document.getElementById('tarteaucitronMainLineOffset') !== null) {
1125                        if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) {
1126                            mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
1127                        }
1128                    }
1129
1130                    // correct
1131                    if (mainTop < 0) {
1132                        mainTop = 0;
1133                    }
1134
1135                    // apply
1136                    tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px');
1137                }
1138
1139
1140            } else if (type === 'cookie') {
1141
1142                // put cookies list at bottom
1143                if (document.getElementById('tarteaucitronAlertSmall') !== null) {
1144                    tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px');
1145                }
1146
1147                // height of cookies list
1148                if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
1149
1150                    // reset
1151                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');
1152
1153                    // calculate
1154                    cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight;
1155                    cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight;
1156                    cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight;
1157
1158                    // apply
1159                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 11,261 bytes, lines 1159-1410
1159sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px');
1160                }
1161            }
1162        }
1163    },
1164    "cookie": {
1165        "owner": {},
1166        "create": function (key, status) {
1167            "use strict";
1168
1169            if (tarteaucitronForceExpire !== '') {
1170                // The number of day(s)/hour(s) can't be higher than 1 year
1171                if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) {
1172                    if (tarteaucitronExpireInDay) {
1173                        // Multiplication to tranform the number of days to milliseconds
1174                        timeExpire = tarteaucitronForceExpire * 86400000;
1175                    } else {
1176                        // Multiplication to tranform the number of hours to milliseconds
1177                        timeExpire = tarteaucitronForceExpire * 3600000;
1178                    }
1179                }
1180            }
1181
1182            var d = new Date(),
1183                time = d.getTime(),
1184                expireTime = time + timeExpire, // 365 days
1185                regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
1186                cookie = tarteaucitron.cookie.read().replace(regex, ""),
1187                value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
1188                domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : '';
1189
1190            d.setTime(expireTime);
1191            document.cookie = value + '; expires=' + d.toGMTString() + '; path=/;' + domain;
1192        },
1193        "read": function () {
1194            "use strict";
1195            var nameEQ = tarteaucitron.parameters.cookieName + "=",
1196                ca = document.cookie.split(';'),
1197                i,
1198                c;
1199
1200            for (i = 0; i < ca.length; i += 1) {
1201                c = ca[i];
1202                while (c.charAt(0) === ' ') {
1203                    c = c.substring(1, c.length);
1204                }
1205                if (c.indexOf(nameEQ) === 0) {
1206                    return c.substring(nameEQ.length, c.length);
1207                }
1208            }
1209            return '';
1210        },
1211        "purge": function (arr) {
1212            "use strict";
1213            var i;
1214
1215            for (i = 0; i < arr.length; i += 1) {
1216                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
1217                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
1218                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
1219            }
1220        },
1221        "checkCount": function (key) {
1222            "use strict";
1223            var arr = tarteaucitron.services[key].cookies,
1224                nb = arr.length,
1225                nbCurrent = 0,
1226                html = '',
1227                i,
1228                status = document.cookie.indexOf(key + '=true');
1229
1230            if (status >= 0 && nb === 0) {
1231                html += tarteaucitron.lang.useNoCookie;
1232            } else if (status >= 0) {
1233                for (i = 0; i < nb; i += 1) {
1234                    if (document.cookie.indexOf(arr[i] + '=') !== -1) {
1235                        nbCurrent += 1;
1236                        if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
1237                            tarteaucitron.cookie.owner[arr[i]] = [];
1238                        }
1239                        if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
1240                            tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
1241                        }
1242                    }
1243                }
1244
1245                if (nbCurrent > 0) {
1246                    html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie';
1247                    if (nbCurrent > 1) {
1248                        html += 's';
1249                    }
1250                    html += '.';
1251                } else {
1252                    html += tarteaucitron.lang.useNoCookie;
1253                }
1254            } else if (nb === 0) {
1255                html = tarteaucitron.lang.noCookie;
1256            } else {
1257                html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
1258                if (nb > 1) {
1259                    html += 's';
1260                }
1261                html += '.';
1262            }
1263
1264            if (document.getElementById('tacCL' + key) !== null) {
1265                document.getElementById('tacCL' + key).innerHTML = html;
1266            }
1267        },
1268        "crossIndexOf": function (arr, match) {
1269            "use strict";
1270            var i;
1271            for (i = 0; i < arr.length; i += 1) {
1272                if (arr[i] === match) {
1273                    return true;
1274                }
1275            }
1276            return false;
1277        },
1278        "number": function () {
1279            "use strict";
1280            var cookies = document.cookie.split(';'),
1281                nb = (document.cookie !== '') ? cookies.length : 0,
1282                html = '',
1283                i,
1284                name,
1285                namea,
1286                nameb,
1287                c,
1288                d,
1289                s = (nb > 1) ? 's' : '',
1290                savedname,
1291                regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
1292                regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
1293                host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;
1294
1295            cookies = cookies.sort(function (a, b) {
1296                namea = a.split('=', 1).toString().replace(/ /g, '');
1297                nameb = b.split('=', 1).toString().replace(/ /g, '');
1298                c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
1299                d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
1300                if (c + a > d + b) { return 1; }
1301                if (c + a < d + b) { return -1; }
1302                return 0;
1303            });
1304
1305            if (document.cookie !== '') {
1306                for (i = 0; i < nb; i += 1) {
1307                    name = cookies[i].split('=', 1).toString().replace(/ /g, '');
1308                    if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
1309                        savedname = tarteaucitron.cookie.owner[name].join(' // ');
1310                        html += '<div class="tarteaucitronHidden">';
1311                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
1312                        html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
1313                        html += '    </span>';
1314                        html += '</div><ul class="cookie-list">';
1315                    } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
1316                        savedname = host;
1317                        html += '<div class="tarteaucitronHidden">';
1318                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
1319                        html += '        ' + host;
1320                        html += '    </span>';
1321                        html += '</div><ul class="cookie-list">';
1322                    }
1323                    html += '<li class="tarteaucitronCookiesListMain">';
1324                    html += '    <div class="tarteaucitronCookiesListLeft"><button type="button" onclick="tarteaucitron.cookie.purge([\'' + cookies[i].split('=', 1) + '\']);tarteaucitron.cookie.number();tarteaucitron.userInterface.jsSizing(\'cookie\');return false"><strong>&times;</strong></button> <strong>' + name + '</strong>';
1325                    html += '    </div>';
1326                    html += '    <div class="tarteaucitronCookiesListRight">' + cookies[i].split('=').slice(1).join('=') + '</div>';
1327                    html += '</li>';
1328                }
1329                html += '</ul>';
1330            } else {
1331                html += '<div class="tarteaucitronCookiesListMain">';
1332                html += '    <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
1333                html += '    <div class="tarteaucitronCookiesListRight"></div>';
1334                html += '</div>';
1335            }
1336
1337            html += '<div class="tarteaucitronHidden" style="height:20px;display:block"></div>';
1338
1339            if (document.getElementById('tarteaucitronCookiesList') !== null) {
1340                document.getElementById('tarteaucitronCookiesList').innerHTML = html;
1341            }
1342
1343            if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
1344                document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
1345            }
1346
1347            if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
1348                document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
1349            }
1350
1351            for (i = 0; i < tarteaucitron.job.length; i += 1) {
1352                tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
1353            }
1354        }
1355    },
1356    "getLanguage": function () {
1357        "use strict";
1358
1359        var availableLanguages = 'cs,de,en,es,fr,it,nl,pl,pt,ru,el,ro,bg,ja,cn',
1360            defaultLanguage = 'en';
1361        
1362        if (tarteaucitronForceLanguage !== '') {
1363            if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
1364                return tarteaucitronForceLanguage;
1365            }
1366        }
1367        
1368        if (!navigator) { return 'en'; }
1369        
1370        var lang = navigator.language || navigator.browserLanguage ||
1371                navigator.systemLanguage || navigator.userLang || null,
1372            userLanguage = lang ? lang.substr(0, 2) : null;
1373
1374        if (availableLanguages.indexOf(userLanguage) === -1) {
1375            return defaultLanguage;
1376        }
1377        return userLanguage;
1378    },
1379    "getLocale": function () {
1380        "use strict";
1381        if (!navigator) { return 'en_US'; }
1382
1383        var lang = navigator.language || navigator.browserLanguage ||
1384                navigator.systemLanguage || navigator.userLang || null,
1385            userLanguage = lang ? lang.substr(0, 2) : null;
1386
1387        if (userLanguage === 'fr') {
1388            return 'fr_FR';
1389        } else if (userLanguage === 'en') {
1390            return 'en_US';
1391        } else if (userLanguage === 'de') {
1392            return 'de_DE';
1393        } else if (userLanguage === 'es') {
1394            return 'es_ES';
1395        } else if (userLanguage === 'it') {
1396            return 'it_IT';
1397        } else if (userLanguage === 'pt') {
1398            return 'pt_PT';
1399        } else if (userLanguage === 'nl') {
1400            return 'nl_NL';
1401        } else if (userLanguage === 'el') {
1402            return 'el_EL';
1403        } else {
1404            return 'en_US';
1405        }
1406    },
1407    "addScript": function (url, id, callback, execute, attrName, attrVal) {
1408        "use strict";
1409        var script,
1410            done = false;
1411
1412        if (execute === false) {
1413            if (typeof callback === 'function') {
1414                callback();
1415            }
1416        } else {
1417            script = document.createElement('script');
1418            script.type = 'text/javascript';
1419            script.id = (id !== undefined) ? id : '';
1420            script.async = true;
1421            script.src = url;
1422
1423            if (attrName !== undefined && attrVal !== undefined) {
1424                script.setAttribute(attrName, attrVal);
1425            }
1426
1427            if (typeof callback === 'function') {
1428                if ( !tarteaucitron.parameters.useExternalJs ) {
1429                    script.onreadystatechange = script.onload = function () {
1430                        var state = script.readyState;
1431                        if (!done && (!state || /loaded|complete/.test(state))) {
1432                            done = true;
1433                            callback();
1434                        }
1435                    };
1436                } else {
1437                    callback();
1438                }
1439            }
1440
1441            if ( !tarteaucitron.parameters.useExternalJs ) {
1442                document.getElementsByTagName('head')[0].appendChild(script);
1443            }
1444        }
1445    },
1446    "makeAsync": {
1447        "antiGhost": 0,
1448        "buffer": '',
1449        "init": function (url, id) {
1450            "use strict";
1451            var savedWrite = document.write,
1452                savedWriteln = document.writeln;
1453
1454            document.write = function (content) {
1455                tarteaucitron.makeAsync.buffer += content;
1456            };
1457            document.writeln = function (content) {
1458                tarteaucitron.makeAsync.buffer += content.concat("\n");
1459            };
1460
1461            setTimeout(function () {
1462                document.write = savedWrite;
1463                document.writeln = savedWriteln;
1464            }, 20000);
1465
1466            tarteaucitron.makeAsync.getAndParse(url, id);
1467        },
1468        "getAndParse": function (url, id) {
1469            "use strict";
1470            if (tarteaucitron.makeAsync.antiGhost > 9) {
1471                tarteaucitron.makeAsync.antiGhost = 0;
1472                return;
1473            }
1474            tarteaucitron.makeAsync.antiGhost += 1;
1475            tarteaucitron.addScript(url, '', function () {
1476                if (document.getElementById(id) !== null) {
1477                    document.getElementById(id).innerHTML += "<span style='display:none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
1478                    tarteaucitron.makeAsync.buffer = '';
1479                    tarteaucitron.makeAsync.execJS(id);
1480                }
1481            });
1482        },
1483        "execJS": function (id) {
1484            /* not strict because third party scripts may have errors */
1485            var i,
1486                scripts,
1487                childId,
1488                type;
1489
1490            if (document.getElementById(id) === null) {
1491                return;
1492            }
1493
1494            scripts = document.getElementById(id).getElementsByTagName('script');
1495            for (i = 0; i < scripts.length; i += 1) {
1496                type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
1497                if (type === '') {
1498                    type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
1499                }
1500                if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
1501                    childId = id + Math.floor(Math.random() * 99999999999);
1502                    document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
1503                    tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
1504                } else if (type.indexOf('javascript') !== -1 || type === '') {
1505                    eval(scripts[i].innerHTML);
1506                }
1507            }
1508        }
1509    },
1510    "fallback": function (matchClass, content, noInner) {
1511        "use strict";
1512        var elems = document.getElementsByTagName('*'),
1513            i,
1514            index = 0;
1515
1516        for (i in elems) {
1517            if (elems[i] !== undefined) {
1518                for (index = 0; index < matchClass.length; index += 1) {
1519                    if ((' ' + elems[i].className + ' ')
1520                            .indexOf(' ' + matchClass[index] + ' ') > -1) {
1521                        if (typeof content === 'function') {
1522                            if (noInner === true) {
1523                                content(elems[i]);
1524                            } else {
1525                                elems[i].innerHTML = content(elems[i]);
1526                            }
1527                        } else {
1528                            elems[i].innerHTML = content;
1529                        }
1530                    }
1531                }
1532            }
1533        }
1534    },
1535    "engage": function (id) {
1536        "use strict";
1537        var html = '',
1538            r = Math.floor(Math.random() * 100000),
1539            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;
1540
1541        if (tarteaucitron.lang['engage-' + id] !== undefined) {
1542            engage = tarteaucitron.lang['engage-' + id];
1543        }
1544
1545        html += '<div class="tac_activate">';
1546        html += '   <div class="tac_float">';
1547        html += '      ' + engage;
1548        html += '      <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">';
1549        html += '          &#10003; ' + tarteaucitron.lang.allow;
1550        html += '       </button>';
1551        html += '   </div>';
1552        html += '</div>';
1553
1554        return html;
1555    },
1556    "extend": function (a, b) {
1557        "use strict";
1558        var prop;
1559        for (prop in b) {
1560            if (b.hasOwnProperty(prop)) {
1561                a[prop] = b[prop];
1562            }
1563        }
1564    },
1565    "proTemp": '',
1566    "proTimer": function () {
1567        "use strict";
1568        setTimeout(tarteaucitron.proPing, 500);
1569    },
1570    "pro": function (list) {
1571        "use strict";
1572        tarteaucitron.proTemp += list;
1573        clearTimeout(tarteaucitron.proTimer);
1574        tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 500);
1575    },
1576    "proPing": function () {
1577        "use strict";
1578        if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') {
1579            var div = document.getElementById('tarteaucitronPremium'),
1580                timestamp = new Date().getTime(),
1581                url = 'https://opt-out.ferank.eu/log/?';
1582
1583            if (div === null) {
1584                return;
1585            }
1586
1587            url += 'account=' + tarteaucitron.uuid + '&';
1588            url += 'domain=' + tarteaucitron.domain + '&';
1589            url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
1590            url += '_time=' + timestamp;
1591
1592            div.innerHTML = '<img src="' + url + '" style="display:none" />';
1593
1594            tarteaucitron.proTemp = '';
1595        }
1596
1597        tarteaucitron.cookie.number();
1598    },
1599    "AddOrUpdate" : function(source, custom){
1600        /**
1601         Utility function to Add or update the fields of obj1 with the ones in obj2
1602         */
1603        for(key in custom){
1604            if(custom[key] instanceof Object){
1605                source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
1606            }else{
1607                source[key] = custom[key];
1608            }
1609        }
1610        return source;
1611    },
1612    "getElemWidth": function(elem) {
1613        return elem.getAttribute('width') || elem.clientWidth;
1614    },
1615    "getElemHeight": function(elem) {
1616        return elem.getAttribute('height') || elem.clientHeight;
1617    }
1618};

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.