var _popup; var _script_initialized = false; window.addEventListener("load", function(){ if(navigator.userAgent.indexOf('MSIE')!==-1 || navigator.appVersion.indexOf('Trident/') > -1) { var c = document.createElement("link"); c.rel = "stylesheet"; c.type = "text/css"; c.href = "js/cookies/msiefix.css"; document.body.appendChild(c); } window.cookieconsent.initialise({ "palette": { "popup": { "background": _cookie_settings.popupbg }, "button": { "background": _cookie_settings.buttonbg, "text": _cookie_settings.buttonfb } }, "position": _cookie_settings.position, "type": "opt-in", "content": _cookie_settings.content, "revokable": false, "law": { "regionalLaw": false, "countryCode": null }, onInitialise: function (status) { _script_initialized = true; var type = this.options.type; var didConsent = this.hasConsented(); if (type == 'opt-in' && didConsent) { // enable cookies if(status == "allow") { acceptCookies(); _cookie_settings.cookies_enabled = true; } else { denieCookies(false); _cookie_settings.cookies_enabled = false; } } if (!didConsent) { // disable cookies _cookie_settings.cookies_enabled = false; } }, onStatusChange: function(status, chosenBefore) { _script_initialized = true; var type = this.options.type; var didConsent = this.hasConsented(); if (didConsent) { if(status == "allow") { acceptCookies(); _cookie_settings.cookies_enabled = true; } else { denieCookies(false); _cookie_settings.cookies_enabled = false; } } else { denieCookies(true); _cookie_settings.cookies_enabled = false; } }, onRevokeChoice: function() { var type = this; } }, function(popup){ try { popup.revokeBtn.remove(); } catch(err){ } _popup = popup; //Denie cookies at default if(!_script_initialized) denieCookies(); }); }); function acceptCookies() { $('.privacyedit').html(""+ _cookie_settings.privacy_edit +""); c_head(); c_body(); } function denieCookies(refresh) { $('.privacyedit').html(""+ _cookie_settings.privacy_edit +""); if (document.cookie != "") { crumbs = document.cookie.split(";"); for(i=0; i < crumbs.length; i++) { nameval = crumbs[i].split("="); identify = nameval[0]; while(identify != identify.replace(' ', '')) identify = identify.replace(' ', ''); if(identify != "PHPSESSID" && identify != "cookieconsent_status") { clearCookie(nameval[0]); } } } if(refresh) { document.location.href = document.location.href; } else { nc_head(); nc_body(); } } function clearCookie(name, domain, path){ var domain = domain || ''; var path = path || '/'; cookieval = name + "=; expires=Thu, 01-Jan-1970 00:00:01 GMT;"; if(domain != '') cookieval += " domain=" + domain+';'; if(path != '') cookieval += " path=" + path+';'; document.cookie = cookieval; //Space fix while(name != name.replace(' ', '')) name = name.replace(' ', ''); cookieval = name + "=; expires=Thu, 01-Jan-1970 00:00:01 GMT;"; if(domain != '') cookieval += " domain=" + domain+';'; if(path != '') cookieval += " path=" + path+';'; document.cookie = cookieval; }; function editCookieSettings() { _popup.revokeChoice(); _popup.element.remove(); window.cookieconsent.initialise({ "palette": { "popup": { "background": _cookie_settings.popupbg }, "button": { "background": _cookie_settings.buttonbg, "text": _cookie_settings.buttonfb } }, "position": _cookie_settings.position, "type": "opt-in", onStatusChange: function(status, chosenBefore) { var type = this.options.type; var didConsent = this.hasConsented(); if (didConsent) { if(status == "allow") { _cookie_settings.cookies_enabled = true; document.location.href = document.location.href; } else { denieCookies(true); _cookie_settings.cookies_enabled = false; } } }, }, function(popup){ try { popup.revokeBtn.remove(); } catch(err){ } _popup = popup; }); } function tagDecode(src) { var output = src; while(output != output.replace('[&]', '')) output = output.replace('[&]', '&'); while(output != output.replace('[<]', '')) output = output.replace('[<]', '<'); while(output != output.replace('[>]', '')) output = output.replace('[>]', '>'); return output; }