PageSourceSearch

https://www.museooristano.it/resources/library/templates/cookieconsent.js

js museooristano.it collected 2026-10-02 13:42:19 UTC 55,554 bytes, 1,340 lines download raw bytes

1/*
2 Copyright 2012-2013 Silktide Ltd.
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 3 of the License, or
6 (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 GNU General Public License for more details.
11 You should have received a copy of the GNU General Public License
12 along with this program.  If not, see <http://www.gnu.org/licenses/>
13*/
14
15var cc =
16{
17    version: '1.0.10',
18    jqueryversionrequired: '1.4.4',
19    initobj: false,
20    ismobile: false,
21    setupcomplete: false,
22    allasked: false,
23    checkedlocal: false,
24    checkedremote: false,
25    remoteresponse: false,
26    frommodal: false,
27    hassetupmobile: false,
28    sessionkey: false,
29    noclosewin: false,
30    closingmodal: false,
31    jqueryattempts: 0,
32    reloadkey: false,
33    forcereload: false,
34    allagree: true,
35    checkedipdb: false,
36    cookies: {},
37    uniqelemid: 0,
38    executionblock: 0,
39    defaultCookies: { social: {}, analytics: {}, advertising: {}},
40    remoteCookies: {},
41    approved: {},
42    bindfunctions: {},
43    checkeddonottrack: false,
44    eumemberstates: [
45        "BE",
46        "BG",
47        "CZ",
48        "DK",
49        "DE",
50        "EE",
51        "IE",
52        "EL",
53        "ES",
54        "FR",
55        "IT",
56        "CY",
57        "LV",
58        "LT",
59        "LU",
60        "HU",
61        "MT",
62        "NL",
63        "AT",
64        "PL",
65        "PT",
66        "RO",
67        "SI",
68        "SK",
69        "FI",
70        "SE",
71        "UK"
72    ],
73    settings: {
74        refreshOnConsent: false,
75        style: "dark",
76        bannerPosition: "top",
77        clickAnyLinkToConsent: false,
78        privacyPolicy: false,
79        collectStatistics: false,
80        tagPosition: 'bottom-right',
81        useSSL: false,
82        serveraddr: 'http://cookieconsent.silktide.com/',
83        clearprefs: false,
84        consenttype: 'explicit',
85        onlyshowbanneronce: false,
86        hideallsitesbutton: false,
87        disableallsites: false,
88        hideprivacysettingstab: false,
89        scriptdelay: 800,
90        testmode: false,
91        overridewarnings: false,
92        onlyshowwithineu: false,
93        ipinfodbkey: false,
94        ignoreDoNotTrack: false
95    },
96
97    strings: {
98        jqueryWarning: "Developer: Caution! In order to use Cookie Consent, you need to use jQuery 1.4.4 or higher.",
99        noJsBlocksWarning: "Developer: Warning! It doesn't look like you have set up Cookie Consent correctly.  You must follow all steps of the setup guide at http://silktide.com/cookieconsent/code.  If you believe you are seeing this message in error, you can use the overridewarnings setting (see docs for more information).",
100        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.  Check the documentation at http://silktide.com/cookieconsent for more information",
101        invalidKeyWarning: "Developer: Warning! You must provide a valid API key for IP Info DB.  Check the documentation at http://silktide.com/cookieconsent for more information",
102        necessaryDefaultTitle: "Strictly necessary",
103        socialDefaultTitle: "Social media",
104        analyticsDefaultTitle: "Analytics",
105        advertisingDefaultTitle: "Advertising",
106        defaultTitle: "Default cookie title",
107        necessaryDefaultDescription: "Some cookies on this website are strictly necessary and cannot be disabled.",
108        socialDefaultDescription: "Facebook, Twitter and other social websites need to know who you are to work properly.",
109        analyticsDefaultDescription: "We anonymously measure your use of this website to improve your experience.",
110        advertisingDefaultDescription: "Adverts will be chosen for you automatically based on your past behaviour and interests.",
111        defaultDescription: "Default cookie description.",
112        notificationTitle: "Your experience on this site will be improved by allowing cookies",
113        notificationTitleImplicit: "We use cookies to ensure you get the best experience on our website",
114        poweredBy: "Cookie Consent plugin for the EU cookie law",
115        privacyPolicy: "Privacy policy",
116        learnMore: "Learn more",
117        seeDetails: "see details",
118        seeDetailsImplicit: "change your settings",
119        hideDetails: "hide details",
120        savePreference: 'Save preference',
121        saveForAllSites: 'Save for all sites',
122        allowCookies: 'Allow cookies',
123        allowCookiesImplicit: 'Close',
124        allowForAllSites: 'Allow for all sites',
125        customCookie: 'This website uses a custom type of cookie which needs specific approval',
126        privacySettings: "Privacy settings",
127        privacySettingsDialogTitleA: "Privacy settings",
128        privacySettingsDialogTitleB: "for this website",
129        privacySettingsDialogSubtitle: "Some features of this website need your consent to remember who you are.",
130        closeWindow: "Close window",
131        changeForAllSitesLink: "Change settings for all websites",
132        preferenceUseGlobal: 'Use global setting',
133        preferenceConsent: "I consent",
134        preferenceDecline: "I decline",
135        preferenceAsk: 'Ask me each time',
136        preferenceAlways: "Always allow",
137        preferenceNever: "Never allow",
138        notUsingCookies: "This website does not use any cookies.",
139        clearedCookies: "Your cookies have been cleared, you will need to reload this page for the settings to have effect.",
140        allSitesSettingsDialogTitleA: "Privacy settings",
141        allSitesSettingsDialogTitleB: "for all websites",
142        allSitesSettingsDialogSubtitle: "You may consent to these cookies for all websites that use this plugin.",
143        backToSiteSettings: "Back to website settings"
144    },
145
146    onconsent: function (cookieType, input) {
147        if (cc.isfunction(input)) {
148            fn = input;
149        }
150        else {
151            scriptname = input;
152            fn = function () {
153                cc.insertscript(scriptname);
154            };
155        }
156        if (cc.cookies && cc.cookies[cookieType] && cc.cookies[cookieType].approved) {
157            cc.cookies[cookieType].executed = true;
158            fn();
159        } else {
160            if (window.jQuery) {
161                jQuery(document).bind("cc_" + cookieType, fn);
162            } else {
163                if (cc.bindfunctions[cookieType]) {
164                    cc.bindfunctions[cookieType][cc.bindfunctions[cookieType].length] = fn;
165                } else {
166                    cc.bindfunctions[cookieType] = new Array(fn);
167                }
168            }
169        }
170    },
171
172    geturlparameter: function (name) {
173        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
174        var regexS = "[\\?&]" + name + "=([^&#]*)";
175        var regex = new RegExp(regexS);
176        var results = regex.exec(window.location.search);
177        if (results == null)
178            return false;
179        else
180            return decodeURIComponent(results[1].replace(/\+/g, " "));
181    },
182
183    isfunction: function (functionToCheck) {
184        var getType = {};
185        return functionToCheck && getType.toString.call(functionToCheck) == '[object Function]';
186    },
187
188    setup: function () {
189        jQuery.each(cc.bindfunctions, function (key, value) {
190            for (i = 0; i < value.length; i++) {
191                jQuery(document).bind("cc_" + key, value[i]);
192            }
193        });
194        verstr = jQuery().jquery;
195        parts = verstr.split('.');
196        versionRequired = cc.jqueryversionrequired.split('.');
197        jqueryOk = true;
198        for (i = 0; i < parts.length && i < versionRequired.length; i++) {
199            currentpart = parseInt(parts[i]);
200            requiredpart = parseInt(versionRequired[i]);
201            if (currentpart < requiredpart) {
202                /* Unsatisfied - this part of the version string is less than the version we require */
203                jqueryok = false;
204                break;
205            }
206            if (currentpart > requiredpart) {
207                /* Satisfied - this part of the version string is greater than the version we require */
208                break;
209            }
210            /* This version is the same as the one we require.  Check the next part of the version number. */
211        }
212        if (!jqueryOk) {
213            alert(cc.strings.jqueryWarning);
214        }
215        jQuery.each(cc.defaultCookies, function (key, value) {
216            if (key == "necessary") {
217                cc.defaultCookies[key].title = cc.strings.necessaryDefaultTitle;
218                cc.defaultCookies[key].description = cc.strings.necessaryDefaultDescription;
219            }
220            else if (key == "social") {
221                cc.defaultCookies[key].title = cc.strings.socialDefaultTitle;
222                cc.defaultCookies[key].description = cc.strings.socialDefaultDescription;
223            }
224            else if (key == "analytics") {
225                cc.defaultCookies[key].title = cc.strings.analyticsDefaultTitle;
226                cc.defaultCookies[key].description = cc.strings.analyticsDefaultDescription;
227            }
228            else if (key == "advertising") {
229                cc.defaultCookies[key].title = cc.strings.advertisingDefaultTitle;
230                cc.defaultCookies[key].description = cc.strings.advertisingDefaultDescription;
231            }
232        });
233        jQuery.each(cc.initobj.cookies, function (key, value) {
234
235            if (!value.title) {
236                if (key == "necessary") {
237                    cc.initobj.cookies[key].title = cc.strings.necessaryDefaultTitle;
238                }
239                else if (key == "social") {
240                    cc.initobj.cookies[key].title = cc.strings.socialDefaultTitle;
241                }
242                else if (key == "analytics") {
243                    cc.initobj.cookies[key].title = cc.strings.analyticsDefaultTitle;
244                }
245                else if (key == "advertising") {
246                    cc.initobj.cookies[key].title = cc.strings.advertisingDefaultTitle;
247                } else {
248                    cc.initobj.cookies[key].title = cc.strings.defaultTitle;
249                }
250            }
251            if (!value.description) {
252                if (key == "necessary") {
253                    cc.initobj.cookies[key].description = cc.strings.necessaryDefaultDescription;
254                }
255                else if (key == "social") {
256                    cc.initobj.cookies[key].description = cc.strings.socialDefaultDescription;
257                }
258                else if (key == "analytics") {
259                    cc.initobj.cookies[key].description = cc.strings.analyticsDefaultDescription;
260                }
261                else if (key == "advertising") {
262                    cc.initobj.cookies[key].description = cc.strings.advertisingDefaultDescription;
263                } else {
264                    cc.initobj.cookies[key].description = cc.strings.defaultDescription;
265                }
266            }
267
268            if (!value.defaultstate) {
269                cc.initobj.cookies[key].defaultstate = "on";
270            }
271
272            cc.initobj.cookies[key].asked = false;
273            cc.initobj.cookies[key].approved = false;
274            cc.initobj.cookies[key].executed = false;
275        });
276        if (cc.settings.onlyshowwithineu && !cc.settings.ipinfodbkey) {
277            alert(cc.strings.noKeyWarning);
278        }
279        testmode = cc.geturlparameter('cctestmode');
280        if (testmode == 'accept' || testmode == 'decline') {
281            cc.settings.testmode = testmode;
282        }
283        if (cc.settings.disableallsites) {
284            cc.settings.hideallsitesbutton = true;
285        }
286
287        for (var attrname in cc.initobj.cookies) {
288            cc.cookies[attrname] = cc.initobj.cookies[attrname];
289            if (cc.settings.testmode == "accept") {
290                cc.approved[attrname] = "yes";
291            }
292            if (cc.settings.testmode == "decline") {
293                cc.approved[attrname] = "no";
294            }
295        }
296
297    },
298
299    initialise: function (obj) {
300        cc.initobj = obj;
301        if (obj.settings !== undefined) {
302            for (var attrname in obj.settings) {
303                this.settings[attrname] = obj.settings[attrname];
304            }
305        }
306        if (obj.strings !== undefined) {
307            for (var attrname in obj.strings) {
308                this.strings[attrname] = obj.strings[attrname];
309            }
310        }
311        cc.settings.style = "cc-" + cc.settings.style;
312        cc.settings.bannerPosition = "cc-" + cc.settings.bannerPosition;
313        if (cc.settings.useSSL) {
314            cc.settings.serveraddr = 'https://cookieconsent.silktide.com/';
315        }
316        if (window.jQuery) {
317            cc.setupcomplete = true;
318            cc.setup();
319        }
320    },
321
322    calculatestatsparams: function () {
323        params = "c=";
324        first = true;
325        jQuery.each(cc.initobj.cookies, function (key, value) {
326            if (first) {
327                first = false;
328            } else {
329                params += ";";
330            }
331            params += encodeURIComponent(key) + ":";
332
333            if (cc.approved[key]) {
334                params += cc.approved[key];
335            } else {
336                params += "none";
337            }
338            if (value.statsid) {
339                params += ":" + value.statsid;
340            }
341        });
342        if (cc.ismobile) {
343            params += "&m=1";
344        } else {
345            params += "&m=0";
346        }
347        params += "&u=" + encodeURIComponent(document.URL);
348        return params;
349    },
350
351    setsessionkey: function (data) {
352        cc.sessionkey = data;
353    },
354
355
356    fetchprefs: function () {
357        cc.remoteresponse = false;
358        params = "?s=1";
359        if (cc.settings.collectStatistics) {
360            params = "?s=1&" + cc.calculatestatsparams();
361        }
362        if (cc.settings.clearprefs) {
363            params += "&v=1";
364            cc.settings.clearprefs = false;
365        }
366        cc.insertscript(cc.settings.serveraddr + params);
367        setTimeout(function () {
368            if (!cc.remoteresponse) {
369                cc.checkapproval();
370            }
371        }, 3000);
372        this.checkedremote = true;
373    },
374
375    responseids: function (data) {
376        jQuery.each(data, function (key, value) {
377            cc.cookies[key].statsid = value;
378        });
379    },
380
381    insertscript: function (script) {
382        var newfile = document.createElement('script');
383        newfile.setAttribute("type", "text/javascript");
384        newfile.setAttribute("src", script);
385        document.getElementsByTagName("head")[0].appendChild(newfile);
386    },
387
388    insertscripttag: function (content) {
389        var newfile = document.createElement('script');
390        newfile.setAttribute("type", "text/javascript");
391        newfile.innerHTML = content;
392        document.getElementsByTagName("head")[0].appendChild(newfile);
393    },
394
395    checklocal: function () {
396        this.checkedlocal = true;
397        jQuery.each(cc.cookies, function (key, value) {
398            cookieval = cc.getcookie('cc_' + key);
399            if (cookieval) {
400                cc.approved[key] = cookieval;
401            }
402        });
403        this.checkapproval();
404    },
405
406    response: function (data) {
407        cc.remoteresponse = true
408        jQuery.each(data, function (key, value) {
409            if (cc.cookies[key] && (!cc.approved[key] || (cc.approved[key] && (cc.approved[key] == "always" || cc.approved[key] == "never")))) {
410                cc.setcookie('cc_' + key, value, 365);
411            }
412        });
413
414        for (var attrname in data) {
415            cc.remoteCookies[attrname] = data[attrname];
416            if (this.approved[attrname] != "yes" && this.approved[attrname] != "no") {
417                this.approved[attrname] = data[attrname];
418            }
419        }
420        jQuery.each(cc.cookies, function (key, value) {
421            if (!data[key] && (cc.approved[key] == "always" || cc.approved[key] == "never")) {
422                cc.cookies[key].approved = false;
423                cc.deletecookie(key);
424                delete cc.approved[key];
425            }
426        });
427
428        this.checkapproval();
429    },
430
431    deletecookie: function (key) {
432        date = new Date();
433        date.setDate(date.getDate() - 1);
434        document.cookie = escape("cc_" + key) + '=; path=/; expires=' + date;
435    },
436
437    reloadifnecessary: function () {
438        if (cc.settings.refreshOnConsent || cc.ismobile || cc.forcereload) {
439            setTimeout("location.reload(true);", 50);
440        }
441    },
442
443    onkeyup: function (e) {
444        if (e.keyCode == 27) {
445            cc.closemodals();
446        }
447    },
448
449    closemodals: function () {
450        if (!cc.closingmodal) {
451            if (cc.noclosewin) {
452                cc.noclosewin = false;
453            } else {
454                if (jQuery('#cc-modal').is(":visible")) {
455                    jQuery('#cc-modal .cc-modal-closebutton a').click();
456                }
457                if (jQuery('#cc-settingsmodal').is(":visible")) {
458                    jQuery('#cc-settingsmodal #cc-settingsmodal-closebutton a').click();
459                }
460            }
461        }
462    },
463
464    showbanner: function () {
465        jQuery('#cc-tag').fadeOut(null, function () {
466            jQuery(this).remove();
467        });
468        jQuery('#cc-notification').remove();
469        if (cc.ismobile) {
470            cc.setupformobile();
471            jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">');
472            jQuery('body').html('').css("margin", 0);
473        }
474        data = '<div id="cc-notification">' +
475            '<div id="cc-notification-wrapper">' +
476            '<h2><span>' + cc.strings.notificationTitle + '</span></h2>' +
477            '<div id="cc-notification-permissions">' +
478//            '<a id="cc-notification-logo" class="cc-logo" target="_blank" href="http://silktide.com/cookieconsent" title="' + cc.strings.poweredBy + '"><span>' + cc.strings.poweredBy + '</span></a> ' +
479            '</div>' +
480            '<ul class="cc-notification-buttons">' +
481
482//            '<li>' +
483//            '<a class="cc-link" href="http://cookieconsent.silktide.com" id="cc-approve-button-allsites">' + cc.strings.allowForAllSites + '</a>' +
484//            '</li>' +
485            '<li>' +
486            '<a class="cc-link" href="#" id="cc-approve-button-thissite">' + cc.strings.allowCookies + '</a>' +
487            '</li>' +
488            '</ul>' +
489            '<div class="cc-clear"></div>' +
490            '</div>' +
491            '</div>';
492
493        jQuery('body').prepend(data);
494        if (cc.settings.hideallsitesbutton) {
495            jQuery('#cc-approve-button-allsites').hide();
496        }
497        if (cc.settings.consenttype == 'implicit') {
498            jQuery('#cc-notification h2 span').html(cc.strings.notificationTitleImplicit);
499            jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit);
500            jQuery('#cc-approve-button-thissite').parent().after(jQuery('#cc-approve-button-allsites').parent());
501            jQuery('#cc-approve-button-allsites').hide();
502        }
503        jQuery('#cc-notification-logo').hide();
504        jQuery('#cc-notification').addClass(cc.settings.style).addClass(cc.settings.bannerPosition);
505        bannerh = jQuery('#cc-notification').height();
506        jQuery('#cc-notification').hide();
507        if (cc.ismobile) {
508            jQuery('#cc-notification').addClass("cc-mobile");
509        }
510        jQuery('#cc-notification-permissions').prepend('<ul></ul>');
511        allcustom = true;
512        jQuery.each(cc.cookies, function (key, value) {
513            if (!value.asked) {
514                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>');
515                if (value.link) {
516                    jQuery('#cc-label-' + key).append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>');
517                }
518                if (key == "social" || key == "analytics" || key == "advertising") {
519                    allcustom = false;
520                }
521                jQuery('#cc-checkbox-' + key).change(function () {
522                    if (jQuery(this).is(':checked')) {
523                        jQuery(this).parent().removeClass('cc-notification-permissions-inactive');
524                    } else {
525                        jQuery(this).parent().addClass('cc-notification-permissions-inactive');
526
527                    }
528                });
529                if (value.defaultstate == "off") {
530                    jQuery('#cc-checkbox-' + key).removeAttr("checked").parent().addClass('cc-notification-permissions-inactive');
531                }
532                if (key == "necessary") {
533                    jQuery('#cc-checkbox-' + key).attr("disabled", "disabled");
534                }
535            }
536        });
537        //jQuery('#cc-notification-wrapper h2').append(' - <a class="cc-link" href="#" id="cc-notification-moreinfo">' + cc.strings.seeDetails + '</a>');
538        if (cc.settings.privacyPolicy) {
539            jQuery('#cc-notification-wrapper h2').append(' <a class="cc-link" href="' + cc.settings.privacyPolicy + '">' + cc.strings.privacyPolicy + '</a>');
540        }
541        if (cc.settings.consenttype == "implicit") {
542            jQuery('#cc-notification-moreinfo').html(cc.strings.seeDetailsImplicit);
543        }
544        jQuery('#cc-notification-moreinfo').click(function () {
545            if (jQuery(this).html() == cc.strings.seeDetails || jQuery(this).html() == cc.strings.seeDetailsImplicit) {
546                if (cc.settings.consenttype == 'implicit') {
547                    if (!cc.settings.hideallsitesbutton) {
548                        jQuery('#cc-approve-button-allsites').show();
549                    }
550                }
551                jQuery('#cc-approve-button-thissite').html(cc.strings.savePreference);
552                jQuery('#cc-approve-button-allsites').html(cc.strings.saveForAllSites);
553                jQuery(this).html(cc.strings.hideDetails);
554            } else {
555                jQuery.each(cc.cookies, function (key, value) {
556                    if (value.defaultstate == "off") {
557                        jQuery('#cc-checkbox-' + key).removeAttr("checked");
558                        jQuery(this).parent().addClass('cc-notification-permissions-inactive');
559                    } else {
560                        jQuery('#cc-checkbox-' + key).attr('checked', 'checked');
561                        jQuery(this).parent().removeClass('cc-notification-permissions-inactive');
562
563                    }
564                });
565                if (cc.settings.consenttype == 'implicit') {
566                    jQuery(this).html(cc.strings.seeDetailsImplicit);
567                    jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit);
568                    jQuery('#cc-approve-button-allsites').hide();
569                } else {
570                    jQuery(this).html(cc.strings.seeDetails);
571                    jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookies);
572                    jQuery('#cc-approve-button-allsites').html(cc.strings.allowForAllSites);
573                }
574            }
575            jQuery('#cc-notification-logo').fadeToggle();
576            jQuery('#cc-notification-permissions').slideToggle();
577            jQuery(this).blur();
578            return false;
579        });
580
581        if (!cc.ismobile) {
582            if (cc.settings.bannerPosition == "cc-push") {
583                jQuery('html').animate({marginTop: bannerh}, 400);
584            }
585            jQuery('#cc-notification').slideDown();
586        } else {
587            jQuery('#cc-notification').show();
588        }
589
590        jQuery('#cc-approve-button-thissite').click(cc.onlocalconsentgiven);
591        if (cc.settings.clickAnyLinkToConsent) {
592            jQuery("a").filter(':not(.cc-link)').click(cc.onlocalconsentgiven);
593        }
594        if (allcustom) {
595            jQuery('#cc-notification h2 span').html(cc.strings.customCookie);
596            jQuery('#cc-approve-button-allsites').hide();
597        } else {
598            jQuery('#cc-approve-button-allsites').click(cc.onremoteconsentgiven);
599        }
600
601    },
602
603    timestamp: function () {
604        return Math.round((new Date()).getTime() / 1000);
605    },
606
607    locationcallback: function (data) {
608        if (data.statusCode == "OK" && data.countryCode) {
609            ineu = "yes";
610            if (jQuery.inArray(data.countryCode, cc.eumemberstates) == -1) {
611                //Visitor is from outside EU
612                ineu = "no";
613                jQuery.each(cc.cookies, function (key, value) {
614                    cc.approved[key] = "yes";
615                });
616                cc.settings.hideprivacysettingstab = true;
617            }
618            cc.setcookie('cc_ineu', ineu, 365);
619        }
620        if (data.statusCode == "ERROR" && data.statusMessage == "Invalid API key.") {
621            alert(cc.strings.invalidKeyWarning)
622        }
623        cc.checkapproval();
624    },
625
626    checkdonottrack: function () {
627        cc.checkeddonottrack = true;
628        if (!cc.settings.ignoreDoNotTrack) {
629            if (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "yes" || navigator.msDoNotTrack == "1") {
630                cc.settings.consenttype = "explicit";
631            }
632        }
633        cc.checkapproval();
634    },
635
636    checkapproval: function () {
637        if (!cc.checkedipdb && cc.settings.onlyshowwithineu) {
638            cc.checkedipdb = true;
639            ineu = cc.getcookie('cc_ineu');
640            if (ineu) {
641                if (ineu == "no") {
642                    jQuery.each(cc.cookies, function (key, value) {
643                        cc.approved[key] = "yes";
644                    });
645                    cc.settings.hideprivacysettingstab = true;
646                }
647            } else {
648                jQuery.getScript("http://api.ipinfodb.com/v3/ip-country/?key=" + cc.settings.ipinfodbkey + "&format=json&callback=cc.locationcallback");
649                return;
650            }
651        }
652
653        cc.allasked = true;
654        jQuery.each(cc.cookies, function (key, value) {
655            if (cc.approved[key]) {
656                if (cc.approved[key] == "yes" || (cc.approved[key] == "always" && cc.checkedremote)) {
657                    cc.cookies[key].asked = true;
658                    cc.cookies[key].approved = true;
659                    cc.execute(key);
660                } else if ((cc.approved[key] == "never" && cc.checkedremote) || cc.approved[key] == "no") {
661                    cc.cookies[key].asked = true;
662                    cc.cookies[key].approved = false;
663                } else {
664
665                    cc.allasked = false;
666                }
667            } else {
668
669                cc.allasked = false;
670            }
671        });
672
673        if (!cc.allasked) {
674            if (!cc.checkedlocal) {
675                cc.checklocal();
676                return;
677            }
678            if (!cc.checkedremote && !cc.settings.disableallsites) {
679                cc.fetchprefs();
680                return;
681            }
682            if (!cc.checkeddonottrack) {
683                cc.checkdonottrack();
684                return;
685            }
686            if (cc.settings.consenttype == "implicit") {
687                jQuery.each(cc.cookies, function (key, value) {
688                    if (!cc.cookies[key].asked) {
689                        if (cc.settings.onlyshowbanneronce) {
690                            cc.setcookie('cc_' + key, 'yes', 365);
691                        }
692                        cc.execute(key);
693                    }
694                });
695            }
696            cc.showbanner();
697        } else {
698            if (cc.settings.collectStatistics) {
699                params = "";
700                params += "?s=1&n=1&" + cc.calculatestatsparams();
701                cc.insertscript(cc.settings.serveraddr + params);
702            }
703            cc.showminiconsent();
704        }
705    },
706
707    execute: function (cookieType) {
708        if (cookieType == "necessary") {
709            return;
710        }
711        if (cc.cookies[cookieType].executed) {
712            return;
713        }
714        jQuery('.cc-placeholder-' + cookieType).remove();
715        jQuery('script.cc-onconsent-' + cookieType + '[type="text/plain"]').each(function () {
716            if (jQuery(this).attr('src')) {
717                jQuery(this).after('<script type="text/javascript" src="' + jQuery(this).attr('src') + '"></script>');
718            } else {
719                jQuery(this).after('<script type="text/javascript">' + jQuery(this).html() + '</script>');
720            }
721        });
722        cc.cookies[cookieType].executed = true;
723        jQuery(document).trigger("cc_" + cookieType);
724
725        cc.executescriptinclusion(cookieType);
726
727    },
728
729    executescriptinclusion: function (cookieType) {
730        timetaken = jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').size() * cc.settings.scriptdelay;
731        now = new Date().getTime();
732
733        if (now < cc.executionblock) {
734            setTimeout(cc.executescriptinclusion, cc.executionblock - now, [cookieType]);
735            return;
736        }
737        cc.executionblock = now + timetaken;
738
739        cc.insertscripts(cookieType);
740    },
741
742    insertscripts: function (cookieType) {
743
744        jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').first().each(function () {
745            cc.uniqelemid++;
746            if (jQuery(this).parents('body').size() > 0) {
747                jQuery(this).after('<div id="cc-consentarea-' + cc.uniqelemid + '" class="' + cookieType + '"></div>');
748                document.write = function (g) {
749                    jQuery('#cc-consentarea-' + cc.uniqelemid).append(g);
750                };
751                document.writeln = function (g) {
752                    jQuery('#cc-consentarea-' + cc.uniqelemid).append(g);
753                };
754            }
755
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            jQuery(this).remove();
762
763        });
764
765        if (jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').size() > 0) {
766            setTimeout(cc.insertscripts, cc.settings.scriptdelay, [cookieType]);
767        }
768    },
769
770    getcookie: function (c_name) {
771        var i, x, y, ARRcookies = document.cookie.split(";");
772        for (i = 0; i < ARRcookies.length; i++) {
773            x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
774            y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
775            x = x.replace(/^\s+|\s+$/g, "");
776            if (x == c_name) {
777                return unescape(y);
778            }
779        }
780        return false;
781    },
782
783    setcookie: function (name, value, expirydays) {
784        var exdate = new Date();
785        exdate.setDate(exdate.getDate() + expirydays);
786        document.cookie = name + '=' + value + '; expires=' + exdate.toUTCString() + '; path=/'
787    },
788
789    onremoteconsentgiven: function () {
790        if (cc.settings.clickAnyLinkToConsent) {
791            jQuery("a").filter(':not(.cc-link)').unbind("click");
792        }
793        cc.allagree = true;
794        jQuery.each(cc.cookies, function (key, value) {
795            if (!value.approved && !value.asked) {
796                if (jQuery('#cc-checkbox-' + key).is(':checked')) {
797                    if (key == "social" || key == "analytics" || key == "advertising") {
798                        cc.remoteCookies[key] = "always";
799                        cc.approved[key] = "always";
800                    } else {
801                        cc.approved[key] = "yes";
802                    }
803                    cc.cookies[key].asked = true;
804                } else {
805                    if (key == "social" || key == "analytics" || key == "advertising") {
806                        cc.remoteCookies[key] = "never";
807                        cc.approved[key] = "never";
808                    } else {
809                        cc.approved[key] = "no";
810                    }
811                    cc.allagree = false;
812                    cc.cookies[key].asked = true;
813                }
814                cc.setcookie('cc_' + key, cc.approved[key], 365);
815            } else {
816            }
817        });
818        urlx = cc.settings.serveraddr + '?p=1&tokenonly=true&cc-key=' + cc.sessionkey;
819        if (cc.remoteCookies['social']) {
820            urlx += '&cc-cookies-social=' + cc.approved['social'];
821        }
822        if (cc.remoteCookies['analytics']) {
823            urlx += '&cc-cookies-analytics=' + cc.approved['analytics'];
824        }
825        if (cc.remoteCookies['advertising']) {
826            urlx += '&cc-cookies-advertising=' + cc.approved['advertising'];
827        }
828        cc.reloadkey = true;
829        cc.insertscript(urlx);
830
831        if (!cc.ismobile) {
832            jQuery('#cc-notification').slideUp();
833            if (cc.settings.bannerPosition == "cc-push") {
834                //detect body margin
835                jQuery('html').animate({marginTop: 0}, 400);
836            }
837        }
838        cc.checkapproval();
839
840        return false;
841    },
842
843    onlocalconsentgiven: function () {
844        enableall = false;
845        enablejustone = false;
846        if (jQuery(this).hasClass('cc-button-enableall') || jQuery(this).hasClass('cc-button-enable-all')) {
847            enableall = true;
848            jQuery.each(cc.cookies, function (key, value) {
849                cc.cookies[key].asked = false;
850            });
851        }
852        elem = this;
853        jQuery.each(cc.cookies, function (key, value) {
854            if (jQuery(elem).hasClass('cc-button-enable-' + key)) {
855                enablejustone = true;
856                cc.approved[key] = "yes";
857                cc.cookies[key].asked = true;
858                cc.setcookie('cc_' + key, cc.approved[key], 365);
859            }
860        });
861
862        cc.allagree = true;
863        if (!enablejustone) {
864            if (cc.settings.clickAnyLinkToConsent) {
865                jQuery("a").filter(':not(.cc-link)').unbind("click");
866            }
867            jQuery.each(cc.cookies, function (key, value) {
868                if (!value.approved && !value.asked) {
869                    if (enableall || jQuery('#cc-checkbox-' + key).is(':checked')) {
870                        cc.approved[key] = "yes";
871                        cc.cookies[key].asked = true;
872                    } else {
873                        cc.approved[key] = "no";
874                        cc.cookies[key].asked = true;
875                        cc.allagree = false;
876                    }
877                    cc.setcookie('cc_' + key, cc.approved[key], 365);
878                } else {
879                }
880            });
881        }
882        if (!cc.allagree && cc.settings.consenttype == "implicit") {
883            cc.forcereload = true;
884        }
885
886        if (!cc.ismobile) {
887            jQuery('#cc-notification').slideUp();
888            if (cc.settings.bannerPosition == "cc-push") {
889                //detect body margin
890                jQuery('html').animate({marginTop: 0}, 400);
891            }
892        }
893        cc.checkapproval();
894        cc.reloadifnecessary();
895
896        return false;
897    },
898
899    showminiconsent: function () {
900        if (false && jQuery('#cc-tag').length == 0) {
901            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>';
902            jQuery('body').prepend(data);
903            jQuery('#cc-tag').addClass(cc.settings.style);
904            if (!cc.settings.hideprivacysettingstab) {
905                jQuery('#cc-tag').fadeIn();
906            } else {
907                jQuery('#cc-tag').hide();
908            }
909            jQuery('.cc-privacy-link').click(cc.showmodal);
910            jQuery('#cc-tag-button').click(cc.showmodal);
911        }
912    },
913
914    getsize: function (obj) {
915        var size = 0, key;
916        for (key in obj) {
917            if (obj.hasOwnProperty(key)) size++;
918        }
919        return size;
920    },
921
922    settoken: function (data) {
923        if (cc.reloadkey) {
924            cc.reloadkey = false;
925            if (!cc.allagree && cc.settings.consenttype == "implicit") {
926                cc.forcereload = true;
927            }
928            cc.reloadifnecessary();
929        }
930        cc.sessionkey = data;
931    },
932
933    showmodal: function () {
934        if (!cc.checkedremote && !cc.settings.disableallsites) {
935            cc.fetchprefs();
936        }
937        jQuery(document).bind('keyup', cc.onkeyup);
938        jQuery('body').prepend('<div id="cc-modal-overlay"></div>');
939        jQuery(this).blur();
940        if (cc.ismobile) {
941            cc.setupformobile();
942        }
943        data = '<div id="cc-modal">' +
944            '<div id="cc-modal-wrapper">' +
945            '<h2>' + cc.strings.privacySettingsDialogTitleA + ' <span>' + cc.strings.privacySettingsDialogTitleB + '</span></h2>' +
946            '<p class="cc-subtitle">' + cc.strings.privacySettingsDialogSubtitle + '</p>' +
947
948            '<div class="cc-content">' +
949            '</div>' +
950
951            '<div class="cc-clear"></div>' +
952
953            '<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>' +
954            '<div id="cc-modal-footer-buttons">' +
955
956            '<p id="cc-modal-global"><a class="cc-link" href="#" title="' + cc.strings.changeForAllSitesLink + '"><span>' + cc.strings.changeForAllSitesLink + '</span></a></p></div>' +
957            '<a id="cc-notification-logo" class="cc-logo" target="_blank" href="http://silktide.com/cookieconsent" title="' + cc.strings.poweredBy + '"><span>' + cc.strings.poweredBy + '</span></a> ' +
958            '<div class="cc-clear"></div>' +
959            '</div>' +
960            '</div>';
961        jQuery('body').prepend(data);
962        if (cc.settings.disableallsites) {
963            jQuery('#cc-modal-global').hide();
964        }
965        jQuery('#cc-modal').addClass(cc.settings.style).click(cc.closemodals);
966        if (cc.ismobile) {
967            jQuery('#cc-modal').addClass("cc-mobile");
968        }
969        cc.reloadmodal();
970        jQuery('#cc-modal').fadeIn();
971        jQuery('#cc-modal-overlay').fadeIn();
972        jQuery('#cc-modal-wrapper').click(function () {
973            cc.noclosewin = true;
974        });
975        jQuery('#cc-modal .cc-modal-closebutton a').click(function () {
976            cc.showhidemodal();
977            cc.reloadifnecessary();
978            return false;
979        });
980        jQuery('#cc-modal-global').click(function () {
981            cc.frommodal = true;
982            cc.gotosettings();
983            return false;
984        });
985        jQuery('#cc-tag-button').unbind('click').click(cc.showhidemodal);
986        jQuery('.cc-privacy-link').unbind('click').click(cc.showhidemodal);
987
988        return false;
989    },
990
991    closepreferencesmodal: function () {
992        jQuery.each(cc.defaultCookies, function (key, value) {
993            value = jQuery('#cc-globalpreference-selector-' + key).val();
994            if (cc.approved[key] != "yes" && cc.approved[key] != "no") {
995                cc.approved[key] = value;
996                cc.setcookie('cc_' + key, cc.approved[key], 365);
997            }
998            cc.remoteCookies[key] = value;
999
1000        });
1001        urlx = cc.settings.serveraddr + '?p=1&tokenonly=true&cc-key=' + cc.sessionkey;
1002        if (cc.remoteCookies['social']) {
1003            urlx += '&cc-cookies-social=' + cc.remoteCookies['social'];
1004        }
1005        if (cc.remoteCookies['analytics']) {
1006            urlx += '&cc-cookies-analytics=' + cc.remoteCookies['analytics'];
1007        }
1008        if (cc.remoteCookies['advertising']) {
1009            urlx += '&cc-cookies-advertising=' + cc.remoteCookies['advertising'];
1010        }
1011
1012        cc.insertscript(urlx);
1013
1014        jQuery('#cc-notification').hide().remove();
1015        jQuery(this).blur();
1016        jQuery('#cc-settingsmodal').fadeOut(null, function () {
1017            jQuery('#cc-settingsmodal').remove();
1018        });
1019        if (!cc.frommodal) {
1020            cc.checkapproval();
1021            cc.reloadifnecessary();
1022        } else {
1023            cc.frommodal = false;
1024            cc.showhidemodal();
1025        }
1026        return false;
1027    },
1028
1029    showhidemodal: function () {
1030        jQuery(this).blur();
1031        cc.checkedlocal = false;
1032        cc.checkedremote = false;
1033        if (jQuery('#cc-modal').is(":visible") && !cc.frommodal) {
1034            cc.closingmodal = true;
1035            jQuery('#cc-modal-overlay').fadeToggle(null, function () {
1036                cc.closingmodal = false;
1037            });
1038            jQuery.each(cc.cookies, function (key, value) {
1039                thisval = jQuery('#cc-preference-selector-' + key).val();
1040
1041                if (key == "necessary") {
1042                    thisval = "yes";
1043                }
1044
1045                if (thisval == "no") {
1046                    cc.cookies[key].approved = false;
1047                    cc.approved[key] = "no";
1048                    cc.setcookie('cc_' + key, cc.approved[key], 365);
1049                } else if (thisval == "yes") {
1050                    cc.cookies[key].approved = true;
1051                    cc.approved[key] = "yes";
1052                    cc.setcookie('cc_' + key, cc.approved[key], 365);
1053                } else {
1054                    cc.cookies[key].approved = false;
1055                    cc.deletecookie(key);
1056                    delete cc.approved[key];
1057                }
1058                cc.cookies[key].asked = false;
1059
1060            });
1061            cc.checkapproval();
1062        } else if (!jQuery('#cc-settingsmodal').is(":visible") && !jQuery('#cc-modal').is(":visible")) {
1063            cc.closingmodal = true;
1064            jQuery('#cc-modal-overlay').fadeToggle(null, function () {
1065                cc.closingmodal = false;
1066            });
1067        }
1068        if (cc.ismobile) {
1069            jQuery('#cc-modal').toggle();
1070        } else {
1071            jQuery('#cc-modal').fadeToggle();
1072        }
1073        return false;
1074    },
1075
1076
1077    reloadmodal: function () {
1078        jQuery('#cc-modal-wrapper .cc-content').html('');
1079        if (cc.getsize(cc.cookies) > 0) {
1080            jQuery('#cc-modal-wrapper .cc-content').append('<ul></ul>');
1081            jQuery.each(cc.cookies, function (key, value) {
1082
1083                jQuery('#cc-modal-wrapper ul').append('<li id="cc-preference-element-' + key + '"><label for="cc-preference-selector-' + key + '"><strong>' + value.title + '</strong><span>' + value.description + '</span></label><select id="cc-preference-selector-' + key + '"><option value="yes">' + cc.strings.preferenceConsent + '</option><option value="no">' + cc.strings.preferenceDecline + '</option></select></li>');
1084                if (value.link) {
1085                    jQuery('#cc-preference-element-' + key + ' label span').append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>');
1086                }
1087                if ((key == "social" || key == "advertising" || key == "analytics") && !cc.settings.disableallsites) {
1088                    jQuery('#cc-preference-selector-' + key).append('<option value="global">' + cc.strings.preferenceUseGlobal + '</option>');
1089                }
1090                jQuery('#cc-change-button-allsites').unbind('click').click(function () {
1091                    cc.frommodal = true;
1092                    cc.gotosettings();
1093                    return false;
1094                });
1095                jQuery('#cc-preference-selector-' + key).change(function () {
1096
1097                });
1098                if (key == "necessary") {
1099                    jQuery('#cc-preference-selector-' + key).remove();
1100                }
1101                if (cc.approved[key] == "yes") {
1102                    jQuery('#cc-preference-selector-' + key).val("yes")
1103                }
1104                else if (cc.approved[key] == "no") {
1105                    jQuery('#cc-preference-selector-' + key).val("no")
1106                }
1107                else {
1108                    jQuery('#cc-preference-selector-' + key).val("global")
1109                }
1110
1111            });
1112        } else {
1113            jQuery('#cc-modal-wrapper .cc-content').append('<p>' + cc.strings.notUsingCookies + '</p>');
1114        }
1115        jQuery('.cc-content').append('<div class="cc-clear"></div>');
1116    },
1117
1118    reloadsettingsmodal: function () {
1119        jQuery('#cc-settingsmodal-wrapper .cc-content').html('');
1120        if (cc.getsize(cc.defaultCookies) > 0) {
1121            jQuery('#cc-settingsmodal-wrapper .cc-content').append('<ul></ul>');
1122            jQuery.each(cc.defaultCookies, function (key, value) {
1123
1124                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>');
1125                if (value.link) {
1126                    jQuery('#cc-globalpreference-element-' + key + ' label span').append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>');
1127                }
1128                jQuery('#cc-globalpreference-selector-' + key).change(function () {
1129
1130                });
1131                if (cc.remoteCookies[key] == "always") {
1132                    jQuery('#cc-globalpreference-selector-' + key).val("always")
1133                }
1134                else if (cc.remoteCookies[key] == "never") {
1135                    jQuery('#cc-globalpreference-selector-' + key).val("never")
1136                }
1137                else {
1138                    jQuery('#cc-globalpreference-selector-' + key).val("ask")
1139                }
1140
1141            });
1142        } else {
1143            jQuery('#cc-settingsmodal-wrapper .cc-content').append('<p>' + cc.strings.notUsingCookies + '</p>');
1144        }
1145        jQuery('#cc-settingsmodal-wrapper .cc-content').append('<div class="cc-clear"></div>');
1146    },
1147
1148    approvedeny: function () {
1149        key = jQuery(this).attr("id").split("-")[2];
1150        if (cc.cookies[key].approved) {
1151            cc.cookies[key].approved = false;
1152            cc.approved[key] = "no";
1153        } else {
1154            cc.cookies[key].approved = true;
1155            cc.approved[key] = "yes";
1156        }
1157        cc.setcookie('cc_' + key, cc.approved[key], 365);
1158        cc.checkapproval();
1159        cc.reloadmodal();
1160        return false;
1161    },
1162
1163    clearalllocalcookies: function () {
1164        var cookies = document.cookie.split(";");
1165
1166        for (var i = 0; i < cookies.length; i++) {
1167            var cookie = cookies[i];
1168            var eqPos = cookie.indexOf("=");
1169            var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
1170            document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
1171        }
1172    },
1173
1174    clearlocal: function () {
1175        cc.clearalllocalcookies();
1176        jQuery(this).before('<p>' + cc.strings.clearedCookies + '</p>')
1177    },
1178
1179    getcurrenturl: function () {
1180        return window.location.protocol + "//" + window.location.host + window.location.pathname;
1181    },
1182
1183    gotosettings: function () {
1184        if (jQuery('#cc-modal').is(":visible")) {
1185            cc.showhidemodal();
1186        }
1187        jQuery(this).blur();
1188        if (cc.ismobile) {
1189            cc.setupformobile();
1190            jQuery('#cc-notification').remove();
1191        }
1192        if (cc.frommodal) {
1193            buttontext = cc.strings.backToSiteSettings;
1194        } else {
1195            buttontext = cc.strings.closeWindow;
1196        }
1197
1198        data = '<div id="cc-settingsmodal">' +
1199            '<div id="cc-settingsmodal-wrapper">' +
1200            '<h2>' + cc.strings.allSitesSettingsDialogTitleA + ' <span>' + cc.strings.allSitesSettingsDialogTitleB + '</span></h2>' +
1201            '<p class="cc-subtitle">' + cc.strings.allSitesSettingsDialogSubtitle + '</p>' +
1202            '<div class="cc-content">' +
1203            '</div>' +
1204            '<div class="cc-clear"></div>' +
1205            '<p id="cc-settingsmodal-closebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' +
1206            '<div id="cc-settingsmodal-footer-buttons">' +
1207            '<p id="cc-settingsmodal-secondclosebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' +
1208            '</div>' +
1209            '<a id="cc-notification-logo" class="cc-logo" target="_blank" href="http://silktide.com/cookieconsent" title="' + cc.strings.poweredBy + '"><span>' + cc.strings.poweredBy + '</span></a> ' +
1210            '</div>' +
1211            '</div>';
1212        jQuery('body').prepend(data);
1213        cc.reloadsettingsmodal();
1214        jQuery('#cc-settingsmodal').addClass(cc.settings.style).click(cc.closemodals);
1215        jQuery('#cc-settingsmodal-wrapper').click(function () {
1216            cc.noclosewin = true;
1217        });
1218        if (cc.ismobile) {
1219            jQuery('#cc-settingsmodal').addClass("cc-mobile");
1220        }
1221        jQuery('#cc-settingsmodal').fadeIn();
1222        jQuery('.cc-settingsmodal-closebutton').click(cc.closepreferencesmodal);
1223
1224        return false;
1225    },
1226
1227    setupformobile: function () {
1228        if (!cc.hassetupmobile) {
1229            cc.hassetupmobile = true;
1230            jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">');
1231            if (cc.settings.style == 'cc-light') {
1232                bgcol = '#e1e1e1';
1233            } else {
1234                bgcol = '#1d1d1d'
1235            }
1236            jQuery('body').html('').css("margin", 0).css('width', 'auto').css("backgroundColor", bgcol).css("backgroundImage", 'none');
1237        }
1238    },
1239
1240    onfirstload: function () {
1241        if (!cc.setupcomplete && cc.initobj) {
1242            if (!(window.jQuery)) {
1243                cc.jqueryattempts++;
1244                if (cc.jqueryattempts >= 5) {
1245                    return;
1246                }
1247                setTimeout(cc.onfirstload, 200);
1248                return;
1249            }
1250            cc.setupcomplete = true;
1251            cc.setup();
1252        }
1253        setTimeout(cc.afterload, 50);
1254        cc.checkapproval();
1255    },
1256
1257    afterload: function () {
1258        jQuery('.cc-button-enableall').addClass('cc-link').click(cc.onlocalconsentgiven);
1259        jQuery('.cc-button-enable-all').addClass('cc-link').click(cc.onlocalconsentgiven);
1260        jQuery.each(cc.cookies, function (key, value) {
1261            jQuery('.cc-button-enable-' + key).addClass('cc-link').click(cc.onlocalconsentgiven);
1262        });
1263    }
1264}
1265
1266if (!(window.jQuery)) {
1267    var s = document.createElement('script');
1268    s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
1269    s.setAttribute('type', 'text/javascript');
1270    document.getElementsByTagName('head')[0].appendChild(s);
1271    if (window.onload != null) {
1272        var oldOnload = window.onload;
1273        window.onload = function (e) {
1274            oldOnload(e);
1275            cc.onfirstload();
1276        };
1277    }
1278    else {
1279        window.onload = cc.onfirstload;
1280    }
1281} else {
1282    jQuery(document).ready(cc.onfirstload);
1283}
1284
1285/**
1286 * jQuery.browser.mobile (http://detectmobilebrowser.com/)
1287 *
1288 * jQuery.browser.mobile will be true if the browser is a mobile device - modified so that cc.ismobile is true
1289 *
1290 **/
1291(function (a) {
1292    cc.ismobile = false; // /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 )|
1292sy(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))
1293})(false && navigator.userAgent || navigator.vendor || window.opera);
1294
1295
1296/**
1297 * Load web font
1298 *
1299 **/
1300
1301WebFontConfig = {
1302    google: { families: [ 'Open+Sans:400,600:latin' ] }
1303};
1304(function () {
1305    var wf = document.createElement('script');
1306    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
1307        '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
1308    wf.type = 'text/javascript';
1309    wf.async = 'true';
1310    var s = document.getElementsByTagName('script')[0];
1311    s.parentNode.insertBefore(wf, s);
1312})();
1313
1314
1315/* START */
1316
1317cc.initialise({
1318    cookies: {
1319        social: {},
1320        analytics: {},
1321        advertising: {},
1322        necessary: {}
1323    },
1324    settings: {
1325        bannerPosition: "top",
1326        consenttype: "explicit",
1327        hideallsitebutton: true,
1328        refreshOnConsent: true,
1329        useSSL: true,
1330        disableallsites: true,
1331        hideprivacysettingstab: true,
1332        privacyPolicy: "/site/privacy",
1333        clickAnyLinkToConsent: false
1334    },
1335    strings: {
1336        privacyPolicy: "Informativa Privacy",
1337        notificationTitle: "<h3>Questo sito utilizza cookie, anche di terze parti, necessari al funzionamento ed utili a migliorare l'esperienza di navigazione.</h3><p>Tutti i cookie al momento sono bloccati, cliccando su ACCETTO ne acconsenti l’uso.</p><p>Per maggiori informazioni consulta la nostra Privacy policy.</p>",
1338        allowCookies: "Accetto"
1339    }
1340});

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.