PageSourceSearch

https://www.ndsatcom.com/script/project/cookie/cookieconsent.js

js ndsatcom.com collected 2026-10-02 10:29:46 UTC 61,912 bytes, 1,445 lines download raw bytes

1var cc =
2{
3    version: '1.0.10',
4    jqueryversionrequired: '1.4.4',
5    initobj: true,
6    ismobile: false,
7    setupcomplete: false,
8    allasked: false,
9    checkedlocal: false,
10    checkedremote: false,
11    remoteresponse: false,
12    frommodal: false,
13    hassetupmobile: false,
14    sessionkey: false,
15    noclosewin: false,
16    closingmodal: false,
17    jqueryattempts: 0,
18    reloadkey: false,
19    forcereload: false,
20    allagree: false,
21    checkedipdb: false,
22    cookies: {},
23    uniqelemid: 0,
24    executionblock: 0,
25    defaultCookies: { social: {}, analytics: {}, advertising: {}},
26    remoteCookies: {},
27    approved: {},
28    bindfunctions: {},
29    checkeddonottrack: false,
30    eumemberstates: [
31        "BE",
32        "BG",
33        "CZ",
34        "DK",
35        "DE",
36        "EE",
37        "IE",
38        "EL",
39        "ES",
40        "FR",
41        "IT",
42        "CY",
43        "LV",
44        "LT",
45        "LU",
46        "HU",
47        "MT",
48        "NL",
49        "AT",
50        "PL",
51        "PT",
52        "RO",
53        "SI",
54        "SK",
55        "FI",
56        "SE",
57        "UK"
58    ],
59    settings: {
60        refreshOnConsent: false,
61        style: "dark",
62        bannerPosition: "bottom",
63        clickAnyLinkToConsent: true,
64        privacyPolicy: false,
65        collectStatistics: false,
66        tagPosition: 'bottom-right',
67        useSSL: false,
68        serveraddr: '/script/jquery/jquery-1.12.4.min.js',
69        clearprefs: false,
70        consenttype: 'explicit',
71        onlyshowbanneronce: false,
72        hideallsitesbutton: true,
73        disableallsites: true,
74        hideprivacysettingstab: false,
75        scriptdelay: 3000,
76        testmode: false,
77        overridewarnings: false,
78        onlyshowwithineu: false,
79        ipinfodbkey: false,
80        ignoreDoNotTrack: false
81    },
82
83    strings: {
84        jqueryWarning: "Developer: Caution! In order to use Cookie Consent, you need to use jQuery 1.4.4 or higher.",
85        noJsBlocksWarning: "Developer: Warning! It doesn't look like you have set up Cookie Consent correctly.  (see docs for more information).",
86        noKeyWarning: "Developer: Warning! You have set the plugin to only show within the EU, but you have not provided an API key for the IP Info DB.", 
87        invalidKeyWarning: "Developer: Warning! You must provide a valid API key for IP Info DB.",
88        necessaryDefaultTitle: "Functional cookies",
89        socialDefaultTitle: "Social media",
90        analyticsDefaultTitle: "Analytics",
91        advertisingDefaultTitle: "Marketing",
92        defaultTitle: "Default cookie title",
93        necessaryDefaultDescription: "Funktionelle Cookies können nicht deaktiviert werden.",
94        socialDefaultDescription: "Facebook, Twitter und andere Netzwerke möchten wissen wo Sie sich befinden um Webung zu schalten.",
95        analyticsDefaultDescription: "Wir nutzen Analytics um die Nutzererfahrung auf unserer Seite zu verbessern.",
96        advertisingDefaultDescription: "Für Werbe und Remarketing werden Daten gesammelt.",
97        defaultDescription: "Default cookie description.",
98        notificationTitle: "Diese Webseite nutzt Cookies um Ihnen eine bestmögliche Funktionalität bieten zu können.",
99        notificationTitleImplicit: "Diese Webseite nutzt Cookies um Ihnen eine bestmögliche Funktionalität bieten zu können.",
100        privacyPolicy: "Datenschutzeinstellungen",
101        learnMore: "Mehr erfahren",
102        seeDetails: "Weitere Details.",
103        seeDetailsImplicit: "Jetzt Einstellungen anpassen.",
104        hideDetails: "Details verbergen",
105        savePreference: 'Speichern',
106        saveForAllSites: 'Für alle Seiten speichern',
107        allowCookies: 'Zustimmen',
108        allowCookiesImplicit: 'Alle Akzeptieren',
109        allowForAllSites: 'Für alle Seiten erlauben',
110        customCookie: 'Diese Webseite nutzt verschiedenartige Cookies',
111        privacySettings: "Datenschutzeinstellungen",
112        privacySettingsDialogTitleA: "Datenschutzeinstellungen",
113        privacySettingsDialogTitleB: "für diese Webseite",
114        privacySettingsDialogSubtitle: "Manche Funktionen dieser Webseite benötigt die Informationen wo Sie waren.",
115        closeWindow: "Fenster Schließen",
116        changeForAllSitesLink: "Einstellungen für alle Webseiten",
117        privacyPolicyText:  "Datenschutzerklärung",
118        privacyPolicyLink: "#",
119        imprintLink: "#",
120        preferenceUseGlobal: 'Globale Einstellungen',
121        preferenceConsent: "Alle Akzeptieren",
122        preferenceDecline: "Nur notwendige",
123        preferenceAsk: 'Frag jedesmal',
124        preferenceAlways: "Immer erlauben",
125        preferenceNever: "Nie erlauben",
126        notUsingCookies: "Diese Webseite benötigt nicht jeden Cookie.",
127        clearedCookies: "Cookies wurden gelöscht aktuallisieren Sie die Seite.",
128        allSitesSettingsDialogTitleA: "Datenschutzeinstellungen",
129        allSitesSettingsDialogTitleB: "für alle Webseiten",
130        allSitesSettingsDialogSubtitle: "Benutze die Einstellungen für alle Seiten die dieses Plugin nutzen.",
131        backToSiteSettings: "Webseiteneinstellungen zurückkehren"
132    },
133
134    onconsent: function (cookieType, input) {
135        if (cc.isfunction(input)) {
136            fn = input;
137        }
138        else {
139            scriptname = input;
140            fn = function () {
141                cc.insertscript(scriptname);
142            };
143        }
144        if (cc.cookies && cc.cookies[cookieType] && cc.cookies[cookieType].approved) {
145            cc.cookies[cookieType].executed = true;
146            fn();
147        } else {
148            if (window.jQuery) {
149                jQuery(document).bind("cc_" + cookieType, fn);
150            } else {
151                if (cc.bindfunctions[cookieType]) {
152                    cc.bindfunctions[cookieType][cc.bindfunctions[cookieType].length] = fn;
153                } else {
154                    cc.bindfunctions[cookieType] = new Array(fn);
155                }
156            }
157        }
158    },
159
160    geturlparameter: function (name) {
161        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
162        var regexS = "[\\?&]" + name + "=([^&#]*)";
163        var regex = new RegExp(regexS);
164        var results = regex.exec(window.location.search);
165        if (results == null)
166            return false;
167        else
168            return decodeURIComponent(results[1].replace(/\+/g, " "));
169    },
170
171    isfunction: function (functionToCheck) {
172        var getType = {};
173        return functionToCheck && getType.toString.call(functionToCheck) == '[object Function]';
174    },
175
176    setup: function () {
177        jQuery.each(cc.bindfunctions, function (key, value) {
178            for (i = 0; i < value.length; i++) {
179                jQuery(document).bind("cc_" + key, value[i]);
180            }
181        });
182        verstr = jQuery().jquery;
183        parts = verstr.split('.');
184        versionRequired = cc.jqueryversionrequired.split('.');
185        jqueryOk = true;
186        for (i = 0; i < parts.length && i < versionRequired.length; i++) {
187            currentpart = parseInt(parts[i]);
188            requiredpart = parseInt(versionRequired[i]);
189            if (currentpart < requiredpart) {
190                /* Unsatisfied - this part of the version string is less than the version we require */
191                jqueryok = false;
192                break;
193            }
194            if (currentpart > requiredpart) {
195                /* Satisfied - this part of the version string is greater than the version we require */
196                break;
197            }
198            /* This version is the same as the one we require.  Check the next part of the version number. */
199        }
200        if (!jqueryOk) {
201            alert(cc.strings.jqueryWarning);
202        } 
203        jQuery.each(cc.defaultCookies, function (key, value) {
204            if (key == "necessary") {
205                cc.defaultCookies[key].title = cc.strings.necessaryDefaultTitle;
206                cc.defaultCookies[key].description = cc.strings.necessaryDefaultDescription;
207            }
208            else if (key == "social") {
209                cc.defaultCookies[key].title = cc.strings.socialDefaultTitle;
210                cc.defaultCookies[key].description = cc.strings.socialDefaultDescription;
211            }
212            else if (key == "analytics") {
213                cc.defaultCookies[key].title = cc.strings.analyticsDefaultTitle;
214                cc.defaultCookies[key].description = cc.strings.analyticsDefaultDescription;
215            }
216            else if (key == "advertising") {
217                cc.defaultCookies[key].title = cc.strings.advertisingDefaultTitle;
218                cc.defaultCookies[key].description = cc.strings.advertisingDefaultDescription;
219            }
220        });
221
222        if (typeof(cc.initobj.cookies) != 'undefined') {
223	        jQuery.each(cc.initobj.cookies, function (key, value) {
224	        	
225	            if (!value.title) {
226	                if (key == "necessary") {
227	                    cc.initobj.cookies[key].title = cc.strings.necessaryDefaultTitle;
228	                }
229	                else if (key == "social") {
230	                    cc.initobj.cookies[key].title = cc.strings.socialDefaultTitle;
231	                }
232	                else if (key == "analytics") {
233	                    cc.initobj.cookies[key].title = cc.strings.analyticsDefaultTitle;
234	                }
235	                else if (key == "advertising") {
236	                    cc.initobj.cookies[key].title = cc.strings.advertisingDefaultTitle;
237	                } else {
238	                    cc.initobj.cookies[key].title = cc.strings.defaultTitle;
239	                }
240	            }
241	            if (!value.description) {
242	                if (key == "necessary") {
243	                    cc.initobj.cookies[key].description = cc.strings.necessaryDefaultDescription;
244	                }
245	                else if (key == "social") {
246	                    cc.initobj.cookies[key].description = cc.strings.socialDefaultDescription;
247	                }
248	                else if (key == "analytics") {
249	                    cc.initobj.cookies[key].description = cc.strings.analyticsDefaultDescription;
250	                }
251	                else if (key == "advertising") {
252	                    cc.initobj.cookies[key].description = cc.strings.advertisingDefaultDescription;
253	                } else {
254	                    cc.initobj.cookies[key].description = cc.strings.defaultDescription;
255	                }
256	            }
257	
258	            if (!value.defaultstate) {
259	                cc.initobj.cookies[key].defaultstate = "on";
260	            }
261	
262	            cc.initobj.cookies[key].asked = false;
263	            cc.initobj.cookies[key].approved = false;
264	            cc.initobj.cookies[key].executed = false;
265	        });
266        }    
267        if (cc.settings.onlyshowwithineu && !cc.settings.ipinfodbkey) {
268            alert(cc.strings.noKeyWarning);
269        }
270        testmode = cc.geturlparameter('cctestmode');
271        if (testmode == 'accept' || testmode == 'decline') {
272            cc.settings.testmode = testmode;
273        }
274        if (cc.settings.disableallsites) {
275            cc.settings.hideallsitesbutton = true;
276        }
277
278        for (var attrname in cc.initobj.cookies) {
279            cc.cookies[attrname] = cc.initobj.cookies[attrname];
280            if (cc.settings.testmode == "accept") {
281                cc.approved[attrname] = "yes";
282            }
283            if (cc.settings.testmode == "decline") {
284                cc.approved[attrname] = "no";
285            }
286        }
287        
288        // read cookies
289        cc.checklocal();
290
291    },
292
293    initialise: function (obj) {
294        cc.initobj = obj;
295        if (obj.settings !== undefined) {
296            for (var attrname in obj.settings) {
297                this.settings[attrname] = obj.settings[attrname];
298            }
299        }
300        if (obj.strings !== undefined) {
301            for (var attrname in obj.strings) {
302                this.strings[attrname] = obj.strings[attrname];
303            }
304        }
305        cc.settings.style = "cc-" + cc.settings.style;
306        cc.settings.bannerPosition = "cc-" + cc.settings.bannerPosition;
307        if (cc.settings.useSSL) {
308            cc.settings.serveraddr = 'https://www.physio-ippensen.de';
309        }
310        if (window.jQuery) {
311            cc.setupcomplete = true;
312            cc.setup();
313        }
314    },
315
316    calculatestatsparams: function () {
317        params = "c=";
318        first = true;
319        jQuery.each(cc.initobj.cookies, function (key, value) {
320            if (first) {
321                first = false;
322            } else {
323                params += ";";
324            }
325            params += encodeURIComponent(key) + ":";
326
327            if (cc.approved[key]) {
328                params += cc.approved[key];
329            } else {
330                params += "none";
331            }
332            if (value.statsid) {
333                params += ":" + value.statsid;
334            }
335        });
336        if (cc.ismobile) {
337            params += "&m=1";
338        } else {
339            params += "&m=0";
340        }
341        params += "&u=" + encodeURIComponent(document.URL);
342        return params;
343    },
344
345    setsessionkey: function (data) {
346        cc.sessionkey = data;
347    },
348
349
350    fetchprefs: function () {
351        cc.remoteresponse = false;
352        params = "?s=1";
353        if (cc.settings.collectStatistics) {
354            params = "?s=1&" + cc.calculatestatsparams();
355        }
356        if (cc.settings.clearprefs) {
357            params += "&v=1";
358            cc.settings.clearprefs = false;
359        }
360        cc.insertscript(cc.settings.serveraddr + params);
361        setTimeout(function () {
362            if (!cc.remoteresponse) {
363                cc.checkapproval();
364            }
365        }, 3000);
366        this.checkedremote = true;
367    },
368
369    responseids: function (data) {
370        jQuery.each(data, function (key, value) {
371            cc.cookies[key].statsid = value;
372        });
373    },
374
375    insertscript: function (script) {
376        var newfile = document.createElement('script');
377        newfile.setAttribute("type", "text/javascript");
378        newfile.setAttribute("src", script);
379        document.getElementsByTagName("head")[0].appendChild(newfile);
380    },
381
382    insertscripttag: function (content) {
383        var newfile = document.createElement('script');
384        newfile.setAttribute("type", "text/javascript");
385        newfile.innerHTML = content;
386        document.getElementsByTagName("head")[0].appendChild(newfile);
387    },
388
389    checklocal: function () {
390        this.checkedlocal = true;
391        jQuery.each(cc.cookies, function (key, value) {
392            cookieval = cc.getcookie('cc_' + key);
393            if (cookieval) {
394                cc.approved[key] = cookieval;
395            }
396        });
397        this.checkapproval();
398    },
399
400    response: function (data) {
401        cc.remoteresponse = true
402        jQuery.each(data, function (key, value) {
403            if (cc.cookies[key] && (!cc.approved[key] || (cc.approved[key] && (cc.approved[key] == "always" || cc.approved[key] == "never")))) {
404                if (key == 'necessary') value='yes';
405                cc.setcookie('cc_' + key, value, (assignedNo ? 14:365));
406            }
407        });
408
409        for (var attrname in data) {
410            cc.remoteCookies[attrname] = data[attrname];
411            if (this.approved[attrname] != "yes" && this.approved[attrname] != "no") {
412                this.approved[attrname] = data[attrname];
413            }
414        }
415        jQuery.each(cc.cookies, function (key, value) {
416            if (!data[key] && (cc.approved[key] == "always" || cc.approved[key] == "never")) {
417                cc.cookies[key].approved = false;
418                cc.deletecookie(key);
419                delete cc.approved[key];
420            }
421        });
422
423        this.checkapproval();
424    },
425
426    deletecookie: function (key) {
427        date = new Date();
428        date.setDate(date.getDate() - 1);
429        document.cookie = escape("cc_" + key) + '=; path=/; expires=' + date;
430    },
431
432    reloadifnecessary: function () {
433        if (cc.settings.refreshOnConsent || cc.ismobile || cc.forcereload) {
434            setTimeout("location.reload(true);", 50);
435        }
436    },
437
438    onkeyup: function (e) {
439        if (e.keyCode == 27) {
440            cc.closemodals();
441        }
442    },
443
444    closemodals: function () {
445        if (!cc.closingmodal) {
446            if (cc.noclosewin) {
447                cc.noclosewin = false;
448            } else {
449                if (jQuery('#cc-modal').is(":visible")) {
450                    jQuery('#cc-modal .cc-modal-closebutton a').click();
451                }
452                if (jQuery('#cc-settingsmodal').is(":visible")) {
453                    jQuery('#cc-settingsmodal #cc-settingsmodal-closebutton a').click();
454                }
455            }
456        }
457    },
458
459    showbanner: function () {
460      
461        jQuery('#cc-tag').fadeOut(null, function () {
462            jQuery(this).remove();
463        });
464        jQuery('#cc-notification').remove();
465        if (cc.ismobile) {
466            cc.setupformobile();
467            // jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">');
468            // jQuery('body').html('').css("margin", 0);
469        }
470        data = '';
471        if (jQuery('#cc-modal-overlay').length == 0) data = '<div id="cc-modal-overlay"></div>';
472        data += '<div id="cc-notification">' +
473          '<div id="cc-notification-wrapper">' +
474            '<div class="cc-info clearfix">'+
475              '<h2>' + cc.strings.notificationTitle + '</h2>'+
476              '<p class="cc-notification-body">' + cc.strings.notificationTitleImplicit + '</p>' +
477              '<div id="cc-notification-permissions">' +
478                '<div id="cc-legal">' +
479                    '<a id="cc-notification-logo" class="cc-link cc-logo" target="_blank" href="' + cc.strings.privacyPolicyLink + '" title="' + cc.strings.privacyPolicyText + '"><span>' + cc.strings.privacyPolicyText + '</span></a> ' +
480                    '<a id="cc-notification-logo" class="cc-link cc-logo" target="_blank" href="' + cc.strings.imprintLink + '" title="' + cc.strings.imprintText + '"><span>' + cc.strings.imprintText + '</span></a> ' +
481                '</div>' +
482              '</div>' +
483            '</div>'+  
484            '<ul class="cc-notification-buttons">' +
485              '<li>' +
486                '<a class="cc-link" href="#" id="cc-approve-button-allsites">' + cc.strings.allowForAllSites + '</a>' +
487              '</li>' +
488              '<li>' +
489                '<a class="cc-link" href="#" id="cc-disapprove-button-thissite">' + cc.strings.preferenceDecline + '</a>' +
490              '</li>' +
491              '<li>' +
492               '<a class="cc-link" href="#" id="cc-approve-button-thissite">' + cc.strings.allowCookies + '</a>' +
493              '</li>' +
494            '</ul>' +
495            '<div class="cc-clear"></div>' +
496           '</div>' +
497         '</div>';
498
499        jQuery('body').prepend(data);
500        jQuery('#cc-modal-overlay').show();
501        jQuery('#cc-modal-overlay').css('display','block');
502        if (cc.settings.hideallsitesbutton) {
503            jQuery('#cc-approve-button-allsites').hide();
504        }
505        if (cc.settings.consenttype == 'implicit') {
506            jQuery('#cc-notification h2').html(cc.strings.notificationTitle);
507            jQuery('#cc-notification p.cc-notification-body').html(cc.strings.notificationTitleImplicit);
508            jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit);
509            jQuery('#cc-approve-button-thissite').parent().after(jQuery('#cc-approve-button-allsites').parent());
510            jQuery('#cc-approve-button-allsites').hide();
511        }
512        jQuery('#cc-notification-logo').hide();
513        if (cc.settings.privacyPolicy) {
514            jQuery('#cc-notification-moreinformation').prepend('<a href="' + cc.settings.privacyPolicy + '">' + cc.strings.privacyPolicy + '</a> | ');
515        }
516        jQuery('#cc-notification').addClass(cc.settings.style).addClass(cc.settings.bannerPosition);
517        bannerh = jQuery('#cc-notification').height();
518        jQuery('#cc-notification').hide();
519        if (cc.ismobile) {
520            jQuery('#cc-notification').addClass("cc-mobile");
521        }
522        jQuery('#cc-notification-permissions').prepend('<ul></ul>');
523        allcustom = true;
524        jQuery.each(cc.cookies, function (key, value) {
525            if (!value.asked) {
526                jQuery('#cc-notification-permissions ul').append('<li><input type="checkbox" checked="checked" id="cc-checkbox-' + key + '" /> <label id="cc-label-' + key + '" for="cc-checkbox-' + key + '"><strong>' + value.title + '</strong> ' + value.description + '</label></li>');
527                if (value.link) {
528                    jQuery('#cc-label-' + key).append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>');
529                }
530                if (key == "social" || key == "analytics" || key == "advertising") {
531                    allcustom = false;
532                }
533                jQuery('#cc-checkbox-' + key).change(function () {
534                    if (jQuery(this).is(':checked')) {
535                        jQuery(this).parent().removeClass('cc-notification-permissions-inactive');
536                    } else {
537                        jQuery(this).parent().addClass('cc-notification-permissions-inactive');
538
539                    }
540                });
541                if (value.defaultstate == "off") {
542                    jQuery('#cc-checkbox-' + key).removeAttr("checked").parent().addClass('cc-notification-permissions-inactive');
543                }
544                if (key == "necessary") {
545                    jQuery('#cc-checkbox-' + key).prop("checked", true);
546                    jQuery('#cc-checkbox-' + key).val("yes");
547                    jQuery('#cc-checkbox-' + key).prop("disabled", true);
548                }
549            }
550        });
551        jQuery('#cc-notification-wrapper p.cc-notification-body').append(' - <a class="cc-link" href="#" id="cc-notification-moreinfo">' + cc.strings.seeDetails + '</a>');
552        if (cc.settings.consenttype == "implicit") {
553            jQuery('#cc-notification-moreinfo').html(cc.strings.seeDetailsImplicit);
554        }
555        jQuery('#cc-notification-moreinfo').click(function () {
556
557            //Hide ablehnen button  uncheck buttons or check
558            /*
559            if(jQuery("#cc-disapprove-button-thissite").is(":visible")){
560              jQuery("#cc-disapprove-button-thissite").hide();
561              jQuery('#cc-checkbox-social').prop('checked', false);
562              jQuery('#cc-checkbox-analytics').prop('checked', false);
563              jQuery('#cc-checkbox-advertising').prop('checked', false);
564            } else{ 
565              jQuery("#cc-disapprove-button-thissite").show();
566              jQuery('#cc-checkbox-social').prop('checked', true); 
567              jQuery('#cc-checkbox-analytics').prop('checked', true); 
568              jQuery('#cc-checkbox-advertising').prop('checked', true);
569            }
570            */
571 
572            if (jQuery(this).html() == cc.strings.seeDetails || jQuery(this).html() == cc.strings.seeDetailsImplicit) {
573                if (cc.settings.consenttype == 'implicit') {
574                    if (!cc.settings.hideallsitesbutton) {
575                        jQuery('#cc-approve-button-allsites').show();
576                    }
577                }
578                
579                jQuery.each(cc.cookies, function (key, value) {
580                  if (value.approved == false) {
581                      jQuery('#cc-checkbox-' + key).removeAttr("checked");
582                      jQuery(this).parent().addClass('cc-notification-permissions-inactive');
583                  } else {
584                      jQuery('#cc-checkbox-' + key).prop('checked', true);
585                      jQuery(this).parent().removeClass('cc-notification-permissions-inactive');
586
587                  }
588                });                
589                
590                jQuery('#cc-approve-button-thissite').html(cc.strings.savePreference);
591                jQuery('#cc-approve-button-allsites').html(cc.strings.saveForAllSites);
592                jQuery(this).html(cc.strings.hideDetails);
593            } else {
594                jQuery.each(cc.cookies, function (key, value) {
595                    if (value.defaultstate == "off") {
596                        jQuery('#cc-checkbox-' + key).removeAttr("checked");
597                        jQuery(this).parent().addClass('cc-notification-permissions-inactive');
598                    } else {
599                        jQuery('#cc-checkbox-' + key).prop('checked', true);
600                        jQuery(this).parent().removeClass('cc-notification-permissions-inactive');
601
602                    }
603                });
604                if (cc.settings.consenttype == 'implicit') {
605                    jQuery(this).html(cc.strings.seeDetailsImplicit);
606                    jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit);
607                    jQuery('#cc-approve-button-allsites').hide();
608                } else {
609                    jQuery(this).html(cc.strings.seeDetails);
610                    jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookies);
611                    jQuery('#cc-approve-button-allsites').html(cc.strings.allowForAllSites);
612                }
613            }
614            jQuery('#cc-notification-logo').fadeToggle();
615            jQuery('#cc-notification-permissions').slideToggle();
616            jQuery(this).blur();
617            return false;
618        });
619
620        if (!cc.ismobile) {
621            if (cc.settings.bannerPosition == "cc-push") {
622                jQuery('html').animate({marginTop: bannerh}, 400);
623            }
624            jQuery('#cc-notification').slideDown();
625        } else {
626            jQuery('#cc-notification').show();
627        }
628        //Dissaprove button
629        jQuery('#cc-disapprove-button-thissite, a.cc-disapprove-button-thissite').click(cc.onlocalconsentgivenNot);
630        jQuery('#cc-approve-button-thissite').click(cc.onlocalconsentgiven);
631        if (cc.settings.clickAnyLinkToConsent) {
632            jQuery("a").filter(':not(.cc-link)').click(cc.onlocalconsentgiven);
633        }
634        if (allcustom) {
635            jQuery('#cc-notification h2 span').html(cc.strings.customCookie);
636            jQuery('#cc-approve-button-allsites').hide();
637        } else {
638            jQuery('#cc-approve-button-allsites').click(cc.onremoteconsentgiven);
639        }
640
641    },
642
643    timestamp: function () {
644        return Math.round((new Date()).getTime() / 1000);
645    },
646
647    locationcallback: function (data) {
648        if (data.statusCode == "OK" && data.countryCode) {
649            ineu = "yes";
650            if (jQuery.inArray(data.countryCode, cc.eumemberstates) == -1) {
651                //Visitor is from outside EU
652                ineu = "no";
653                jQuery.each(cc.cookies, function (key, value) {
654                    cc.approved[key] = "yes";
655                });
656                cc.settings.hideprivacysettingstab = true;
657            }
658            cc.setcookie('cc_ineu', ineu, 365);
659        }
660        if (data.statusCode == "ERROR" && data.statusMessage == "Invalid API key.") {
661            alert(cc.strings.invalidKeyWarning)
662        }
663        cc.checkapproval();
664    },
665
666    checkdonottrack: function () {
667        cc.checkeddonottrack = true;
668        if (!cc.settings.ignoreDoNotTrack) {
669            if (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "yes" || navigator.msDoNotTrack == "1") {
670                cc.settings.consenttype = "explicit";
671            }
672        }
673        cc.checkapproval();
674    },
675
676    checkapproval: function () {
677        if (!cc.checkedipdb && cc.settings.onlyshowwithineu) {
678            cc.checkedipdb = true;
679            ineu = cc.getcookie('cc_ineu');
680            if (ineu) {
681                if (ineu == "no") {
682                    jQuery.each(cc.cookies, function (key, value) {
683                        cc.approved[key] = "yes";
684                    });
685                    cc.settings.hideprivacysettingstab = true;
686                }
687            } else {
688                jQuery.getScript("https://api.ipinfodb.com/v3/ip-country/?key=" + cc.settings.ipinfodbkey + "&format=json&callback=cc.locationcallback");
689                return;
690            }
691        }
692
693        cc.allasked = true;
694        jQuery.each(cc.cookies, function (key, value) {
695            if (cc.approved[key]) {
696                if (cc.approved[key] == "yes" || (cc.approved[key] == "always" && cc.checkedremote)) {
697                    cc.cookies[key].asked = true;
698                    cc.cookies[key].approved = true;
699                    cc.execute(key);
700                } else if ((cc.approved[key] == "never" && cc.checkedremote) || cc.approved[key] == "no") {
701                    cc.cookies[key].asked = true;
702                    cc.cookies[key].approved = false;
703                } else {
704
705                    cc.allasked = false;
706                }
707            } else {
708
709                cc.allasked = false;
710            }
711        });
712
713        if (!cc.allasked) {
714            if (!cc.checkedlocal) {
715                cc.checklocal();
716                return;
717            }
718            if (!cc.checkedremote && !cc.settings.disableallsites) {
719                cc.fetchprefs();
720                return;
721            }
722            if (!cc.checkeddonottrack) {
723                cc.checkdonottrack();
724                return;
725            }
726            if (cc.settings.consenttype == "implicit") {
727                jQuery.each(cc.cookies, function (key, value) {
728                    if (!cc.cookies[key].asked) {
729                        if (cc.settings.onlyshowbanneronce) {
730                            cc.setcookie('cc_' + key, 'yes', 365);
731                        }
732                        cc.execute(key);
733                    }
734                });
735            }
736            cc.showbanner();
737        } else {
738            if (cc.settings.collectStatistics) {
739                params = "";
740                params += "?s=1&n=1&" + cc.calculatestatsparams();
741                cc.insertscript(cc.settings.serveraddr + params);
742            }
743            cc.showminiconsent();
744        }
745    },
746
747    execute: function (cookieType) {
748        if (cookieType == "necessary") {
749            return;
750        }
751        if (cc.cookies[cookieType].executed) {
752            return;
753        }
754        jQuery('.cc-placeholder-' + cookieType).remove();
755        jQuery('script.cc-onconsent-' + cookieType + '[type="text/plain"]').each(function () {
756            if (jQuery(this).attr('src')) {
757                jQuery(this).after('<script type="text/javascript" src="' + jQuery(this).attr('src') + '"></script>');
758            } else {
759                jQuery(this).after('<script type="text/javascript">' + jQuery(this).html() + '</script>');
760            }
761        });
762        cc.cookies[cookieType].executed = true;
763        jQuery(document).trigger("cc_" + cookieType);
764
765        cc.executescriptinclusion(cookieType);
766
767    },
768
769    executescriptinclusion: function (cookieType) {
770        timetaken = jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').length * cc.settings.scriptdelay;
771        now = new Date().getTime();
772
773        if (now < cc.executionblock) {
774            setTimeout(cc.executescriptinclusion, cc.executionblock - now, [cookieType]);
775            return;
776        }
777        cc.executionblock = now + timetaken;
778
779        cc.insertscripts(cookieType);
780    },
781
782    insertscripts: function (cookieType) {
783
784        jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').first().each(function () {
785            cc.uniqelemid++;
786            if (jQuery(this).parents('body').size() > 0) {
787                jQuery(this).after('<div id="cc-consentarea-' + cc.uniqelemid + '" class="' + cookieType + '"></div>');
788                document.write = function (g) {
789                    jQuery('#cc-consentarea-' + cc.uniqelemid).append(g);
790                };
791                document.writeln = function (g) {
792                    jQuery('#cc-consentarea-' + cc.uniqelemid).append(g);
793                };
794            }
795
796            if (jQuery(this).attr('src')) {
797                jQuery(this).after('<script type="text/javascript" src="' + jQuery(this).attr('src') + '"></script>');
798            } else {
799                jQuery(this).after('<script type="text/javascript">' + jQuery(this).html() + '</script>');
800            }
801            jQuery(this).remove();
802
803        });
804
805        if (jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').length > 0) {
806            setTimeout(cc.insertscripts, cc.settings.scriptdelay, [cookieType]);
807        }
808    },
809
810    getcookie: function (c_name) {
811        var i, x, y, ARRcookies = document.cookie.split(";");
812        for (i = 0; i < ARRcookies.length; i++) {
813            x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
814            y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
815            x = x.replace(/^\s+|\s+$/g, "");
816            if (x == c_name) {
817                return unescape(y);
818            }
819        }
820        return false;
821    },
822
823    setcookie: function (name, value, expirydays) {
824        var exdate = new Date();
825        exdate.setDate(exdate.getDate() + expirydays);
826        // document.cookie = name + '=' + value + '; expires=' + exdate.toUTCString() + '; path=/;secure;'
827        document.cookie = name + '=' + value + '; expires=' + exdate.toUTCString() + '; path=/;secure;'
828    },
829
830    onremoteconsentgiven: function () {
831        if (cc.settings.clickAnyLinkToConsent) {
832            jQuery("a").filter(':not(.cc-link)').unbind("click");
833        }
834        cc.allagree = true;
835        jQuery.each(cc.cookies, function (key, value) {
836            if (!value.approved && !value.asked) {
837                if (jQuery('#cc-checkbox-' + key).is(':checked')) {
838                    if (key == "social" || key == "analytics" || key == "advertising") {
839                        cc.remoteCookies[key] = "always";
840                        cc.approved[key] = "always";
841                    } else {
842                        cc.approved[key] = "yes";
843                    }
844                    cc.cookies[key].asked = true;
845                } else {
846                    if (key == "social" || key == "analytics" || key == "advertising") {
847                        cc.remoteCookies[key] = "never";
848                        cc.approved[key] = "never";
849                    } else {
850                        cc.approved[key] = "no";
851                    }
852                    cc.allagree = false;
853                    cc.cookies[key].asked = true;
854                }
855                cc.setcookie('cc_' + key, cc.approved[key], 365);
856            } else {
857            }
858        });
859        urlx = cc.settings.serveraddr + '?p=1&tokenonly=true&cc-key=' + cc.sessionkey;
860        if (cc.remoteCookies['social']) {
861            urlx += '&cc-cookies-social=' + cc.approved['social'];
862        }
863        if (cc.remoteCookies['analytics']) {
864            urlx += '&cc-cookies-analytics=' + cc.approved['analytics'];
865        }
866        if (cc.remoteCookies['advertising']) {
867            urlx += '&cc-cookies-advertising=' + cc.approved['advertising'];
868        }
869        cc.reloadkey = true;
870        cc.insertscript(urlx);
871
872        if (!cc.ismobile) {
873            jQuery('#cc-notification').slideUp();
874            if (cc.settings.bannerPosition == "cc-push") {
875                //detect body margin
876                jQuery('html').animate({marginTop: 0}, 400);
877            }
878        }
879        cc.checkapproval();
880
881        return false;
882    },
883
884    onlocalconsentgiven: function () {
885        enableall = false;
886        enablejustone = false;
887        if (jQuery(this).hasClass('cc-button-enableall') || jQuery(this).hasClass('cc-button-enable-all')) {
888            enableall = true;
889            jQuery.each(cc.cookies, function (key, value) {
890                cc.cookies[key].asked = false;
891            });
892        }
893        elem = this;
894        jQuery.each(cc.cookies, function (key, value) {
895            if (jQuery(elem).hasClass('cc-button-enable-' + key)) {
896                enablejustone = true;
897                cc.approved[key] = "yes";
898                cc.cookies[key].asked = true;
899                cc.setcookie('cc_' + key, cc.approved[key], 365);
900            }
901        });
902
903        cc.allagree = true;
904        if (!enablejustone) {
905            if (cc.settings.clickAnyLinkToConsent) {
906                jQuery("a").filter(':not(.cc-link)').unbind("click");
907            }
908            jQuery.each(cc.cookies, function (key, value) {
909                if (!value.approved && !value.asked) {
910                    if (enableall || jQuery('#cc-checkbox-' + key).is(':checked') || key == 'necessary') {
911                        cc.approved[key] = "yes";
912                        cc.cookies[key].asked = true;
913                    } else {
914                        cc.approved[key] = "no";
915                        cc.cookies[key].asked = true;
916                        cc.allagree = false;
917                    }
918                    cc.setcookie('cc_' + key, cc.approved[key], 365);
919                } else {
920                }
921            });
922        }
923        if (!cc.allagree && cc.settings.consenttype == "implicit") {
924            cc.forcereload = true;
925        }
926
927        if (!cc.ismobile) {
928            jQuery('#cc-notification').slideUp();
929            if (cc.settings.bannerPosition == "cc-push") {
930                //detect body margin
931                jQuery('html').animate({marginTop: 0}, 400);
932            }
933        }
934        
935        jQuery('#cc-modal-overlay').hide();
936        jQuery('#cc-modal-overlay').css('display','none');
937        cc.checkapproval();
938        cc.reloadifnecessary();
939
940        return false;
941    },
942
943
944
945    onlocalconsentgivenNot: function () {
946        enableall = false;
947        enablejustone = false;
948        if (jQuery(this).hasClass('cc-button-enableall') || jQuery(this).hasClass('cc-button-enable-all')) {
949            enableall = true;
950            jQuery.each(cc.cookies, function (key, value) {
951                cc.cookies[key].asked = false;
952            });
953        }
954        elem = this;
955        jQuery.each(cc.cookies, function (key, value) {
956            if (jQuery(elem).hasClass('cc-button-enable-' + key)) {
957                enablejustone = true;
958                cc.approved[key] = "no";
959                cc.cookies[key].asked = true;
960                cc.setcookie('cc_' + key, cc.approved[key], 365);
961            }
962        });
963
964        cc.allagree = true;
965        if (!enablejustone) {
966            if (cc.settings.clickAnyLinkToConsent) {
967                jQuery("a").filter(':not(.cc-link)').unbind("click");
968            }
969            jQuery.each(cc.cookies, function (key, value) {
970                if (!value.approved && !value.asked) {
971                    if (enableall || jQuery('#cc-checkbox-' + key).is(':checked')) {
972                        cc.approved[key] = "no";
973                        cc.cookies[key].asked = true;
974                    } else {
975                        cc.approved[key] = "no";
976                        cc.cookies[key].asked = true;
977                        cc.allagree = false;
978                    }
979                    if (key == 'necessary') cc.approved[key]='yes';
980                    cc.setcookie('cc_' + key, cc.approved[key], 14);
981                } else {
982                }
983            });
984        }
985        if (!cc.allagree && cc.settings.consenttype == "implicit") {
986            cc.forcereload = true;
987        }
988
989        if (!cc.ismobile) {
990            jQuery('#cc-notification').slideUp();
991            if (cc.settings.bannerPosition == "cc-push") {
992                //detect body margin
993                jQuery('html').animate({marginTop: 0}, 400);
994            }
995        }
996        
997        jQuery('#cc-modal-overlay').fadeOut();
998        cc.checkapproval();
999        cc.reloadifnecessary();
1000
1001        return false;
1002    },
1003
1004    showminiconsent: function () {
1005        if (jQuery('#cc-tag').length == 0) {
1006            data = '<div id="cc-tag" class="cc-tag-' + cc.settings.tagPosition + '"><a class="cc-link" href="#" id="cc-tag-button" title="' + cc.strings.privacySettings + '"><span>' + cc.strings.privacySettings + '</span></a></div>';
1007            jQuery('body').prepend(data);
1008            jQuery('#cc-tag').addClass(cc.settings.style);
1009            if (!cc.settings.hideprivacysettingstab) {
1010                jQuery('#cc-tag').fadeIn();
1011            } else {
1012                jQuery('#cc-tag').hide();
1013            }
1014            jQuery('.cc-privacy-link').click(cc.showmodal);
1015            jQuery('#cc-tag-button').click(cc.showmodal);
1016        }
1017    },
1018
1019    getsize: function (obj) {
1020        var size = 0, key;
1021        for (key in obj) {
1022            if (obj.hasOwnProperty(key)) size++;
1023        }
1024        return size;
1025    },
1026
1027    settoken: function (data) {
1028        if (cc.reloadkey) {
1029            cc.reloadkey = false;
1030            if (!cc.allagree && cc.settings.consenttype == "implicit") {
1031                cc.forcereload = true;
1032            }
1033            cc.reloadifnecessary();
1034        }
1035        cc.sessionkey = data;
1036    },
1037
1038    showmodal: function () {
1039        if (!cc.checkedremote && !cc.settings.disableallsites) {
1040            cc.fetchprefs();
1041        }
1042        jQuery(document).bind('keyup', cc.onkeyup);
1043        if (jQuery('#cc-modal-overlay').length == 0) jQuery('body').prepend('<div id="cc-modal-overlay"></div>');
1044        jQuery(this).blur();
1045        if (cc.ismobile) {
1046            cc.setupformobile();
1047        }
1048        data = '<div id="cc-modal">' +
1049            '<div id="cc-modal-wrapper">' +
1050            '<div class="cc-info">'+
1051              '<h2>' + cc.strings.privacySettingsDialogTitleA + ' <span>' + cc.strings.privacySettingsDialogTitleB + '</span></h2>' +
1052              '<p class="cc-subtitle">' + cc.strings.privacySettingsDialogSubtitle + '</p>' +
1053              '<div class="cc-content"></div>' +
1054              '<div class="cc-clear"></div>' +
1055              '<p id="cc-modal-closebutton" class="cc-modal-closebutton"><a class="cc-link" href="#" title="' + cc.strings.closeWindow + '"><span>' + cc.strings.closeWindow + '</span></a></p>' +
1056            '</div>'+  
1057            
1058            '<div id="cc-modal-footer-buttons">' +
1059
1060            '<p id="cc-modal-global"><a class="cc-link" href="#" title="' + cc.strings.changeForAllSitesLink + '"><span>' + cc.strings.changeForAllSitesLink + '</span></a></p></div>' +
1061            '<a id="cc-notification-logo" class="cc-logo cc-link" target="_blank" href="' + cc.strings.privacyPolicyLink +'" title="' + cc.strings.privacyPolicyText + '"><span>' + cc.strings.privacyPolicyText + '</span></a> ' +
1062            '<div class="cc-clear"></div>' +
1063            '</div>' +
1064            '</div>';
1065        jQuery('body').prepend(data);
1066        if (cc.settings.disableallsites) {
1067            jQuery('#cc-modal-global').hide();
1068        }
1069        jQuery('#cc-modal').addClass(cc.settings.style).click(cc.closemodals);
1070        if (cc.ismobile) {
1071            jQuery('#cc-modal').addClass("cc-mobile");
1072        }
1073        cc.reloadmodal();
1074        jQuery('#cc-modal').fadeIn();
1075        jQuery('#cc-modal-overlay').fadeIn();
1076        jQuery('#cc-modal-wrapper').click(function (e) {
1077            cc.noclosewin = true;
1078        });
1079        jQuery('#cc-modal .cc-modal-closebutton a').click(function () {
1080            cc.showhidemodal();
1081            cc.reloadifnecessary();
1082            return false;
1083        });
1084        jQuery('#cc-modal-global').click(function () {
1085            cc.frommodal = true;
1086            cc.gotosettings();
1087            return false;
1088        });
1089        jQuery('#cc-tag-button').unbind('click').click(cc.showhidemodal);
1090        jQuery('.cc-privacy-link').unbind('click').click(cc.showhidemodal);
1091
1092        return false;
1093    },
1094
1095    closepreferencesmodal: function () {
1096        jQuery.each(cc.defaultCookies, function (key, value) {
1097            value = jQuery('#cc-globalpreference-selector-' + key).val();
1098            if (cc.approved[key] != "yes" && cc.approved[key] != "no") {
1099                cc.approved[key] = value;
1100                cc.setcookie('cc_' + key, cc.approved[key], 365);
1101            }
1102            cc.remoteCookies[key] = value;
1103
1104        });
1105        urlx = cc.settings.serveraddr + '?p=1&tokenonly=true&cc-key=' + cc.sessionkey;
1106        if (cc.remoteCookies['social']) {
1107            urlx += '&cc-cookies-social=' + cc.remoteCookies['social'];
1108        }
1109        if (cc.remoteCookies['analytics']) {
1110            urlx += '&cc-cookies-analytics=' + cc.remoteCookies['analytics'];
1111        }
1112        if (cc.remoteCookies['advertising']) {
1113            urlx += '&cc-cookies-advertising=' + cc.remoteCookies['advertising'];
1114        }
1115
1116        cc.insertscript(urlx);
1117
1118        jQuery('#cc-notification').hide().remove();
1119        jQuery(this).blur();
1120        jQuery('#cc-settingsmodal').fadeOut(null, function () {
1121            jQuery('#cc-settingsmodal').remove();
1122        });
1123        if (!cc.frommodal) {
1124            cc.checkapproval();
1125            cc.reloadifnecessary();
1126        } else {
1127            cc.frommodal = false;
1128            cc.showhidemodal();
1129        }
1130        return false;
1131    },
1132
1133    showhidemodal: function () {
1134        jQuery(this).blur();
1135        cc.checkedlocal = false;
1136        cc.checkedremote = false;
1137        if (jQuery('#cc-modal').is(":visible") && !cc.frommodal) {
1138            cc.closingmodal = true;
1139            jQuery('#cc-modal-overlay').fadeToggle(null, function () {
1140                cc.closingmodal = false;
1141            });
1142            jQuery.each(cc.cookies, function (key, value) {
1143                thisval = jQuery('#cc-preference-selector-' + key).val();
1144                
1145                if (key == "necessary") {
1146                    thisval = "yes";
1147                }
1148
1149                if (thisval == "no") {
1150                    cc.cookies[key].approved = false;
1151                    cc.approved[key] = "no";
1152                    cc.setcookie('cc_' + key, cc.approved[key], 365);
1153                } else if (thisval == "yes") {
1154                    cc.cookies[key].approved = true;
1155                    cc.approved[key] = "yes";
1156                    cc.setcookie('cc_' + key, cc.approved[key], 365);
1157                } else {
1158                    cc.cookies[key].approved = false;
1159                    cc.deletecookie(key);
1160                    delete cc.approved[key];
1161                }
1162                cc.cookies[key].asked = false;
1163
1164            });
1165            
1166            cc.checkapproval();
1167            
1168        } else if (!jQuery('#cc-settingsmodal').is(":visible") && !jQuery('#cc-modal').is(":visible")) {
1169            cc.closingmodal = true;
1170            jQuery('#cc-modal-overlay').fadeToggle(null, function () {
1171                cc.closingmodal = false;
1172            });
1173        }
1174        if (cc.ismobile) {
1175            jQuery('#cc-modal').toggle();
1176        } else {
1177            jQuery('#cc-modal').fadeToggle();
1178        }
1179        return false;
1180    },
1181
1182
1183    reloadmodal: function () {
1184        jQuery('#cc-modal-wrapper .cc-content').html('');
1185        if (cc.getsize(cc.cookies) > 0) {
1186            jQuery('#cc-modal-wrapper .cc-content').append('<ul></ul>');
1187            jQuery.each(cc.cookies, function (key, value) {
1188              
1189                /*
1190                jQuery('#cc-modal-wrapper ul').append(
1191                  '<li id="cc-preference-element-' + key + '">'+
1192                    '<label for="cc-preference-selector-' + key + '"><strong>' + value.title + '</strong><span>' + value.description + '</span></label>'+
1193                    '<select id="cc-preference-selector-' + key + '"><option value="yes">' + cc.strings.preferenceConsent + '</option><option value="no">' + cc.strings.preferenceDecline + '</option></select>'+
1194                  '</li>'
1195                );
1196                */
1197
1198                jQuery('#cc-modal-wrapper ul').append(
1199                  '<li id="cc-preference-element-' + key + '">'+
1200                    '<strong>' + value.title + '</strong><p><span>' + value.description + '</span></p>'+
1201                    '<input id="cc-preference-selector-' + key + '" type="checkbox" return="yes" />'+
1202                    '<label for="cc-preference-selector-' + key + '">Toogle</label>'+
1203                  '</li>'
1204                );
1205              
1206              
1207                if (value.link) {
1208                    jQuery('#cc-preference-element-' + key + ' label span').append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>');
1209                }
1210                if ((key == "social" || key == "advertising" || key == "analytics") && !cc.settings.disableallsites) {
1211                    // jQuery('#cc-preference-selector-' + key).append('<option value="global">
1211' + cc.strings.preferenceUseGlobal + '</option>');
1212                }
1213                jQuery('#cc-change-button-allsites').unbind('click').click(function () {
1214                    cc.frommodal = true;
1215                    cc.gotosettings();
1216                    return false;
1217                });
1218                jQuery('#cc-preference-selector-' + key).change(function () {
1219                  if (jQuery(this).prop('checked')) { 
1220                    jQuery(this).removeAttr('checked').val('no');
1221                  } else {
1222                    jQuery(this).prop('checked',true).val('yes');
1223                  }  
1224                });
1225                if (key == "necessary") {
1226                    jQuery('#cc-preference-selector-' + key).prop('checked',true);
1227                    jQuery('#cc-preference-selector-' + key).val("yes");
1228                    jQuery('#cc-preference-selector-' + key).prop('disabled',true);
1229                }
1230                if (value.approved == true) {
1231                    jQuery('#cc-preference-selector-' + key).val("yes");
1232                    jQuery('#cc-preference-selector-' + key).prop('checked',true);
1233                }
1234                else if (value.approved == false) {
1235                    jQuery('#cc-preference-selector-' + key).val("no");
1236                    jQuery('#cc-preference-selector-' + key).removeAttr('checked');
1237                }
1238                else {
1239                    // jQuery('#cc-preference-selector-' + key).val("global")
1240                  jQuery('#cc-preference-selector-' + key).val("no");
1241                  jQuery('#cc-preference-selector-' + key).prop('checked',false);
1242                }
1243
1244            });
1245        } else {
1246            jQuery('#cc-modal-wrapper .cc-content').append('<p>' + cc.strings.notUsingCookies + '</p>');
1247        }
1248        jQuery('.cc-content').append('<div class="cc-clear"></div>');
1249    },
1250
1251    reloadsettingsmodal: function () {
1252        jQuery('#cc-settingsmodal-wrapper .cc-content').html('');
1253        if (cc.getsize(cc.defaultCookies) > 0) {
1254            jQuery('#cc-settingsmodal-wrapper .cc-content').append('<ul></ul>');
1255            jQuery.each(cc.defaultCookies, function (key, value) {
1256
1257                jQuery('#cc-settingsmodal-wrapper ul').append('<li id="cc-globalpreference-element-' + key + '"><label for="cc-globalpreference-selector-' + key + '"><strong>' + value.title + '</strong><span>' + value.description + '</span></label><select id="cc-globalpreference-selector-' + key + '"><option value="ask">' + cc.strings.preferenceAsk + '</option><option value="always">' + cc.strings.preferenceAlways + '</option><option value="never">' + cc.strings.preferenceNever + '</option></select></li>');
1258                if (value.link) {
1259                    jQuery('#cc-globalpreference-element-' + key + ' label span').append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>');
1260                }
1261                jQuery('#cc-globalpreference-selector-' + key).change(function () {
1262
1263                });
1264                if (cc.remoteCookies[key] == "always") {
1265                    jQuery('#cc-globalpreference-selector-' + key).val("always")
1266                }
1267                else if (cc.remoteCookies[key] == "never") {
1268                    jQuery('#cc-globalpreference-selector-' + key).val("never")
1269                }
1270                else {
1271                    jQuery('#cc-globalpreference-selector-' + key).val("ask")
1272                }
1273
1274            });
1275        } else {
1276            jQuery('#cc-settingsmodal-wrapper .cc-content').append('<p>' + cc.strings.notUsingCookies + '</p>');
1277        }
1278        jQuery('#cc-settingsmodal-wrapper .cc-content').append('<div class="cc-clear"></div>');
1279    },
1280
1281    approvedeny: function () {
1282        key = jQuery(this).attr("id").split("-")[2];
1283        if (cc.cookies[key].approved) {
1284            cc.cookies[key].approved = false;
1285            cc.approved[key] = "no";
1286        } else {
1287            cc.cookies[key].approved = true;
1288            cc.approved[key] = "yes";
1289        }
1290        cc.setcookie('cc_' + key, cc.approved[key], 365);
1291        cc.checkapproval();
1292        cc.reloadmodal();
1293        return false;
1294    },
1295
1296    clearalllocalcookies: function () {
1297        var cookies = document.cookie.split(";");
1298
1299        for (var i = 0; i < cookies.length; i++) {
1300            var cookie = cookies[i];
1301            var eqPos = cookie.indexOf("=");
1302            var name = eqPos >
1302 -1 ? cookie.substr(0, eqPos) : cookie;
1303            document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
1304        }
1305    },
1306
1307    clearlocal: function () {
1308        cc.clearalllocalcookies();
1309        jQuery(this).before('<p>' + cc.strings.clearedCookies + '</p>')
1310    },
1311
1312    getcurrenturl: function () {
1313        return window.location.protocol + "//" + window.location.host + window.location.pathname;
1314    },
1315
1316    gotosettings: function () {
1317        if (jQuery('#cc-modal').is(":visible")) {
1318            cc.showhidemodal();
1319        }
1320        jQuery(this).blur();
1321        if (cc.ismobile) {
1322            cc.setupformobile();
1323            jQuery('#cc-notification').remove();
1324        }
1325        if (cc.frommodal) {
1326            buttontext = cc.strings.backToSiteSettings;
1327        } else {
1328            buttontext = cc.strings.closeWindow;
1329        }
1330
1331        data = '<div id="cc-settingsmodal">' +
1332            '<div id="cc-settingsmodal-wrapper">' +
1333            '<h2>' + cc.strings.allSitesSettingsDialogTitleA + ' <span>' + cc.strings.allSitesSettingsDialogTitleB + '</span></h2>' +
1334            '<p class="cc-subtitle">' + cc.strings.allSitesSettingsDialogSubtitle + '</p>' +
1335            '<div class="cc-content">' +
1336            '</div>' +
1337            '<div class="cc-clear"></div>' +
1338            '<p id="cc-settingsmodal-closebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' +
1339            '<div id="cc-settingsmodal-footer-buttons">' +
1340            '<p id="cc-settingsmodal-secondclosebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' +
1341            '</div>' +
1342            '<a id="cc-notification-logo" class="cc-logo cc-link" target="_blank" href="' + cc.strings.privacyPolicyLink +'" title="' + cc.strings.privacyPolicyText + '"><span>' + cc.privacyPolicyText + '</span></a> ' +
1343            '</div>' +
1344            '</div>';
1345        jQuery('body').prepend(data);
1346        cc.reloadsettingsmodal();
1347        jQuery('#cc-settingsmodal').addClass(cc.settings.style).click(cc.closemodals);
1348        jQuery('#cc-settingsmodal-wrapper').click(function () {
1349            cc.noclosewin = true;
1350        });
1351        if (cc.ismobile) {
1352            jQuery('#cc-settingsmodal').addClass("cc-mobile");
1353        }
1354        jQuery('#cc-settingsmodal').fadeIn();
1355        jQuery('.cc-settingsmodal-closebutton').click(cc.closepreferencesmodal);
1356
1357        return false;
1358    },
1359
1360    setupformobile: function () {
1361        if (!cc.hassetupmobile) {
1362            cc.hassetupmobile = true;
1363            // jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">');
1364            if (cc.settings.style == 'cc-light') {
1365                bgcol = '#e1e1e1';
1366            } else {
1367                bgcol = '#1d1d1d'
1368            }
1369            // jQuery('body').html('').css("margin", 0).css('width', 'auto').css("backgroundColor", bgcol).css("backgroundImage", 'none');
1370        }
1371    },
1372
1373    onfirstload: function () {
1374        if (!cc.setupcomplete && cc.initobj) {
1375            if (!(window.jQuery)) {
1376                cc.jqueryattempts++;
1377                if (cc.jqueryattempts >= 5) {
1378                    return;
1379                }
1380                setTimeout(cc.onfirstload, 200);
1381                return;
1382            }
1383            cc.setupcomplete = true;
1384            cc.setup();
1385        }
1386        setTimeout(cc.afterload, 50);
1387        cc.checkapproval();
1388    },
1389
1390    afterload: function () {
1391        jQuery('.cc-button-enableall').addClass('cc-link').click(cc.onlocalconsentgiven);
1392        jQuery('.cc-button-enable-all').addClass('cc-link').click(cc.onlocalconsentgiven);
1393        jQuery.each(cc.cookies, function (key, value) {
1394            jQuery('.cc-button-enable-' + key).addClass('cc-link').click(cc.onlocalconsentgiven);
1395        });
1396    }
1397}
1398
1399if (!(window.jQuery)) {
1400    var s = document.createElement('script');
1401    s.setAttribute('src', '/script/jquery/jquery-1.12.4.min.js');
1402    s.setAttribute('type', 'text/javascript');
1403    document.getElementsByTagName('head')[0].appendChild(s);
1404    if (window.onload != null) {
1405        var oldOnload = window.onload;
1406        window.onload = function (e) {
1407            oldOnload(e);
1408            cc.onfirstload();
1409        };
1410    }
1411    else {
1412        window.onload = cc.onfirstload;
1413    }
1414} else {
1415  jQuery(document).ready(cc.onfirstload);
1416}
1417
1418/**
1419 * jQuery.browser.mobile (https://detectmobilebrowser.com/)
1420 *
1421 * jQuery.browser.mobile will be true if the browser is a mobile device - modified so that cc.ismobile is true
1422 *
1423 **/
1424(function (a) {
1425    cc.ismobile = /android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1425sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))
1426})(navigator.userAgent || navigator.vendor || window.opera);
1427
1428
1429/**
1430 * Load web font
1431 *
1432 **/
1433
1434WebFontConfig = {
1435    google: { families: [ 'Open+Sans:400,600:latin' ] }
1436};
1437(function () {
1438    if (cc.getcookie('cc_analytics') != 'yes') return;
1439    var wf = document.createElement('script');
1440    wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
1441    wf.type = 'text/javascript';
1442    wf.async = 'true';
1443    var s = document.getElementsByTagName('script')[0];
1444    s.parentNode.insertBefore(wf, s);
1445})();

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.