function tcfApiFrameLocator(){ try{ return !!window.top.__tcfapiLocator; }catch(e){ return false; } } function hbCheckAccessToTop(){ logDebug('hbCheckAccessToTop'); var access = 1; if(window.top != window.self){ try{ window.top.document.body.appendChild(window.top.document.createElement('div')); }catch(e){ access = 0; } }else{ access = 2; } logDebug('hbCheckAccessToTop res2',access); return access; } if(true){ var bscr = document.createElement('script'); bscr.innerHTML = "var isMobile = {};try{ isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function() { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function() { return navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i); }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); } }; }catch(e){ console.log(e); }try{ initialLog('57478'); var visiblePart = 10; var ourips = '0'; var justEtarget = parseInt('0'); var customWidth = 0; var autoClose = parseInt('0'); var hbparent = (''.length>0 ? document.getElementById('') : _et_findmyself()); var refcode = 'etarget-id-57478'; if(typeof(window.globalfallback)=='undefined'){ window.globalfallback = []; } if(typeof(window.globaladsense)=='undefined'){ window.globaladsense = []; } if(typeof(window.globalFallbackRate)=='undefined'){ window.globalFallbackRate = []; } if(typeof(window.globalFallbackPrice)=='undefined'){ window.globalFallbackPrice = []; } if(typeof(window.globalNoadx)=='undefined'){ window.globalNoadx = []; } if(typeof(window.globalFallbackSlotID)=='undefined'){ window.globalFallbackSlotID = []; } if(typeof(window.globalFallbackPubID)=='undefined'){ window.globalFallbackPubID = []; } if(typeof(window.globalFallbackPrcEtarget)=='undefined'){ window.globalFallbackPrcEtarget = []; } if(typeof(window.globalFallbackPrcAdsense)=='undefined'){ window.globalFallbackPrcAdsense = []; } window.globalfallback['57478'] = ''; window.globaladsense['57478'] = ''; window.globalFallbackPubID['57478'] = '-1'; window.globalFallbackSlotID['57478'] = '0.1:6001890671;0.2:8502631299;0.3:8000837773;0.4:5704685742;0.5:8823631224;0.7:5309300439;0.8:2491047001;0.9:3454857563;1:8561504098;1.5:6972994042;2:7902924103;4:3889833206'; window.globalFallbackRate['57478'] = '0'; window.globalFallbackPrice['57478'] = '0.1'; window.globalFallbackPrcEtarget['57478'] = '0'; window.globalFallbackPrcAdsense['57478'] = '0'; window.globalNoadx['57478'] = 'noadx'; window.hbFindCookieIfLoadedTCFCNT = 0; if(typeof(window.self.initialLoad)=='undefined'){ window.self.initialLoad = 0; } logDebug('fallback',window.globalfallback); window.self.initialLoad += 1; var native = '57819,57847,48800'; native = native.split(','); if(typeof(window.styling)=='undefined'){ window.styling = {}; } var refstyling = {}; refstyling.font = ''.length>0 ? '' : 'arial'; refstyling.fsi = ''.length>0 ? 'px' : '18px'; refstyling.bg = ''.length>0 ? (''=='transparent' ? 'transparent' : '#') : 'transparent'; refstyling.title = { color:''.length>0 ? '#' : 'black', hcolor:''.length>0 ? '#' : 'black' }; refstyling.text = { color:''.length>0 ? '#' : 'black', hcolor:''.length>0 ? '#' : 'black' }; refstyling.link = { color:''.length>0 ? '#' : 'black', hcolor:''.length>0 ? '#' : 'black', underline:parseInt('0')>0 ? 1 : 0 }; window.styling['57478'] = refstyling; if(typeof(dataParsed)=='undefined'){ var dataParsed = false; } if(typeof(iframeAdded)=='undefined'){ var iframeAdded = []; } if('0'=='1'){ customWidth = hbparent.clientWidth; logDebug('EHB:(57478) flexi width',customWidth,hbparent); } var wh = _et_checkWidthHeightDocument('300','600'); var width = wh[0]; var height = wh[1]; addSuperOptions(hbparent); setGlobalVals(refcode,'hbparent',hbparent);var datas = [];var bidders = []; var addit_sizes = ''; if(addit_sizes.length>5){ addit_sizes = addit_sizes.split(','); } var logos = []; logos.etarget = ''; logos.pulsepoint = 1; logos.rubicon = 2; logos.appnexus = 3; logos.google = 4; logos.etargetppc = 5; var isVisible = visibleArea(hbparent); logDebug('EHB sizex','300600'); if('300600'!='1010'){ /*new HB*/ var etargetbids = {bidder:'etarget',params:{refid:57478,country:1}}; if(isVisible===1){ etargetbids.params.position = 'atf'; } bidders.push(etargetbids); } if(!justEtarget){ if(''.length>0 && ''.length>0 && parseInt('0')===0){ var teadsbids = {bidder:'teads',params:{pageId:'',placementId:''}}; bidders.push(teadsbids); } if('16230286'.length>0 && parseInt('0')===0){ var appnbids = {bidder:'appnexus',params:{placementId:'16230286',video:{skippable:true,playback_method:['auto_play_sound_off']}}}; if(isVisible===1){ appnbids.params.position = 'atf'; } bidders.push(appnbids); } if(''.length>0){ var adfnbids = {bidder:'adform',params:{mid:''}}; if(isVisible===1){ adfnbids.params.position = 'atf'; } bidders.push(adfnbids); } if(''.length>0 && parseInt('0')===0){ var pulsbids = {bidder:'pulsepoint',params:{cf:'',cp:'',ct:''}}; if(isVisible===1){ pulsbids.params.position = 'atf'; } bidders.push(pulsbids); } if(''.length>0 && parseInt('0')===0){ var rubibids = {bidder:'rubicon',params:{accountId:'',siteId:'',zoneId:'',sizes:[]}}; if(isVisible===1){ rubibids.params.position = 'atf'; } bidders.push(rubibids); } }try{ window.addEventListener('message', receiveMessage, false); parent.addEventListener('message', receiveMessage, false);top.addEventListener('message', receiveMessage, false);}catch(e){logDebug('message',e);} window.addEventListener('scroll', checkAfterScroll, false);if(typeof(top.postMessage)!='function'){logDebug('EHB:(57478) !!! NEVIEME SA DOSTAT DO postMessage !!!');window.globalNoadx[57478] = 'noadx';} logDebug('EHB:(57478) slotID:');logDebug('EHB:(57478) bidders',bidders);var codeID = 'code_'+'57478'+'_'+'300x600'+'_'+parseInt(Math.random()*1000);var PREBID_TIMEOUT = 700; var sizes = []; if(addit_sizes.length>0){ for(var k in addit_sizes){ if(typeof(addit_sizes[k])=='string'){ var sa = addit_sizes[k].split('x'); var sw = sa[0]; var sh = sa[1]; if(sw && sh){ var ho = [parseInt(sw),parseInt(sh)]; if(sizes.indexOf(ho)==-1){ sizes.push(ho); } } } } }else{ sizes.push([parseInt(width),parseInt(height)]); } logDebug('EHB:(57478) sizes',addit_sizes,sizes); var mediatypes = {'banner':{'sizes':sizes}}; if(native.indexOf('57478')>=0 || true){ mediatypes.native = { title: { required: true, sendId: true }, body: { required: true, sendId: true }, clickUrl: { sendId: true } }; try{ ajaxcallX('https://sk.search.etargetnet.com/ajax/partner_counter.php?type=request&category=native&ref=57478'); }catch(e){ console.log(e); } } if(typeof(teadsbids)!='undefined'){ mediatypes.video = { context: 'outstream', playerSize: [[parseInt(width),parseInt(height)]] } } logDebug('EHB: mediatypes',mediatypes); var bidobj = { code: codeID, sizes: sizes, bids: bidders, mediaTypes: mediatypes }; if(typeof(window.self.adUnits)=='object'){ window.self.adUnits.push(bidobj); logDebug('EHB:(57478) updateUnit',bidobj); }else{ window.self.adUnits = [bidobj]; logDebug('EHB:(57478) insertUnit',bidobj); } if(window.self.initialLoad<2){ window.self.pbjs = window.self.pbjs || {}; window.self.pbjs.que = window.self.pbjs.que || []; window.self.pbjs.logging = true; window.self.googletag = window.self.googletag || {}; window.self.googletag.cmd = window.self.googletag.cmd || []; window.self.googletag.cmd.push(function() { window.self.googletag.pubads().disableInitialLoad(); }); } if(window.self.loadInt){ clearTimeout(window.self.loadInt); window.self.loadInt = false; }; logDebug('EHB:(57478) tryTimeout start'); window.self.loadInt = setTimeout(function(){ logDebug('EHB:(57478) tryTimeout inside'); executeHBJS(); },1000);}catch(e){console.error(e);}function initialLog(refid){ var data = '[]'; var pos = 'btf'; var winner = 'init'; var url = 'https://sk.search.etargetnet.com/generic/header_bidding_log.php?ref='+refid+'&position='+pos+'&data='+data+'&referer='+refid+'&winner='+winner; ajaxcallX(url,function(e){logDebug('EHB:('+refid+') success',url);},true);}function setGlobalVals(refcode,name,val){ if(typeof(window.__ethbGlobalVals)=='undefined'){ window.__ethbGlobalVals = []; } if(typeof(window.__ethbGlobalVals[refcode])=='undefined'){ window.__ethbGlobalVals[refcode] = []; } window.__ethbGlobalVals[refcode][name] = val;}function getGlobalVals(refcode,name){ if(typeof(window.__ethbGlobalVals)!='object'){ return false; } if(typeof(window.__ethbGlobalVals[refcode])!='object'){ return false; } return window.__ethbGlobalVals[refcode][name];}if(typeof(window.__et__tcfapiLoaded)=='undefined'){ window.__et__tcfapiLoaded = 0;}function executeHBJS(){ logDebug('EHB:(57478) before dataParsed',dataParsed); if(!dataParsed){ dataParsed = true; logDebug('EHB:(57478) after dataParsed',typeof(__tcfapi)); if(typeof(__tcfapi)=='function'){ __tcfapi('addEventListener',2,function(a,b){ var status = a.eventStatus; if(status=='tcloaded' || status=='useractioncomplete'){ if (typeof(a.listenerId) != 'undefined') { __tcfapi('removeEventListener', 2, function() { if(false){ console.log('%c __tcfapi %c event %c remove ','background:gray;color:white','background:#4e0060;color:white','background:#fffa0c;color:black'); } }, a.listenerId); } logDebug('EHB:(57478) TCF after event',a,b); logDebug('EHB:(57478) TCF after timeout'); pbjs.que.push(function() { pbjs.setConfig({ consentManagement: { gdpr: { cmpApi: 'iab', timeout: 2000 }, usp: { cmpApi: 'iab', timeout: 1000 } } }); pbjs.addAdUnits(adUnits); pbjs.requestBids({ timeout: 1500, bidsBackHandler: function(e,n){ parseDataAndReturnNew(e,n); parseDataAndReturnX(e,n); } }); }); } }); }else{ var tafl = tcfApiFrameLocator();/*can access TCF iframe, STUB will handle it*/ logDebug('EHB:(57478) TCF no event',tafl); if(tafl){ if(!window.self.__et__tcfapiLoaded){ var ts = parseInt(Math.random()*1000000); var date = new Date(); ts = date.getYear()+''+date.getMonth()+''+date.getDate(); var scrpt = document.createElement('script'); scrpt.src = 'https://etarget.mgr.consensu.org/gdpr/tcfv2/stub-babel.js?t='+ts; scrpt.async = true; window.self.document.body.appendChild(scrpt); } window.self.__et__tcfapiLoaded = 1; hbFindCookieIfLoadedTCF(1); }else{ if(hbCheckAccessToTop()){ if(!window.self.__et__tcfapiLoaded){ var ts = parseInt(Math.random()*1000000); var date = new Date(); ts = date.getYear()+''+date.getMonth()+''+date.getDate(); var scrpt = document.createElement('script'); scrpt.src = 'https://etarget.mgr.consensu.org/gdpr/gdpr.js.php?ecmp=3&apionly=1&t='+ts; scrpt.async = true; window.self.document.body.appendChild(scrpt); } window.self.__et__tcfapiLoaded = 1; hbFindCookieIfLoadedTCF(2); }else{ var consent = hbFindCookie(true); logDebug('EHB:(57478) TCF after timeout 2'); pbjs.que.push(function() { pbjs.setConfig({ consentManagement: { gdpr: { cmpApi: 'static', consentData: { getTCData: { tcString: ''+consent+'', timeout: 2000, gdprApplies: true } } }, usp: { cmpApi: 'iab', timeout: 1000 } } }); pbjs.addAdUnits(adUnits); pbjs.requestBids({ timeout: 1500, bidsBackHandler: function(e,n){ parseDataAndReturnNew(e,n); parseDataAndReturnX(e,n); } }); }); } } } }}function hbFindCookieIfLoadedTCF(num){ logDebug('EHB:(57478) hbFindCookieIfLoadedTCF '+num,window.hbFindCookieIfLoadedTCFCNT); window.hbFindCookieIfLoadedTCFCNT++; try{ if(num==2){/*num==1 is just STUB*/ __tcfapi('addEventListener',2,function(a,b){ console.log('try pass __tcfapi'); }); } hbFindCookie(); }catch(e){ if(window.hbFindCookieIfLoadedTCFCNT<20){ setTimeout(function(){ hbFindCookieIfLoadedTCF(num); },10); }else{ hbFindCookie(); } }}function hbGetCookie(name) { var match = false; if(hbCheckAccessToTop()){ logDebug('match TOP'); match = window.top.document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); } if(!match){ logDebug('match SELF'); match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); } logDebug('match RES',match); if (match) return match[2];}var hbFindCookieInit = false;function hbFindCookie(justret){ var consent = hbGetCookie('euconsent-v2'); logDebug('EHB:(57478) hbFindCookie',consent); if(consent){ if(justret){ return consent; } _et_addConsentToHB(); }else{ var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState === 4){ if(typeof(xhr.responseText)=='string'){ if(xhr.responseText.length>10 && !hbFindCookieInit){ hbFindCookieInit = true; var d = new Date(); d.setTime(d.getTime() + (365*24*60*60*1000)); var expires = 'expires='+ d.toUTCString(); document.cookie = 'euconsent-v2='+xhr.responseText+'; '+expires+'; path=/'; if(hbCheckAccessToTop()){ window.top.document.cookie = 'euconsent-v2='+xhr.responseText+'; '+expires+'; path=/'; } if(justret){ return xhr.responseText; } _et_addConsentToHB(); } } } }; xhr.open('GET', 'https://etarget.mgr.consensu.org/consent.php?findCookie=1&cookieName=euconsent-v2'); xhr.withCredentials = true; xhr.send(); setTimeout(function(){ if(!hbFindCookieInit){ if(typeof(xhr)!='undefined'){ xhr.abort(); } hbFindCookieInit = true; _et_addConsentToHB(); } },500); }}function _et_addConsentToHB(){ window.adUnitsAdded = setTimeout(function(){ pbjs.que.push(function() { pbjs.setConfig({ consentManagement: { gdpr: { cmpApi: 'iab', timeout: 2000 }, usp: { cmpApi: 'iab', timeout: 1000 } } }); pbjs.addAdUnits(adUnits); pbjs.requestBids({ timeout: 1500, bidsBackHandler: function(e,n){ parseDataAndReturnNew(e,n); parseDataAndReturnX(e,n); } }); }); },1000);}function _et_findmyself(){ var parent = document.getElementById('etarget-id-57478') || document.querySelectorAll('[data-etarget-id=etarget-id-57478]')[0]; if(typeof(parent)=='undefined'){ var url = 'http://sk.search.etargetnet.com/generic/header_bidding.php?ref=57478'; var scripts = document.getElementsByTagName('script'); for(var k in scripts){ var script = scripts[k]; if(typeof(script)=='object'){ if(typeof(script.src)!='undefined'){ var src = script.src; if(src==url){ var div = document.createElement('div'); div.id = 'etarget-id-57478'; script.parentNode.insertBefore(div,script); parent = div; break; } } } } } return parent;} function _et_checkWidthHeightDocument(width,height){ var mobile_size = ''; if(mobile_size.indexOf('x')>1){ var mobile_sizes = mobile_size.split('x'); var dw = window.innerWidth; if(dw && dw<=480){ width = mobile_sizes[0]; height = mobile_sizes[1]; } }else if(''=='fixed'){ var dw = window.innerWidth; if(dw && dw<=480){ width = '320'; height = '50'; } } return [width,height]; }function addSuperOptions(parent){ var close = ''; var fixed_position = ''; var fixed_top = ''; var fixed_right = ''; var fixed_bottom = ''; var fixed_left = ''; if(fixed_position!='fixed' && fixed_position.length>0){ setTimeout(function(){ parent.parentNode.style.position = 'fixed'; var closediv = document.getElementsByClassName('close_hb'); if(typeof(closediv)=='object' && closediv!==null && closediv.length>0){ closediv[0].style.display = 'block'; } },5000); } logDebug('EHB:(57478) ','addSuperOptions', parent, fixed_position, fixed_top, fixed_right, fixed_bottom, fixed_left); var closablecss = ''; var leftclose = ''; var topclose = ''; if(fixed_position.length>0){ parent.parentNode.style.position = fixed_position; parent.parentNode.style.zIndex = 9999999; parent.parentNode.style.backgroundColor = 'white'; if(fixed_top.length>0){ parent.parentNode.style.top = fixed_top; closablecss += 'bottom:-10px;'; topclose = 'top'; } if(fixed_right.length>0){ parent.parentNode.style.right = fixed_right; closablecss += 'left:-10px;'; leftclose = 'right'; } if(fixed_bottom.length>0){ parent.parentNode.style.bottom = fixed_bottom; closablecss += 'top:-10px;'; topclose = 'bottom'; } if(fixed_left.length>0){ parent.parentNode.style.left = fixed_left; closablecss += 'right:-10px;'; leftclose = 'left'; } } var arrow = 'arrow-'+topclose+'-'+leftclose; if(close.length>0){ if(!closablecss){ closablecss = 'top:-10px;right:-10px;'; } var closediv = document.createElement('div'); closediv.className = 'close_hb'; var origcss = 'cursor:pointer;background-image:url(//sk.search.etargetnet.com/img/close_icon.png);background-position:center;background-size:cover;width:20px;height:20px;position:absolute;z-index:9999999;'+closablecss; var additcss = ''; if(fixed_position!='fixed'){ additcss = ';display:none;'; } closediv.style.cssText = origcss+additcss; parent.parentNode.appendChild(closediv); parent.style.overflow = 'hidden'; closediv.addEventListener('click',function(){ if(this.parentNode.clientWidth==0){ parent.style.maxWidth = '100%'; parent.style.maxHeight = '100%'; closediv.style.cssText = origcss; }else{ parent.style.maxWidth = '0px'; parent.style.maxHeight = '0px'; var newcss = origcss.replace('close_icon',arrow).replace(/-10/g,'-20'); closediv.style.cssText = newcss; } }); }} var receivedMessages = [];function receiveMessage(event,m){ try{ if(event){ if(typeof(event.data)=='string'){ if(event.data.indexOf('pouzi_winbid')>=0){ var hash = btoa(event.data); if(receivedMessages.indexOf(hash)==-1){ var refid = (event.data.split('_'))[2]; logDebug('EHB:(57478) winbid_message',event); winbid_show(1,refid); receivedMessages.push(hash); return true; } return false; } } if(typeof(event.data)!='undefined'){ var json = event.data; if(typeof(json)=='string' && json.indexOf('__tcfapiReturn')>0){ json = JSON.parse(event.data); } if(typeof(json)=='object' && typeof(json.__tcfapiReturn)=='object'){ var payload = json.__tcfapiReturn; } } } }catch(e){ console.log(e); }}function parseDataAndReturnNew(e,n){ logDebug('EHB:(uni) parseDataAndReturnNew:',pbjs,e,n); var byMaxCmp = pbjs.getHighestCpmBids(); var allWinningBids = pbjs.getAllPrebidWinningBids(); logDebug('byMaxCmp',byMaxCmp,allWinningBids,e); if(typeof(window.hb)=='undefined'){ window.hb = []; } if(byMaxCmp.length===0){ var ecnt = 0; for(var k in e){ var refid = k.split('_')[1]; if(!refid) continue; var refsize = k.split('_')[2].split('x'); var refcode = 'etarget-id-'+refid; var hbparent = getParentFromRef(refcode,hbparent); var objs = content_div(refid,refsize[0],refsize[1],refcode,hbparent); var div = objs[0]; var iframe = objs[1]; var newhb = []; newhb.data = false; newhb.raw = false; newhb.id = refid; newhb.refid = refcode; newhb.iframe = iframe; newhb.div = div; newhb.fallback = ''; if(typeof(window.globalfallback)=='object'){ if(window.globalfallback[refid]){ newhb.fallback = window.globalfallback[refid]; } } if(typeof(window.globaladsense)=='object'){ if(window.globaladsense[refid]){ newhb.adsense = window.globaladsense[refid]; } } newhb.size = [refsize[0],refsize[1]]; logDebug('EHB:(uni) setData:',k,newhb,refsize); setData(refid,newhb); before_win(refid,false,refsize[0],refsize[1],iframe,div); ecnt+=1; } logDebug('ecnt2',ecnt); if(ecnt===0){ logDebug('nodata','57478','300x600'); var refid = '57478'; var refcode = 'etarget-id-'+refid; var hbparent = getParentFromRef(refcode,hbparent); var refsize = '300x600'.split('x'); logDebug('nodata parent',refid,hbparent); var objs = content_div(refid,10,10,refcode,hbparent); var div = objs[0]; var iframe = objs[1]; var cena = 0; var newhb = []; newhb.data = false; newhb.raw = false; newhb.id = refid; newhb.refid = refcode; newhb.iframe = iframe; newhb.div = div; newhb.fallback = ''; newhb.size = [refsize[0],refsize[1]]; logDebug('nodata objs',objs,newhb); if(newhb.fallback.length>100 && newhb.fallback.indexOf('adsense')>0){ if(typeof(window.hbgoogle)=='undefined'){ window.hbgoogle = []; } adxcpm = 0; if(window.globalFallbackPrice[refid]){ adxcpm = window.globalFallbackPrice[refid]; } window.hbgoogle.push({'code':'adx_'+refid, 'cpm':adxcpm}); if(true){ if(adsuse && cena0 && customWidth>divw){ divw = customWidth; } var objs = content_div(refid,divw,bid.height,refcode,hbparent,bid.adUnitCode); var div = objs[0]; var iframe = objs[1]; var newhb = []; newhb.data = data; newhb.raw = bid; newhb.id = refid; newhb.refid = refcode; newhb.iframe = iframe; newhb.div = div; newhb.fallback = ''; if(typeof(window.globalfallback)=='object'){ if(window.globalfallback[refid]){ newhb.fallback = window.globalfallback[refid]; } } if(typeof(window.globaladsense)=='object'){ if(window.globaladsense[refid]){ newhb.adsense = window.globaladsense[refid]; } } newhb.size = [bid.width,bid.height]; logDebug('EHB:(uni) setData:',newhb); if(typeof(window.hb)=='undefined'){ window.hb = []; } logDebug('EHB:(uni) HBData:',window.hb); logDebug('EHB:(uni) global:',window.globalFallbackPrice[refid],window.globalFallbackRate[refid]); if(reason=='last chance'){ var adsuse = true; if(window.globalFallbackRate[refid]>0){ var grand = parseInt(Math.random()*100); logDebug('EHB:(uni) global2:',grand,window.globalFallbackRate[refid]); if(grand>parseInt(window.globalFallbackRate[refid])){ adsuse = false; } } window.globalNoadx[refid] = 'noadx'; if(newhb.fallback.length>100 && newhb.fallback.indexOf('adsense')>0){ if(typeof(window.hbgoogle)=='undefined'){ window.hbgoogle = []; } adxcpm = 0; if(window.globalFallbackPrice[refid]){ adxcpm = window.globalFallbackPrice[refid]; } window.hbgoogle.push({'code':'adx_'+refid, 'cpm':adxcpm}); if(adsuse && cena0){ var rand = Math.random()*sum; logDebug('adxPRC3',rand); if(rand<=parseInt(globalFallbackPrcEtarget[refid])){ window.globalNoadx[refid] = 'noadx'; }else{ window.globalNoadx[refid] = ''; } } } } setData(refid,newhb); before_win(refid,data,bid.width,bid.height,iframe); forcnt++; } } }}function content_div(refid,divw,divh,refcode,hbparent,id){ if(divw+'x'+divh=='10x10'){ divw = 'auto'; divh = 'auto'; }else{ divw = divw+'px'; divh = divh+'px'; } var div = document.createElement('div'); var rand = parseInt(Math.random()*10000); div.className = '_et_hb_cont contdiv _et_rand'+rand; if(id){ div.id = id; } div.style = 'width:'+divw+';height:'+divh+';border:none;position:relative;text-align:center;margin:0px auto;'; var footer = document.createElement('div'); footer.style = 'position:absolute;bottom:0px;right:0px;'; footer.innerHTML = '
'.replace('#REFID#',refcode); footer.setAttribute('data-ref-id',refid); div.appendChild(footer); var iframe = document.createElement('iframe'); iframe.style = 'width:'+divw+'px;height:'+divh+'px;border:none;margin:0px;'; iframe.id = 'etarget_hb_'+refid; iframe.name = 'etarget_hb_'+refid; iframe.scrolling = 'no'; div.appendChild(iframe); hbparent.appendChild(div); return [div,iframe]; }function before_win(refid,data,width,height,iframe,div){ logDebug('EHB:('+refid+') noadx2', window.globalNoadx[refid], !window.globalNoadx[refid], window.globalNoadx[refid].length==0,2,window.hbresponse); if(!window.globalNoadx[refid] || window.globalNoadx[refid].length==0){ var ni = iframe.contentWindow.document; var adx_string = ('').replace('#REFID#',refid).replace(/#WIDTH#/g,width).replace(/#HEIGHT#/g,height); logDebug('EHB:('+refid+') adx_string2',adx,adx_string,adx_string=='adsense',window.globaladsense[refid]); if(window.globaladsense[refid]=='adsense'){ try{ showADXFromScript(refid,div); winnerPost('google',refid); }catch(e){ console.log('err',refid,e); } }else{ var adx = chooseADX(data); logDebug('EHB:('+refid+') iframe:', iframe, ni, adx); if(adx){ var adx_slot = adx.id; adx_string = adx_string.replace('#SLOTID#',adx_slot); logDebug('EHB:('+refid+') adx_string',adx_string); ni.open('text/html', 'replace'); ni.write(adx_string); ni.close(); winnerPost('google',refid); }else{ winbid_show(2,refid); } } }else{ winbid_show(3,refid); }}function showADXFromScript(refid,div){ logDebug(refid,'showADXFromScript',!!document.getElementById('google_ads_iframe_/77283581/Large_Leaderboard_0')); (function() { if(!!document.getElementById('google_ads_iframe_/77283581/Large_Leaderboard_0')){ var myself = getGlobalVals('etarget-id-'+refid,'hbparent'); const eleReplace = myself; eleReplace.parentNode.removeChild(eleReplace); }else{ var pubID = window.globalFallbackPubID[refid]; if(pubID.indexOf('ca-pub')===-1){ pubID = 'ca-pub-'+pubID; } var slotID = window.globalFallbackSlotID[refid]; logDebug('EHB:('+refid+')','showAdxFromScript2',pubID,slotID); var myself = getGlobalVals('etarget-id-'+refid,'hbparent'); logDebug('EHB:('+refid+')','myself',myself); const gFallback = document.createElement('div'); gFallback.className = 'container ads'; const first = document.createElement('script'); first.async = true; first.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'; gFallback.appendChild(first); const ins = document.createElement('ins'); ins.className = 'adsbygoogle'; ins.style.cssText = 'display:block;margin-bottom:12px;'; ins.setAttribute('data-ad-name', 'adx'); ins.setAttribute('data-ad-client', pubID); ins.setAttribute('data-ad-slot', slotID); ins.setAttribute('data-ad-format', 'auto'); ins.setAttribute('data-full-width-responsive', 'true'); gFallback.appendChild(ins); const second = document.createElement('script'); const secondCode = '(adsbygoogle = window.adsbygoogle || []).push({});'; second.appendChild(document.createTextNode(secondCode)); gFallback.appendChild(second); const eleReplace = myself; eleReplace.parentNode.insertBefore(gFallback, eleReplace.nextSibling); eleReplace.parentNode.removeChild(eleReplace); } })();}function parseDataAndReturnX(e,n){ if(typeof(window.ehb_parsing)=='undefined'){ window.ehb_parsing = true; }else{ return true; } logDebug('EHB:(uni) parseDataAndReturnX:',pbjs,e,n); if(typeof(window.hbresponse) == 'undefined'){ window.hbresponse = []; } window.hbresponse.push(pbjs); window.hbresponse.push(e); var adResUnits = pbjs.adUnits; for(var i=0; i1){ var refid = splits[1]; var splitsize = splits[2]; logDebug(refid,splitsize); var refwidth = (splitsize.split('x'))[0]; var refheight = (splitsize.split('x'))[1]; var data = false; var maxbid = parseFloat(0.00); for(var k in e){ var obj = e[k]; var objname = k; var objref = objname.split('_')[1]; if(typeof(obj.bids)=='object' && objref==refid){ logDebug('EHB:(uni) Objref:',objref,obj); var bids = obj.bids; for(var kk in bids){ var bid = bids[kk]; if(typeof(bid.native)=='object'){ try{ ajaxcallX('https://sk.search.etargetnet.com/ajax/partner_counter.php?type=response&category=native&ref='+objref); }catch(e){ console.log(e); } } } } } } } }if(typeof(hbparent_counter)=='undefined'){ var hbparent_counter = [];}function getParentFromRef(refcode){ if(typeof(hbparent_counter[refcode])=='undefined'){ hbparent_counter[refcode] = 0; }else{ if(hbparent_counter[refcode]>10){ return false; } } logDebug('EHB:('+refcode+') hladam parenta'); var hbparent = document.getElementById(refcode) || document.querySelectorAll('[data-etarget-id='+refcode+']')[0]; var hbparentFromGlobals = getGlobalVals(refcode,'hbparent'); if(typeof(hbparentFromGlobals)=='object' && !!hbparentFromGlobals){ hbparentFromGlobals.innerHTML = ''; hbparent = hbparentFromGlobals; } if(typeof(hbparent)=='undefined'){ setTimeout(function(){ hbparent_counter[refcode]++; hbparent = getParentFromRef(refcode); },1000); } return hbparent;}function writeDatas(name,price){ var datas_len = datas.length; if(datas_len>0){ for(var k in datas){ if(datas[k]){ if(datas[k].name==name){ return 0; } } } }datas[datas_len] = {};datas[datas_len].name = name;datas[datas_len].price = price;}function chooseADX(data){ var dataPrice = false;if(typeof(data)=='object'){dataPrice = data.bid;} var ADXSlots = '0.1:6001890671;0.2:8502631299;0.3:8000837773;0.4:5704685742;0.5:8823631224;0.7:5309300439;0.8:2491047001;0.9:3454857563;1:8561504098;1.5:6972994042;2:7902924103;4:3889833206'; logDebug('EHB:(57478) chooseADX:',data,ADXSlots,dataPrice); if(ADXSlots==-1){ return 0; }ADXSlots = ADXSlots.split(';');var ADXCodes = [];var choosen = false;for(var i=0; i=0){ var parts = data.vastUrl.replace('hd=','v=').split('?'); var loadurl = 'https://sk.search.etargetnet.com/embed/player/load.php?'+parts[1]; }else{ var loadurl = 'https://sk.search.etargetnet.com/embed/player/load.php?ref='+orefid+'&defvast='+btoa(encodeURIComponent(data.vastUrl)); } logDebug('vast',loadurl); loadurl += '&x='+size[0]; loadurl += '&y='+size[1]; logDebug('vast',loadurl); insertHTML(iframe,null,loadurl,hb); }else{ insertHTML(iframe,false,false,hb); } } } if(data.system=='etarget' && data.reason=='last chance'){ winnerPost('etargetppc',id); }else{ winnerPost(data.system,id); } gotoetarget = false; } } if(gotoetarget){ logDebug('EHB:('+refid+') before goToEtarget from winbid_show'); goToEtarget(iframe,refid); } if(data){ if(data.system=='etarget'){ div.getElementsByClassName('footer')[0].style.cssText = 'display:none'; } } }window.winbid_showx = function(a,b){ winbid_show(a,b); };function setData(refid, data){ logDebug('EHB:('+refid+') setData:',window.hb,refid,data); var index = -1; try{ var retval = null; if(!refid || !data){ logDebug('EHB:('+refid+') no refid or data:',data); retval = windows.hb; }else{ for(var i in window.hb){ var val = window.hb[i]; if(val){ logDebug('EHB:('+refid+') getDataSearch:',val.id,refid); if(parseInt(val.id)==parseInt(refid)){ index = i; break; } } } } if(index>-1){ window.hb[index] = data }else{ window.hb.push(data); } }catch(e){ console.error(e); window.hb.push(data); } }function getData(refid){ logDebug('EHB:('+refid+') getData:',window.hb); try{ var retval = null; if(!refid){ retval = windows.hb; }else{ for(var i in window.hb){ var val = window.hb[i]; if(val){ logDebug('EHB:('+refid+') getDataSearch:',val.id,refid); if(parseInt(val.id)==parseInt(refid)){ logDebug('EHB:('+refid+') return',val); retval = val; return val; } } } } logDebug('EHB:('+refid+') vraciam:',retval); return retval; }catch(e){ console.error(e); } return null;}function goToEtarget(iframe,refid){ logDebug('EHB('+refid+'): goToEtarget',refid,iframe); var hb = getData(refid); if(!iframe && typeof(hb)=='object' && hb!=null){ iframe = hb.iframe; } logDebug('EHB('+refid+'): draw-fallback','hasData',hb); var fallbackalowed = ((window.location.href.indexOf('fallbackalowed')>0) || true); logDebug('EHB('+refid+'): draw-fallback','goToEtarget',typeof(hb.fallback),fallbackalowed); if(typeof(hb)=='object' && hb && fallbackalowed){ if(typeof(hb.fallback)=='string'){ logDebug('EHB('+refid+'): draw-fallback','string',hb.fallback); if(hb.fallback.length>10){ logDebug('EHB('+refid+'): fallback',hb.fallback); try{ logDebug('EHB('+refid+'): draw-fallback','script'); if(hb.fallback.indexOf('scrip')===1){ var doc = iframe.contentWindow.document; doc.open(); doc.write(''+hb.fallback+''); doc.close(); }else{ var div = hb.div; var ifrm = document.getElementById('etarget_hb_'+refid); if(hb.fallback.indexOf('http')===0 && ifrm){ ifrm.src = hb.fallback; logDebug('hb redraw',ifrm); }else{ var scrpt = document.createElement('script'); scrpt.id = 'etarget_hb_script_'+refid; scrpt.innerHTML = hb.fallback; div.appendChild(scrpt); logDebug('hb inserted',div); } } }catch(e){ console.error(e) } winnerPost('etargetfallback',refid); return true; } } } if(autoClose){ tryToCloseIframe(iframe); return; } if(iframe){ var sf = specFormat(refid,hb.size[0]+'x'+hb.size[1]); var src = 'https://sk.search.etargetnet.com/generic/iframe.php?ref='+refid+'&fromhb=1&area='+hb.size[0]+'x'+hb.size[1]+'&sppos=3&replaceTo=uni&tabl=4&no_pixel=1'+sf; iframe.src = src; winnerPost('etargetppc',refid); }}function tryToCloseIframe(iframe){ if(true){ if(typeof(iframe)=='object' && iframe!=null){ iframe.style.width = '0px'; iframe.style.height = '0px'; iframe.style.display = 'none'; if(typeof(iframe.parentNode)=='object'){ var pid = iframe.parentNode.className; if(pid.indexOf('_et_hb_cont')>=0){ iframe.parentNode.style.width = '0px'; iframe.parentNode.style.height = '0px'; iframe.parentNode.style.display = 'none'; } } } }}function specFormat(refid,size){ var sf = {}; sf['300x250'] = '300x250HD'; logDebug('EHB('+refid+'): sfSize:',size,sf[size]); return sf[size] ? '&s_output_type='+sf[size] : ''; }if(typeof(hb_vis_queue)=='undefined'){ var hb_vis_queue = []; }function insertHTML(iframe,e,src,hb){ logDebug('IFRAME:',iframe,e,src); var html = ''; if(src){ if(src.length>10 && e==null){ iframe.src = src; return true; } } if(e && false){ html = e; if(typeof(html)=='object'){ if(typeof(html.responseText)=='string'){ html = html.responseText; } } } var script = ''; if(customWidth>0 && hb.data.system=='etarget'){ script = ' '; } logDebug('script customWidth',customWidth,hb.data.system,script); var hasHead1 = html.indexOf(''); var hasHead2 = html.indexOf(''); var hasHead = parseInt(hasHead2-hasHead1); if(hasHead>10){ html = html.replace('',''); html = html.replace('',script+''); }else{ html = ''+html+script+''; } logDebug('IFRAME:',html,iframe); var doc = iframe.contentWindow.document; doc.open(); doc.write(html); logDebug('hb.data.adId',hb.raw); if(typeof(hb.raw.native)=='object'){ renderNativeAd(doc,hb,iframe); }else{ if(hb.raw.bidder=='teads' && typeof(hb.div)=='object' && hb.raw.mediaType=='video'){ doc.close(); iframe.style.display = 'none'; hb.div.style.width = '100%'; hb.div.style.height = 'auto'; pbjs.renderAd(hb.div, hb.raw.adId); }else{ pbjs.renderAd(doc, hb.raw.adId); doc.close(); } console.log('isv',hb.raw.mediaType=='video',hb.raw.mediaType,hb.refid,hb.raw.bidder); } }function renderNativeAd(doc, hb, iframe){ logDebug('EHB: (uni)','renderNativeAd'); var nObj = hb.raw.native; var clickUrl = nObj.clickUrl; var imgSrc = nObj.image && nObj.image.url; var wrap = document.createElement('div'); wrap.className = 'wrap'; var title = document.createElement('header'); title.className = 'title'; var body = document.createElement('div'); body.className = 'body'; var image = document.createElement('img'); var sponsored = false; title.innerHTML = nObj.title; body.innerHTML = nObj.body; if(typeof(nObj.sponsoredBy)=='string'){ sponsored = document.createElement('div'); sponsored.innerHTML = nObj.sponsoredBy; sponsored.className = 'sponsored'; } var style = document.createElement('style'); if(typeof(window.styling)=='object'){ if(typeof(window.styling[hb.id])=='object'){ style.innerHTML = style.innerHTML + 'body{cursor:pointer;font-family:'+window.styling[hb.id].font+'; font-size:'+window.styling[hb.id].fsi+'; background-color:'+window.styling[hb.id].bg+'}'; style.innerHTML = style.innerHTML + '.title{color:'+window.styling[hb.id].title.color+'}'; style.innerHTML = style.innerHTML + '.title:hover{color:'+window.styling[hb.id].title.hcolor+'}'; style.innerHTML = style.innerHTML + '.body{color:'+window.styling[hb.id].text.color+'}'; style.innerHTML = style.innerHTML + '.body:hover{color:'+window.styling[hb.id].text.hcolor+'}'; } } wrap.setAttribute('onclick','window.open(\"'+clickUrl+'\")'); wrap.style.cssText = 'display:block;width:100%;height:100%;text-decoration:none;'; title.style.cssText = 'font-size:120%;font-weight:bold;padding:4px 2px;'; body.style.cssText = 'padding:4px 2px;'; if(imgSrc){ image.src = imgSrc; wrap.appendChild(image); }else{ try{ var cont = document.getElementsByClassName('_et_hb_cont'); if(cont.length>0){ var foot = cont[0].getElementsByClassName('footer'); if(foot.length>0){ foot[0].style.display = 'none'; } } }catch(e){ console.log(e); } } wrap.appendChild(style); wrap.appendChild(title); wrap.appendChild(body); if(sponsored){ wrap.appendChild(sponsored); } doc.write(wrap.outerHTML); var wrapsize = doc.getElementsByClassName('wrap')[0].clientHeight; if(wrapsize>0){ iframe.height = wrapsize; iframe.style.cssText = 'height:'+wrapsize+'px !important; border:none; width:100%;'; iframe.parentNode.style.height = wrapsize+'px'; } var impTrackers = nObj.impressionTrackers || []; var jsTrackers = parseJsTrackers(nObj.javascriptTrackers) || []; var clickTrackers = nObj.clickTrackers; for(var i = 0; i < impTrackers.length; i++) { fireRequest(impTrackers[i]); } for(var i = 0; i < jsTrackers.length; i++) { if(true) { var scr = doc.createElement('script'), tar = doc.getElementsByTagName('head')[0]; scr.type = 'text/javascript'; scr.async = true; scr.src = jsTrackers[i]; tar.insertBefore(scr, tar.firstChild); } } var clickable = Array.prototype.slice.apply(doc.getElementsByTagName('body')); for(var i = 0; i < clickable.length; i++) { clickable[i].addEventListener('click', function() { for(var j = 0; j < clickTrackers.length; j++) { fireRequest(clickTrackers[j]); } }); }; try{ ajaxcallX('https://sk.search.etargetnet.com/ajax/partner_counter.php?type=render&category=native&ref='+hb.id); }catch(e){ console.log(e); }}function fireRequest(url) { var request = new XMLHttpRequest(); request.open('GET', url); request.send();};function parseJsTrackers(str) { str = str.replace(/\"/ig,'°'); var urls = [], regex = new RegExp('(?:data-)?src=°([^°]*)°','g'), result; var i = 0; try{ while((result = regex.exec(str)) !== null) { urls.push(result[1]); i++; if(i>20){ break; } } }catch(e){ console.log(e); } return urls;}function visibleArea(obj){ try{ var wtop = top; if(typeof(top)=='object'){ if(top.length!=1 || !top.length || typeof(top.length)=='undefined'){ wtop = window; } } var ww = wtop.innerWidth; var wh = wtop.innerHeight; var dw = wtop.document.body.clientWidth; var dh = wtop.document.body.clientHeight; var vw = wtop.innerWidth; var vh = wtop.innerHeight; vw = obj.clientWidth; vh = obj.clientHeight; var vr = vw*vh; var vpl = findLeft(obj); var vpt = findTop(obj); var viewabilityState = 0; if(vpl && vpt && ww>0){ var vpw = findLeft(obj); var vph = findTop(obj); var dst = top.scrollY; var dsl = top.scrollX; var difw = vpw-dsl; var difh = vph-dst; var difw2 = ww+dsl-vpw-vw; var difh2 = wh+dst-vph-vh; var resw = vw; var resh = vh; if(difw<0){ resw = resw+difw; } if(difw2<0){ resw = resw+difw2; } if(difh<0){ resh = resh+difh; } if(difh2<0){ resh = resh+difh2; } var vnr = resw*resh; var prc = parseInt(vnr/vr*100); if(prc>=visiblePart){ viewabilityState = 1; } }else{ viewabilityState = 2; } return viewabilityState; }catch(e){ return 0; }}function findTop(obj) { if(!obj) return 0; return obj.offsetTop + findTop(obj.offsetParent);}function findLeft(obj) { if(!obj) return 0; return obj.offsetLeft + findLeft(obj.offsetParent);}function checkAfterScroll(e){ var allHBFrames = document.getElementsByTagName('iframe'); for(var k in allHBFrames){ var HBFrame = allHBFrames[k]; if(typeof(HBFrame)=='object'){ if(typeof(HBFrame.getAttribute)=='function'){ var id = HBFrame.getAttribute('id'); if(id){ if(id.indexOf('etarget_hb')>=0){ var refid = (id.split('_'))[2]; if(visibleArea(HBFrame)){ var fromqueue = hb_vis_queue[refid]; if(typeof(fromqueue)=='object'){ if(typeof(fromqueue.google)=='object'){ var iframe = fromqueue.google.iframe.contentWindow.document; var adx_string = fromqueue.google.e; logDebug('EHB:('+refid+') after scroll',adx_string); iframe.open('text/html', 'replace'); iframe.write(adx_string); iframe.close(); winnerPost('google',refid); }else{ winbid_show(3,refid); } delete hb_vis_queue[refid]; } } } } } } }}function insertIntoQueue(iframe,e,src,hb,customWidth){ logDebug('EHB:queue',hb); if(!hb) return false; var refid = hb.id; var system = hb.data.system; if(src=='google'){ system = 'google'; } if(typeof(hb_vis_queue[refid])=='undefined'){ hb_vis_queue[refid] = []; } if(typeof(hb_vis_queue[refid][system])=='undefined'){ hb_vis_queue[refid][system] = {}; } hb_vis_queue[refid][system].iframe = iframe; hb_vis_queue[refid][system].e = e; hb_vis_queue[refid][system].src = src; hb_vis_queue[refid][system].hb = hb; hb_vis_queue[refid][system].customWidth = customWidth;}function ajaxcallX(src,callback,noperm){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if (xhr.readyState == 4 && xhr.status == 200){ if(typeof(callback)!='undefined'){ callback(xhr); } } }; xhr.open('GET', src, true); if(!noperm){ xhr.withCredentials = true; } xhr.send(null); return true; }function checkJQuery(){ return false;if(typeof($)!='function' && typeof(jQuery)!='function'){ logDebug('EHB:(57478) add jQuery');var jquery = document.createElement('script'); jquery.type = 'text/javascript'; jquery.async = false; jquery.src = '//sk.search.etargetnet.com/embed/player/jquery.min.js'; window.self.document.head.appendChild(jquery);} }var winner = ''; var winnerint = false;function winnerPost(winner,refid){if(winnerint){clearInterval(winnerint);winnerint = false;} if(typeof(winner)=='string'){ if(winner.length>0 && parseInt(refid)>0){ winnerint = setTimeout(function(){ logDebug('EHB:('+refid+') Vyhral:',winner); logWinner(winner,refid); },3000); } }}function createJsonFromData(winner, refid){ var data = window.hbresponse; var request = data[0]; var response = data[1]; var goog = window.hbgoogle; logDebug('EHB('+refid+'): JSON START',data,goog,winner); var ret = {}; ret['etargetppc'] = 0; if(!!request){ if(typeof(request.adUnits)!='undefined'){ logDebug('EHB('+refid+'): JSON IN',request.adUnits); for(var k in request.adUnits){ var adunit = request.adUnits[k]; var aducode = adunit.code; if(aducode.indexOf(refid)>0){ var adubids = adunit.bids; for(var l in adubids){ ret[adubids[l].bidder] = 0; } } } } } if(!!response){ logDebug('EHB('+refid+'): JSON IN2',response); for(var k in response){ if(k.indexOf(refid)>0){ var bids = response[k].bids; for(var l in bids){ logDebug('EHB('+refid+'): JSON BIDS',bids[l]); var reason = ''; if(typeof(bids[l].reason)=='string'){ reason = bids[l].reason; } if(bids[l].bidder=='etarget' && reason=='last chance'){ ret['etargetppc'] = parseFloat(bids[l].cpm); }else{ ret[bids[l].bidder] = parseFloat(bids[l].cpm); } } } } } if(!!goog){ logDebug('EHB('+refid+'): JSON IN3',goog); for(var k in goog){ if(goog[k].code.indexOf(refid)>0){ ret['google'] = parseFloat(goog[k].cpm); } } } logDebug('EHB('+refid+'): JSON END',ret); return ret;}function logWinner(winner, refid){ var datas = createJsonFromData(winner, refid);logDebug('EHB:(57478) winnerLog',winner,datas); logDebug('EHB('+refid+'): draw-fallback','winner',winner,refid); if(winner && winner!=null){ var data = JSON.stringify(datas); var pos = 'btf'; var isVisible = visibleArea(hbparent); if(isVisible===1){ pos = 'atf'; } var device = isMobile.any() ? 'mobile' : 'desktop'; var url = 'https://sk.search.etargetnet.com/generic/header_bidding_log.php?ref=57478&position='+pos+'&data='+data+'&device='+device+'&referer='+refid+'&winner='+winner; ajaxcallX(url,function(e){logDebug('EHB:('+refid+') success',url);},true); var winner_logo = logos[winner]; if(winner_logo){ var newlogo = '//sk.search.etargetnet.com/img/logo/etarget_logo_dark_uni_small'+winner_logo+'.png'; var footer = document.getElementsByClassName('footer')[0]; if(footer){ var footera = footer.firstChild; if(footera){ footera.style.cssText = 'background-image:url('+newlogo+') !important'; logDebug('EHB:(57478) logo',footera); } } } }else{ logDebug('EHB:('+refid+') before goToEtarget from logWinner'); goToEtarget(false,refid); }}"; window.self.document.head.appendChild(bscr); if(typeof(window.etargetHBInit)=='undefined'){ window.etargetHBInit = 1; var waitUntilBC = false; if(hbCheckAccessToTop()==2){ if('0'=='1'){ var pscr = document.createElement('script'); pscr.src = 'https://sk.search.etargetnet.com/generic/branding-common.php?stickmenu=&footer=&flexi=0'; document.head.appendChild(pscr); }else{ var pscr = document.createElement('script'); pscr.src = 'https://sk.search.etargetnet.com/generic/branding-common.php?fromhb=1'; document.head.appendChild(pscr); } waitUntilBC = true; } logDebug('EHB: waitUntilBC',waitUntilBC); if(waitUntilBC){ setTimeout(function(){ _et_laodPrebid(); },500); }else{ _et_laodPrebid(); } } } function _et_laodPrebid(){ var pscr = document.createElement('script'); var pbjs_version = '4.22.0'; if('57478'=='48800' || '57478'=='55409' || '57478'=='56082' || '57478'=='56083'){ pbjs_version = '4.22.0'; } pscr.src = 'https://sk.search.etargetnet.com/hb/prebid'+pbjs_version+'.js'; window.self.document.head.appendChild(pscr); } function _et_HBAllLoaded(){ var etargetHBCount = 0; if(typeof(adUnits)=='object'){ var scripts = document.getElementsByTagName('script'); var adUnitCount = adUnits.length; for(var k in scripts){ var script = scripts[k]; var src = script.src; if(typeof(src)!='undefined'){ if(src.indexOf('header_bidding')>0){ etargetHBCount++; } } } if(adUnitCount>=etargetHBCount){ return true; } } return false; } function logDebug(){ var ourips = parseInt(''); var args = arguments; var debugon = Math.max(window.location.href.indexOf('hbjsdebug'),document.referrer.indexOf('hbjsdebug')); if(debugon>=0){ console.log(args); } }