PageSourceSearch

https://www.b4fn.org/fileadmin/templates/common/nvcc_6/js/js.functions.js

js b4fn.org collected 2026-10-02 06:42:47 UTC 26,533 bytes, 618 lines download raw bytes

1var cookieAnalytics = ['_ga', '_gat', '_gid' ,'__utmt' ,'__utma' ,'__utmb' ,'__utmc' ,'__utmz']
2var CookieConsentPreference = { necessary: true, preferences: false, statistics: false, marketing: false, unclassified: false };
3var CookieConsentDefault = { necessary: true, preferences: false, statistics: false, marketing: false, unclassified: false };
4var CookieConsentGetParse = {};
5var scriptArray = document.getElementsByTagName("script");
6var NVCChostname = NVCCGetHostname(window.location.hostname);
7var CookieConsentGet = Cookies.get('CookieConsent', { domain: NVCChostname, path: '/' });
8var onNVSliderAction = 'updateCookie';
9
10function NVShowOpacity () {
11  document.body.style.cssText = "opacity: 0.40; pointer-events: none;"; 
12}
13
14function NVHideOpacity () {
15  document.body.style.cssText = "opacity: ; pointer-events: ;"; 
16}
17
18function getNVSwalHtml() {
19  var addStyle = nvccLayout=='modal' ? ' style="display: none;"' : '';
20  var addAlertLogo = alertLogo > '' ? '<img id="NVCCDialogPoweredbyImage" src="'+alertLogo+'">' : '<div  class="swal2-icon swal2-warning swal2-animate-warning-icon" style="display: flex; display: flex;margin-left: 21.5px;margin-top: 4px;"><span class="swal2-icon-text">!</span></div>';
21  var html='<div id="NVCCDialog" name="NVCCDialog" role="alertdialog" aria-describedby="NVCCDialogBodyContentTitle">\
22   <div id="NVCCDialogBody">\
23   <div id="NVCCDialogPoweredbyLink" '+addStyle+'>'+addAlertLogo+'</div>\
24    <div id="NVCCDialogBodyContent">\
25    <h2 id="NVCCDialogBodyContentTitle" '+addStyle+'>'+cookieDialog.header+'</h2>\
26     <div id="NVCCDialogBodyContentText">\
27     '+cookieDialog['body']+'</div>\
28    </div>\
29    <div id="NVCCDialogBodyLevelWrapper" style="display: block;">\
30    <div id="NVCCDialogBodyLevelButtonAcceptWrapper" '+addStyle+'><a id="NVCCDialogBodyLevelButtonAccept" href="javascript: onNVSliderCloseAction(\''+onNVSliderAction+'\');" tabindex="1" > OK </a></div>\
31     <div id="NVCCDialogBodyLevelButtons" style="float: left;">\
32      <div id="NVCCDialogBodyLevelButtonsTable" style="width: auto;">\
33       <div id="NVCCDialogBodyLevelButtonsRow">\
34        '+getNVCCDialogBodyLevelButtonsSelectPane()+'<div id="NVCCDialogBodyLevelDetailsWrapper">\
35         <a id="NVCCDialogBodyLevelDetailsButton" class="NVCCDialogBodyLink" href="javascript: showHideNVCCDialogDetail();" tabindex="1">'+cookieDialog['showDetails']+'</a>\
36        </div>\
37       </div>\
38      </div>\
39     </div>\
40    </div>\
41   </div>';
42
43  return html+getNVCCDialogDetail()+'</div>';
44}
45
46function getNVCCDialogDetailTable(key) {
47
48  var html='';
49  if(cookieInfo[key].count == 0){
50    html+='<tbody>\
51             <tr>\
52              <td class="NVCCDialogDetailBodyContentCookieTypeTableEmpty">'+cookieDialog['emptyTable']+'</td>\
53             </tr>\
54            </tbody>';
55  }else{
56    html+='<thead><tr><td>'+cookieDialog['cookieName']+'</td><td>'+cookieDialog['cookieProvider']+'</td><td>'+cookieDialog['cookiePurpose']+'</td><td>'+cookieDialog['cookieExpiry']+'</td><td>'+cookieDialog['cookieType']+'</td></tr></thead>\
57    <tbody>';
58
59    Object.keys(cookieInfo[key]['cookies']).forEach(function(keyC) {
60      var expire = cookieInfo[key]['cookies'][keyC]['expireDays'] == 0 ? cookieInfo[key]['cookies'][keyC]['expire'] : cookieInfo[key]['cookies'][keyC]['expireDays']+' '+cookieDialog['days'];
61      var description = cookieInfo[key]['cookies'][keyC]['description'] == '' ? cookieDialog['cookie'+capitalizeFirstLetter(key)+'Title'] : cookieInfo[key]['cookies'][keyC]['description'];
62      var providersCount = cookieInfo[key]['cookies'][keyC]['providers'].length == 1 ? '' : ' [x'+cookieInfo[
62key]['cookies'][keyC]['providers'].length+']';
63      var providers = '';
64      html+='<tr><td title="'+keyC+'">'+keyC+providersCount+'</td><td title="'+cookieInfo[key]['cookies'][keyC]['providers'].join("<br />")+'">'+cookieInfo[key]['cookies'][keyC]['providers'].join("<br />")+'</td><td title="'+description+'">'+description+'</td><td title="'+expire+'">'+expire+'</td><td title="'+cookieInfo[key]['cookies'][keyC]['trackerType']+'">'+cookieInfo[key]['cookies'][keyC]['trackerType']+'</td></tr>';
65    });
66    html+='</tbody>';
67  }
68  return html;
69}
70
71function getNVCCDialogDetailBodyContentTextOverview() {
72  var html='<div id="NVCCDialogDetailBodyContentTextOverview" style="display: block;">\
73       <div id="NVCCDialogDetailBodyContentCookieContainer">\
74        <div id="NVCCDialogDetailBodyContentCookieContainerTypes">';
75  var htmlDetails = '<div id="NVCCDialogDetailBodyContentCookieContainerTypeDetails">';
76  Object.keys(CookieConsentGetParse).forEach(function(key) {
77    var addStyle = key == 'necessary' ? ' style="border-top: 0px none;"' : '';
78    var elClass = key == 'necessary' ? ' NVCCDialogDetailBodyContentCookieContainerTypesSelected' : 'NVCCDialogDetailBodyContentCookieContainerTypes';
79
80    html+='<a id="NVCCDialogDetailBodyContentCookieContainer'+capitalizeFirstLetter(key)+'" href="javascript: NVCCShowCookieContainerDetailPane(\''+key+'\');" class="'+elClass+'"'+addStyle+'><label>&nbsp;</label>'+cookieDialog['cookie'+capitalizeFirstLetter(key)+'Title']+' ('+cookieInfo[
80key].count+')</a>'  
81
82    var tabDisplay = key == 'necessary' ? ' block' : 'none';
83
84
85
86    htmlDetails+='<div id="NVCCDialogDetailBodyContentCookieTabs'+capitalizeFirstLetter(key)+'" style="display: '+tabDisplay+';">\
87          <div class="NVCCDialogDetailBodyContentCookieTypeIntro">\
88          '+cookieDialog['cookie'+capitalizeFirstLetter(key)]+'</div>\
89          <div class="NVCCDialogDetailBodyContentCookieTypeTableContainer"> \
90           <table id="NVCCDialogDetailTable'+capitalizeFirstLetter(key)+'" class="NVCCDialogDetailBodyContentCookieTypeTable">\
91           '+getNVCCDialogDetailTable(key)+'</table> \
92          </div>\
93         </div>';
94  });
95  html+='</div>'; //NVCCDialogDetailBodyContentCookieContainerTypes
96
97  html+=htmlDetails+'</div>'
98
99  html+='</div>'; //NVCCDialogDetailBodyContentCookieContainer
100
101  html+='</div>'; //NVCCDialogDetailBodyContentTextOverview
102  return html;
103}
104
105function getNVCCDialogDetail() {
106  var html='   <div id="NVCCDialogDetail" style="display: none;">\
107    <div id="NVCCDialogDetailBody">\
108     <div id="NVCCDialogDetailBodyContentTabs">\
109      <a id="NVCCDialogDetailBodyContentTabsOverview" class="NVCCDialogDetailBodyContentTab NVCCDialogDetailBodyContentTabsItemSelected" href="javascript: NVCCShowDetailPane(\'overview\');"> '+cookieDialog['declaration']+' </a>\
110      <a id="NVCCDialogDetailBodyContentTabsAbout" class="NVCCDialogDetailBodyContentTab NVCCDialogDetailBodyContentTabsItem" href="javascript: NVCCShowDetailPane(\'about\');"> '+cookieDialog['information']+' </a>\
111     </div>\
112     <div id="NVCCDialogDetailBodyContent">';
113
114     //<div id="NVCCDialogDetailBodyContentTextOverview" style="display: none;">
115     html+= getNVCCDialogDetailBodyContentTextOverview();
116     //<div id="NVCCDialogDetailBodyContentTextAbout" style="display: none;">
117     html+='<div id="NVCCDialogDetailBodyContentTextAbout" style="display: none;">'+cookieDialog['cookieIntro'];
118
119     if(cookiePage > ''){
120      html+='<br /><br />'+cookieDialog['cookiePageStart']+' <a href="'+cookiePage+'">'+cookieDialog['cookiePageTitle']+'</a> '+cookieDialog['cookiePageEnd']+'.';
121     }
122
123     if(privacyPolicyPage > ''){
124      html+='<br /><br />'+cookieDialog['ppPageStart']+' <a href="'+privacyPolicyPage+'">'+cookieDialog['ppPageTitle']+'</a>'+cookieDialog['ppPageEnd']+'.';
125     }
126     
127     html+='</div>';
128    //end  NVCCDialogDetailBodyContent
129    html+='</div>\
130     <div id="NVCCDialogDetailFooter">\
131       by <a href="http://www.newtvision.com">NewtVision</a> ^_^ \
132     </div>\
133    </div>\
134  </div>';
135  return html;
136}
137
138function showHideNVCCDialogDetail(){
139  var el = document.getElementById("NVCCDialogDetail");
140  var e = document.getElementById("NVCCDialogBodyLevelDetailsButton");
141  if(el.style.display == "block"){
142    el.style.display = "none";
143    e.innerHTML = cookieDialog['showDetails'];
144  }else{
145    el.style.display = "block";
146    e.innerHTML = cookieDialog['hideDetails'];
147  }
148}
149
150
151function getNVCCDialogBodyLevelButtonsSelectPane() {
152  CookieConsentGetParse = CookieConsentGet == undefined ? CookieConsentPreference : JSON.parse(CookieConsentGet);
153  var html='<div id="NVCCDialogBodyLevelButtonsSelectPane">';
154  Object.keys(CookieConsentGetParse).forEach(function(key) {
155    var checked = CookieConsentGetParse[key] == true ? ' checked' : '';
156    var disabled = cookieInfo[key].count == 0 || key == 'necessary' ? ' disabled' : '';
157    var disabledClass = key == 'necessary' ? ' NVCCDialogBodyLevelButtonDisabled' : '';
157 //cookieInfo[key].count == 0 || ??TO ADD??
158    var disabledLabelClass = cookieInfo[key].count == 0 ? ' class="NVCCDialogBodyLevelButtonDisabledLabel"' : ''; 
159    var mandatory = key == 'necessary' ? cookieDialog['necessary']+' ' : '';
160
161    html+='<div class="NVCCDialogBodyLevelButtonWrapper" title="'+mandatory+cookieDialog['cookie'+capitalizeFirstLetter(key)]+'">\
162          <input id="NVCCDialogBodyLevelButton'+capitalizeFirstLetter(key)+'" class="NVCCDialogBodyLevelButton'+disabledClass+'" '+checked+disabled+' type="checkbox" onclick="updatePreference(this, \''+key+'\');">\
163          <label for="NVCCDialogBodyLevelButton'+capitalizeFirstLetter(key)+'"'+disabledLabelClass+' >'+cookieDialog['cookie'+capitalizeFirstLetter(key)+'Title']+'</label>\
164         </div>';
165  });
166  return html+='</div>';
167}
168
169function updatePreference(cb, key) {
170 CookieConsentPreference[key]=cb.checked;
171}
172
173function onNVSwalCloseAction(action) {
174  if(action == 'updateCookie'){
175    NVCCUpdateCookies();
176  }
177
178  if(action == 'initCookie'){
179    setNVCC(true);
180    NVCCUpdateCookies();
181  }
182  return true;
183}
184
185function onNVSliderCloseAction(action) {
186  var node = document.getElementById("NVCCDialog");
187  node.parentNode.removeChild(node);
188  if(action == 'updateCookie'){
189    NVCCUpdateCookies();
190  }
191
192  if(action == 'initCookie'){
193    setNVCC(true);
194    NVCCUpdateCookies();
195  }
196  //return false;
197}
198
199function onNVSwalOpenAction(action) {
200  if(action == 'removeCookie'){
201    removeNVCC();
202  }
203  return true;
204}
205
206function NVCCStopAndBlank() {
207  if (detectIE()) {document.execCommand("Stop");}//works in IE, 
208  else{window.stop(); } //works in all browsers but IE
209  document.body = document.createElement("body");
210}
211
212function checkCookieConsentConsistency(){
213  CookieConsentGetParse = JSON.parse(CookieConsentGet);
214  Object.keys(CookieConsentPreference).forEach(function(key) {
215    if(CookieConsentGetParse[key] == undefined){
216      removeNVCC();
217      if(detectChrome()){
218        document.addEventListener('DOMContentLoaded', function () {
219          NVCCStopAndBlank();
220          NVShowOpacity ();
221        });
222      }else{
223        NVCCStopAndBlank();
224        NVShowOpacity ();
225      }
226      location.reload();
227      return false;
228    }
229  });
230  return true;
231}
232
233function NVCCReinitCookies() {
234 Object.keys(CookieConsentPreference).forEach(function(key) {
235  if(key != 'necessary'){
236    CookieConsentPreference[key] = false;
237  }
238 });
239 NVCCUpdateCookies();
240}
241
242function NVCCUpdateCookies() {
243  var forceReload = false;
244  if(JSON.stringify(CookieConsentPreference) != CookieConsentGet){
245    setNVCC();
246    forceReload = true;
247  }
248
249  if(forceReload){
250    NVShowOpacity ();
251    location.reload();
252  }
253}
254
255function showNVSwalOnRequest() {
256  if(nvccLayout=='modal'){
257    backgroundImage = '';
258    showNVSwal(cookieDialog.header, getNVSwalHtml(), 'warning', true, false, 'updateCookie');
259  }else{
260    var NVCCDialog = document.getElementById("NVCCDialog");
261    if(NVCCDialog != null){
262      var node = document.getElementById("NVCCDialog");
263      node.parentNode.removeChild(node);
264    }
265    showNVSlider();
266  }
267}
268
269function showNVSlider(onCloseAction) {
270  if(onCloseAction == 'initCookie'){
271    onNVSliderAction = 'initCookie';
272  }
273  document.body.insertAdjacentHTML('beforeend', getNVSwalHtml());
274  document.getElementById("NVCCDialog").setAttribute("style", "display: block; padding-bottom: 18px; opacity: 1; bottom: 0; width: 100%; height: auto; position:fixed; box-shadow:#121212 2px 2px 14px 2px; margin-bottom: 15px;");
275  if(onCloseAction == 'initCookie'){
276    removeNVCC();
277  } 
278}
279
280function showNVSwal(title, html, type, showConfirmButton, showCloseButton, onCloseAction, onOpenAction){
281  title = title == undefined ? 'title' : title;
282  html = html == undefined ? 'html' : html;
283  type = type == undefined ? 'success' : type;
284  showConfirmButton = showConfirmButton == undefined ? false : showConfirmButton;
285  showCloseButton = showCloseButton == undefined ? true : showCloseButton;
286  onCloseAction = onCloseAction == undefined ? false : onCloseAction;
287  onOpenAction = onOpenAction == undefined ? false : onOpenAction;
288
289  var backdrop = backgroundImage > '' ? 'rgba(68, 68, 74, 0.5) url("'+backgroundImage+'")' : 'rgba(68, 68, 74, 0.7)';
290
291  var swalSettings = {
292        title: title,
293        html: html,
294        width: '50rem',
295        showCloseButton: showCloseButton,
296        showCancelButton: false,
297        showConfirmButton: showConfirmButton,
298        allowOutsideClick: false,
299        allowEscapeKey: false,
300        backdrop: backdrop,
301        confirmButtonClass: 'nvcc-swal2-confirm',
302        onClose:function(){
303          onNVSwalCloseAction(onCloseAction);
304        },
305        onOpen:function(){
306          onNVSwalOpenAction(onOpenAction);
307        }
308      };
309  if(alertLogo > ''){
310    swalSettings.imageUrl = alertLogo;
311    swalSettings.imageClass = 'NVCCimageClass';
312  }else{
313    swalSettings.type = type;
314  }
315
316  swal(swalSettings);
317}
318
319function refreshNVCC(){
320  CookieConsentGet = Cookies.get('CookieConsent', { domain: NVCChostname, path: '/' });
321}
322
323function removeNVCC(){
324  Cookies.remove('CookieConsent', { domain: NVCChostname });
325  refreshNVCC();
326}
327
328function setNVCC(defaultPreferences) {
329  defaultPreferences = defaultPreferences == undefined ? false : true;
330  Cookies.set('CookieConsent', (defaultPreferences ? CookieConsentDefault : CookieConsentPreference), { domain: NVCChostname, path: '/', expires: 365,  secure: false, persistent: true });
331  refreshNVCC();
332}
333
334function NVCCCleanPage() {
335  var nodes = document.querySelectorAll('*');
336  nodes = [].slice.call(nodes);
337  nodes.forEach(function(node) {
338     if(node.hasAttribute("data-nvcc")){
339      if(!CookieConsentPreference[node.getAttribute("data-nvcc")]){
340        //node.remove(); //remove nodes with preference false
341        node.parentNode.removeChild(node);
342      }
343     }
344  });
345}
346
347function NVCCCleanCookies(){
348  Object.keys(CookieConsentPreference).forEach(function(key) {
349    if(key != 'necessary' && cookieInfo[key].count > 0 && !CookieConsentPreference[key]){
350      Object.keys(cookieInfo[key]['cookies']).forEach(function(keyC) {
351        var providers = cookieInfo[key]['cookies'][keyC]['providers'];
352         for (var i = 0; i < providers.length; i++) {
353          var providerSplit = providers[i].split('.');
354          if(Cookies.get(keyC, { domain: providers[i] }) != undefined){
355            
356            Cookies.remove(keyC, { domain: providers[i]});
357          }
358         }
359      });
360    }
361  });
362}
363
364function NVCCExistCookies() {
365  var ret = false;
366
367  if(isAWhiteBot==1){
368    return ret;
369  }
370
371  Object.keys(CookieConsentPreference).forEach(function(key) {
372    if(cookieInfo[key].count > 0){
373      ret = true;
374    }
375  });
376  return ret;
377}
378
379/**
380 * detect IE
381 * returns version of IE or false, if browser is not Internet Explorer
382 */
383function detectIE() {
384  var ua = window.navigator.userAgent;
385
386  var msie = ua.indexOf('MSIE ');
387  if (msie > 0) {
388    // IE 10 or older => return version number
389    return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
390  }
391  var trident = ua.indexOf('Trident/');
392  if (trident > 0) {
393    // IE 11 => return version number
394    var rv = ua.indexOf('rv:');
395    return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
396  }
397  var edge = ua.indexOf('Edge/');
398  if (edge > 0) {
399    // Edge (IE 12+) => return version number
400    return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
401  }
402  // other browser
403  return false;
404}
405
406function detectChrome() {
407  // please note, 
408  // that IE11 now returns undefined again for window.chrome
409  // and new Opera 30 outputs true for window.chrome
410  // and new IE Edge outputs to true now for window.chrome
411  // and if not iOS Chrome check
412  // so use the below updated condition
413  var isChromium = window.chrome;
414  var winNav = window.navigator;
415  var vendorName = winNav.vendor;
416  var isOpera = typeof window.opr !== "undefined";
417  var isIEedge = winNav.userAgent.indexOf("Edge") > -1;
418  var isIOSChrome = winNav.userAgent.match("CriOS");
419
420  if(isIOSChrome){
421    return true;
422  } else if (
423    isChromium !== null &&
424    typeof isChromium !== "undefined" &&
425    vendorName === "Google Inc." &&
426    isOpera === false &&
427    isIEedge === false
428  ) {
429    return true
430  } 
431
432  return false;
433}
434
435function capitalizeFirstLetter(string) {
436    return string.charAt(0).toUpperCase() + string.slice(1);
437}
438
439function NVCCShowDetailPane(e) {
440    for (var t = ["NVCCDialogDetailBodyContentTextAbout", "NVCCDialogDetailBodyContentTextOverview"], o = 0; o < t.length; o++) {
441        document.getElementById(t[o]).style.display = "none"
442    }
443    var i = ["NVCCDialogDetailBodyContentTabsAbout", "NVCCDialogDetailBodyContentTabsOverview"];
444    for (o = 0; o < i.length; o++) {
445        document.getElementById(i[o]).className = "NVCCDialogDetailBodyContentTab NVCCDialogDetailBodyContentTabsItem"
446    }
447    switch (e.toLowerCase()) {
448        case "overview":
449            var n = document.getElementById("NVCCDialogDetailBodyContentTabsOverview"),
450                s = document.getElementById("NVCCDialogDetailBodyContentTextOverview");
451            break;
452        default:
453            n = document.getElementById("NVCCDialogDetailBodyContentTabsAbout"), s = document.getElementById("NVCCDialogDetailBodyContentTextAbout")
454    }
455    n.className = "NVCCDialogDetailBodyContentTab NVCCDialogDetailBodyContentTabsItemSelected", s.style.display = "block"
456}
457
458function NVCCShowCookieContainerDetailPane(e) {
459    for (var t = ["NVCCDialogDetailBodyContentCookieTabsNecessary", "NVCCDialogDetailBodyContentCookieTabsPreferences", "NVCCDialogDetailBodyContentCookieTabsStatistics", "NVCCDialogDetailBodyContentCookieTabsMarketing", "NVCCDialogDetailBodyContentCookieTabsUnclassified"], o = 0; o < t.length; o++) {
460        document.getElementById(t[o]).style.display = "none"
461    }
462    var i = ["NVCCDialogDetailBodyContentCookieContainerNecessary", "NVCCDialogDetailBodyContentCookieContainerPreferences", "NVCCDialogDetailBodyContentCookieContainerStatistics", "NVCCDialogDetailBodyContentCookieContainerMarketing", "NVCCDialogDetailBodyContentCookieContainerUnclassified"];
463    for (o = 0; o < i.length; o++) {
464        document.getElementById(i[o]).className = "NVCCDialogDetailBodyContentCookieContainerTypes"
465    }
466    switch (e.toLowerCase()) {
467        case "preferences":
468            var n = document.getElementById("NVCCDialogDetailBodyContentCookieContainerPreferences"),
469                s = document.getElementById("NVCCDialogDetailBodyContentCookieTabsPreferences");
470            break;
471        case "statistics":
472            n = document.getElementById("NVCCDialogDetailBodyContentCookieContainerStatistics"), s = document.getElementById("NVCCDialogDetailBodyContentCookieTabsStatistics");
473            break;
474        case "marketing":
475            n = document.getElementById("NVCCDialogDetailBodyContentCookieContainerMarketing"), s = document.getElementById("NVCCDialogDetailBodyContentCookieTabsMarketing");
476            break;
477        case "unclassified":
478            n = document.getElementById("NVCCDialogDetailBodyContentCookieContainerUnclassified"), s = document.getElementById("NVCCDialogDetailBodyContentCookieTabsUnclassified");
479            break;
480        default:
481            n = document.getElementById("NVCCDialogDetailBodyContentCookieContainerNecessary"), s = document.getElementById("NVCCDialogDetailBodyContentCookieTabsNecessary")
482    }
483    n.className = "NVCCDialogDetailBodyContentCookieContainerTypesSelected", s.scrollIntoView(!0), s.style.display = "block"
484}
485
486function NVCCGetHostname(hostname){
487    return NVCChostnameConst ? NVCChostnameConst : hostname.split('.').length > 2 ? hostname.split('.').slice(-2).join('.') : hostname;
488}
489
490function initNVCCInt() {
491  if(nvccLayout=='modal'){
492    //if (detectIE()) {document.execCommand("Stop");}//works in IE, 
493    //else{window.stop(); } //works in all browsers but IE
494    //document.body = document.createElement("body");
495    backgroundImage = '';
496    showNVSwal(cookieDialog.header, getNVSwalHtml(), 'warning', true, false, 'initCookie', 'removeCookie');
497  }else{
498    //setNVCC();
499    //backgroundImage = '';
500    //showNVSwal(cookieDialog.header, getNVSwalHtml(), 'warning', true, false, 'initCookie', 'removeCookie');
501    //var NVSwalHtml = getNVSwalHtml();
502    showNVSlider('initCookie');
503  }
504  
505}
506
507function initNVCC() {
508  if(CookieConsentGet == undefined){
509    //if(detectChrome()){
510      //window.addEventListener("load", function(event) {
511      document.addEventListener('DOMContentLoaded', function () {
512        setNVCC(true);
513        initNVCCInt();
514        NVCCCleanPage();
515        setInterval(function(){ NVCCCleanCookies(); }, 5000);
516      });
517    //}else{
518      //initNVCCInt();
519    //}
520  }else{
521    if(checkCookieConsentConsistency()){
522      CookieConsentPreference = JSON.parse(CookieConsentGet);
523      document.addEventListener('DOMContentLoaded', function () {
524        NVCCCleanPage();
525        setInterval(function(){ NVCCCleanCookies(); }, 5000);
526      });
527    }
528  }
529}
530
531function getNVCCStatus() {
532  CookieConsentGetParse = CookieConsentGet == undefined ? CookieConsentPreference : JSON.parse(CookieConsentGet);
533  var html='<div id="NVCCDeclarationUserStatusPanel">\
534    <div id="NVCCDeclarationUserStatusLabel">';
535  var onlyNecessary = true;
536  var allCookies = true;
537  var cookiesHtml = cookieDialog['cookieNecessaryTitle'];
538  Object.keys(CookieConsentGetParse).forEach(function(key) {
539    if(key != 'necessary' && CookieConsentGetParse[key] == true){
540      onlyNecessary = false;
541      cookiesHtml += ', '+cookieDialog['cookie'+capitalizeFirstLetter(key)+'Title'];
542    }
543    if(key != 'necessary' && CookieConsentGetParse[key] == false){
544      allCookies = false;
545    }
546
547  });
548
549  var removeHtml = !onlyNecessary ? '<span id="NVCCDeclarationUserStatusLabelWithdraw" style="display: inline-block;">&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:NVCCReinitCookies();">'+cookieDialog['removeConsent']+'</a></span>' : '';
550  html+=cookieDialog['state']+': ';
551  if(onlyNecessary){
552    html+=cookieDialog['declinebutton']+'.'
553  }else if(allCookies){
554    html+=cookieDialog['acceptbutton']+'.'
555  }else{
556    html+=cookieDialog['acceptbutton']+' ('+cookiesHtml+').'
557
558  }
559
560  html+='</div>'; //NVCCDeclarationUserStatusLabel
561
562  html+='<div style="display: block"><a href="javascript:showNVSwalOnRequest();">'+cookieDialog['changeConsent']+'</a>'+removeHtml+'</div>';
563
564  return html+='</div>'; //NVCCDeclarationUserStatusPanel
565}
566
567function getNVCCDeclarationTable(key) {
568
569  var html='';
570  if(cookieInfo[key].count == 0){
571    html+='<tbody>\
572             <tr>\
573              <td class="NVCCDialogDetailBodyContentCookieTypeTableEmpty">'+cookieDialog['emptyTable']+'</td>\
574             </tr>\
575            </tbody>';
576  }else{
577    html+='<colgroup><col style="width: 20%"><col style="width: 20%"><col style="width: 35%"><col style="width: 15%"><col style="width: 10%"></colgroup>\
578    <thead><tr><th scope="col" class="NVCCDeclarationTableHeader" dir="ltr">'+cookieDialog['cookieName']+'</th><th scope="col" class="NVCCDeclarationTableHeader" dir="ltr">'+cookieDialog['cookieProvider']+'</th><th scope="col" class="NVCCDeclarationTableHeader" dir="ltr">'+cookieDialog['cookiePurpose']+'</th><th scope="col" class="NVCCDeclarationTableHeader" dir="ltr">'+cookieDialog['cookieExpiry']+'</th><th scope="col" class="NVCCDeclarationTableHeader" dir="ltr">'+cookieDialog['cookieType']+'</th></tr></thead>\
579    <tbody>';
580
581    Object.keys(cookieInfo[key]['cookies']).forEach(function(keyC) {
582      var expire = cookieInfo[key]['cookies'][keyC]['expireDays'] == 0 ? cookieInfo[key]['cookies'][keyC]['expire'] : cookieInfo[key]['cookies'][keyC]['expireDays']+' '+cookieDialog['days'];
583      var description = cookieInfo[key]['cookies'][keyC]['description'] == '' ? cookieDialog['cookie'+capitalizeFirstLetter(key)+'Title'] : cookieInfo[key]['cookies'][keyC]['description'];
584      var providersCount = cookieInfo[key]['cookies'][keyC]['providers'].length == 1 ? '' : ' [x'+cookieInfo[
584key]['cookies'][keyC]['providers'].length+']';
585      var providers = '';
586      html+='<tr><td class="NVCCDeclarationTableCell" title="'+keyC+'">'+keyC+providersCount+'</td><td class="NVCCDeclarationTableCell" title="'+cookieInfo[key]['cookies'][keyC]['providers'].join("<br />")+'">'+cookieInfo[key]['cookies'][keyC]['providers'].join("<br />")+'</td><td class="NVCCDeclarationTableCell" title="'+description+'">'+description+'</td><td class="NVCCDeclarationTableCell" title="'+expire+'">'+expire+'</td><td class="NVCCDeclarationTableCell" title="'+cookieInfo[key]['cookies'][keyC]['trackerType']+'">'+cookieInfo[key]['cookies'][keyC]['trackerType']+'</td></tr>';
587    });
588    html+='</tbody>';
589  }
590  return html;
591}
592
593function initNVCCDeclaration() {
594  var NVCCDeclaration = document.getElementById("NVCCDeclaration");
595  if(NVCCDeclaration == null){
596    return false;
597  }
598  var html='<p class="NVCCDeclarationDialogText">'+cookieDialog['header']+'. '+cookieDialog['body']+'</p>';
599  html+='<p class="NVCCDeclarationIntro">'+cookieDialog['cookieIntro'];
600  if(cookiePage > ''){
601    html+='<br /><br />'+cookieDialog['cookiePageStart']+' <a href="'+cookiePage+'">'+cookieDialog['cookiePageTitle']+'</a> '+cookieDialog['cookiePageEnd']+'.';
602  }
603
604  if(privacyPolicyPage > ''){
605    html+='<br /><br />'+cookieDialog['ppPageStart']+' <a href="'+privacyPolicyPage+'">'+cookieDialog['ppPageTitle']+'</a>'+cookieDialog['ppPageEnd']+'.';
606  }
607  html+='</p>'+getNVCCStatus();
608
609  html+='<div class="NVCCDeclarationType" dir="ltr">';
610  Object.keys(CookieConsentGetParse).forEach(function(key) {
611    html+='<p class="NVCCDeclarationTypeHeader">'+cookieDialog['cookie'+capitalizeFirstLetter(key)+'Title']+' ('+cookieInfo[
611key].count+')</p><p class="NVCCDeclarationTypeDescription">'+cookieDialog['cookie'+capitalizeFirstLetter(key)]+'</p>\
612    <table class="NVCCDeclarationTable">\
613           '+getNVCCDeclarationTable(key)+'</table>';
614  });
615
616  NVCCDeclaration.innerHTML =html+'</div>';
617  return true;
618}

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.