function getWildcardDomain() { split = location.hostname.split('.') if(split.length >= 3) { return '; domain=.' + split[split.length - 2] + '.' + split[split.length - 1]; } return ''; } var lea_param_name = 'lea_source'; lea_param_name = lea_param_name.replace(/[\[]/, '\[').replace(/[\]]/, '\]'); var lea_regex = new RegExp('[\?&]' + lea_param_name + '=([^&#]*)'); if(lea_regex.exec(location.search) != null) { var lea_results = lea_regex.exec(location.search); } else { var lea_results = lea_regex.exec(location.hash); } var lea_sid = lea_results === null ? '' : decodeURIComponent(lea_results[1].replace(/\+/g, ' ')); var lea_param_name = 'lea_source'; var lea_cookie_name = lea_param_name var lea_cookie_name_cb = 'cb_' + lea_cookie_name; var lea_cookie_name_pv = lea_param_name + '_pv'; var lea_ca = document.cookie.split(';'); var lea_res = ''; var lea_res_cb = ''; var lea_res_cb_local_storage = ''; var lea_type = 0; try { if('1' == 1) { for(var i=0; i -1 ) { userbrowser = browsers[i]; break; } } if(userbrowser == 'Safari' || userbrowser == 'UCBrowser') { setSameSiteAttr = 0; } else if(userbrowser == 'Chrome') { var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); var version = raw ? parseInt(raw[2], 10) : false; if(version != false && version <= 66) { setSameSiteAttr = 0; } } if(lea_res == null) { lea_res = ''; } if(lea_sid.trim() != ''){ split = lea_sid.split('X'); te_sid = split[1]; te_wfid = te_sid.substr(0,6); te_prid = te_sid.substr(7,4); wm_art = te_sid.substr(17,1); te_klickzeit = split[0]; //there must be a click id to set the cookie if(te_klickzeit.trim() != '' && te_klickzeit.length >= 14){ var yyyy1 = te_klickzeit.substr(0,4); var mm1 = te_klickzeit.substr(4,2); var dd1 = te_klickzeit.substr(6,2); var hh1 = te_klickzeit.substr(8,2); var ss1 = te_klickzeit.substr(10,2); var msms1 = te_klickzeit.substr(12,2); var clickId = te_klickzeit.substr(14); if(userbrowser == 'Safari') { var cookie_set_date = new Date(yyyy1+'/'+mm1+'/'+dd1+' '+hh1+':'+ss1+':'+msms1).getTime(); } else { var cookie_set_date = new Date(yyyy1+'-'+mm1+'-'+dd1+'.'+hh1+':'+ss1+':'+msms1).getTime(); } //if there already exists lea_source cookie, check if date from cookie which will be set new is higher --> bookmark protection var res_klickzeit = ''; if(lea_res.trim() != ''){ if (lea_res.substr(0,1) == 'C' || lea_res.substr(0,1) == 'V') { res_klickzeit = lea_res.substr(2) } else { var split = lea_res.split('X'); te_res = split[1]; res_klickzeit = split[0]; } } var existing_cookie_date = ''; if (res_klickzeit.trim() != '' && res_klickzeit.length >= 14) { var yyyy = res_klickzeit.substr(0,4); var mm = res_klickzeit.substr(4,2); var dd = res_klickzeit.substr(6,2); if (lea_res.substr(0,1) == 'C' || lea_res.substr(0,1) == 'V') { var hh = '0'; var ss = '0'; var msms = '0'; } else { var hh = res_klickzeit.substr(8,2); var ss = res_klickzeit.substr(10,2); var msms = res_klickzeit.substr(12,2); } if(userbrowser == 'Safari') { var existing_cookie_date = new Date(yyyy+'/'+mm+'/'+dd+' '+hh+':'+ss+':'+msms).getTime(); } else { var existing_cookie_date = new Date(yyyy+'-'+mm+'-'+dd+'.'+hh+':'+ss+':'+msms).getTime(); } } // determine UNIX click/view timestamp --> protect cookie from future dates var actual_date = new Date().getTime(); if (existing_cookie_date != '' && existing_cookie_date > cookie_set_date || cookie_set_date > actual_date) { setcookie = 0; } if (setcookie == 1) { var lea_d = new Date(); if(te_sid[6] == 'C' || te_sid[6] == 'V' && 48 == 0){ var runtime = (720*60*60*1000); //special case EMP cookie runtime one and two day for certain adspaces if(te_prid == 1541) { if(te_wfid == 116338) { var runtime = (24*60*60*1000); } if(te_wfid == 118749) { var runtime = (48*60*60*1000); } } //meat4you 2 adspaces with certian runtimes in a certain time period if(te_prid == 1511) { if(te_wfid == 119059 && actual_date < new Date('2020/12/20 23:59:59:0000').getTime()) { var runtime = (120*60*60*1000) } if(te_wfid == 117203 && actual_date < new Date('2020/12/31 23:59:59:0000').getTime()) { var runtime = (168*60*60*1000) } } if(te_prid == 2469) { if(te_wfid == 124669 || te_wfid == 123269) { var runtime = (24*60*60*1000); } } } else{ var runtime = (48*60*60*1000); //special case EMP cookie runtime one and two days for certain adspaces if(te_prid == 1541) { if(te_wfid == 116338) { var runtime = (24*60*60*1000); } if(te_wfid == 118749) { var runtime = (48*60*60*1000); } } if(te_prid == 2469) { if(te_wfid == 124669 || te_wfid == 123269) { var runtime = (24*60*60*1000); } } } //timestamp of the cookie's expiry date var cookie_expires_date = cookie_set_date + runtime; //expiry date instance var cookie_expires_date_instance = new Date(cookie_expires_date); if(0 == 1) { lea_sid = te_sid[6] + wm_art + yyyy1 + mm1 + dd1 + clickId; } if(te_sid[6] == 'C' && 1 == 1){ // || te_sid[6] == 'V' && 48 != -1 && (lea_res.trim() == '' || te_res[6] != 'C' )){ //Safari version < 13 bug uses samesite none as samesite strict if(setSameSiteAttr == 1){ document.cookie = lea_cookie_name + '=' + lea_sid + '; expires=' + cookie_expires_date_instance + ';path=/' + getWildcardDomain() + ';SameSite=None ; Secure'; if(0 == 1) { document.cookie = lea_cookie_name_cb + '=' + lea_sid + '; expires=' + cookie_expires_date_instance + ';path=/' + getWildcardDomain() + ';SameSite=None ; Secure'; } } else { document.cookie = lea_cookie_name + '=' + lea_sid + '; expires=' + cookie_expires_date_instance + ';path=/' + getWildcardDomain(); if(0 == 1) { document.cookie = lea_cookie_name_cb + '=' + lea_sid + '; expires=' + cookie_expires_date_instance + ';path=/' + getWildcardDomain(); } } if(localStorage) { localStorage.setItem(lea_cookie_name, lea_sid); localStorage.setItem(lea_cookie_name + '_expires',cookie_expires_date); if(0 == 1) { localStorage.setItem(lea_cookie_name_cb, lea_sid); localStorage.setItem(lea_cookie_name_cb + '_expires',cookie_expires_date); } } } else if( te_sid[6] == 'V' && 1 == 1 ){ //Safari version < 13 bug uses samesite none as samesite strict if(setSameSiteAttr == 1){ document.cookie = lea_cookie_name_pv + '=' + lea_sid + '; expires=' + cookie_expires_date_instance + ';path=/' + getWildcardDomain() +'; SameSite=None ; Secure'; } else { document.cookie = lea_cookie_name_pv + '=' + lea_sid + '; expires=' + cookie_expires_date_instance + ';path=/' + getWildcardDomain(); } if(localStorage) { localStorage.setItem(lea_cookie_name_pv, lea_sid); localStorage.setItem(lea_cookie_name_pv + '_expires', cookie_expires_date); } } } } } if(lea_sid.trim() != ''){ split = lea_sid.split('X'); te_sid = split[1]; te_wfid = te_sid.substr(0,6); te_prid = te_sid.substr(7,4); wm_art = te_sid.substr(17,1); te_klickzeit = split[0]; var img1 = document.createElement('img'); img1.src = 'https' + '://affiliatego.manor.ch/tc.php?t='+ te_sid +'&redirect=false&sdtr=1&cons=1'; img1.width = 0; img1.height = 0; document.body.appendChild(img1); } var lea_test = '0' var prid = '2445' if (typeof __tcfapi !== 'undefined' && prid != 2469) { var tcstring = ''; //wait until the cmp gets accepted window.__tcfapi('addEventListener', 2, function(tcData, listenerSuccess) { if (listenerSuccess) { // check the eventstatus if (tcData.eventStatus === 'useractioncomplete' || tcData.eventStatus === 'tcloaded') { tcString = tcData.tcString playoutPixels(tcstring); } } }); } else { playoutPixels(''); } function determineAdroxAssignedParameter() { var wfid = '' if(lea_res.trim() != '') { split = lea_res.split('X'); sid = split[1]; wfid = sid.substr(0,6); } if (wfid == '117173') { if(sid[6] == 'V') { return '2'; } else { return '1'; } } else { return '0'; } } function playoutPixels(tcstring) { var prid = '2445' var adroxParameter = 0; if(prid == 1937 && typeof(lea_res) != 'undefined'){ adroxParameter = determineAdroxAssignedParameter(); } if(lea_test == 1) { var lea_textarea = document.getElementById('lea_textarea'); lea_textarea.value += '***********************PageView********************************\n' } var lea_pixels = ''; var lea_element = ""; var consentCheck = "0"; var gdpr = "0"; var gdpr_trg = "-1"; var lea_element = lea_element.replace('gdpr_is_tcf_trg', gdpr_trg); lea_element = lea_element.replace('gdpr_is_tcf', gdpr); if(tcstring.trim() != '') { lea_element = lea_element.replace('gdpr_lea_consentstring', tcstring); lea_element = lea_element.replace('gdpr_lea_consentstring_fallback_zero', tcstring); } else { lea_element = lea_element.replace('gdpr_lea_consentstring', ''); lea_element = lea_element.replace('gdpr_lea_consentstring_fallback_zero', '0'); } if (lea_element.indexOf('la_adroxSale') !== -1) { lea_element = lea_element.replace('la_adroxSale', adroxParameter); } if(lea_test == 1) { lea_textarea.value += '\n\n'; lea_textarea.value += lea_element+'\n\n\n'; } else { lea_pixels += lea_element; } if(lea_test != 1) { random = Math.random()*100000000000000000 var lea_iframe = document.createElement('iframe'); lea_iframe.id="lila"+random; lea_iframe.marginwidth = '0'; lea_iframe.marginheight = '0'; lea_iframe.width = '1'; lea_iframe.height = '1'; lea_iframe.vspace = 0; lea_iframe.hspace = 0; lea_iframe.allowTransparency = true; lea_iframe.frameborder = '0'; lea_iframe.style.display = 'none'; document.body.appendChild(lea_iframe); if (typeof leaDeleteArray === 'undefined') { leaDeleteArray = []; } try{ lea_iframe.contentWindow.document.open(); lea_iframe.contentWindow.document.write(""+lea_pixels+""); lea_iframe.contentWindow.document.close(); } catch(e) {} } var lea_element = "try{ var bly_script=new URL('https://manor.rt.bly.ch/'); bly_script.searchParams.append('place', 1); bly_script.searchParams.append('cachebooster', Math.random()); bly_script.searchParams.append('sourceURL', window.location.href); bly_script.toString(); var bly_rt_script = document.createElement(\"script\"); bly_rt_script.type=\"text/javascript\"; bly_rt_script.src=bly_script; bly_rt_script.async=\"true\"; document.body.appendChild(bly_rt_script);} catch(e){} "; if(lea_test == 1) { lea_textarea.value += '\n\n'; lea_textarea.value += lea_element+'\n\n\n'; } else { try{ var bly_script=new URL('https://manor.rt.bly.ch/'); bly_script.searchParams.append('place', 1); bly_script.searchParams.append('cachebooster', Math.random()); bly_script.searchParams.append('sourceURL', window.location.href); bly_script.toString(); var bly_rt_script = document.createElement("script"); bly_rt_script.type="text/javascript"; bly_rt_script.src=bly_script; bly_rt_script.async="true"; document.body.appendChild(bly_rt_script);} catch(e){} } }