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 = "try{ initialLog('50788'); 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-50788'; 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['50788'] = ''; window.globaladsense['50788'] = ''; window.globalFallbackPubID['50788'] = '-1'; window.globalFallbackSlotID['50788'] = '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['50788'] = '0'; window.globalFallbackPrice['50788'] = '0.1'; window.globalFallbackPrcEtarget['50788'] = '0'; window.globalFallbackPrcAdsense['50788'] = '0'; window.globalNoadx['50788'] = 'noadx'; window.hbFindCookieIfLoadedTCFCNT = 0; if(typeof(window.self.initialLoad)=='undefined'){ window.self.initialLoad = 0; } logDebug('fallback',window.globalfallback); window.self.initialLoad += 1; var native = '50281,50282,50283'; native = native.split(','); if(typeof(window.styling)=='undefined'){ window.styling = {}; } var refstyling = {}; refstyling.font = 'verdana'.length>0 ? 'verdana' : 'arial'; refstyling.fsi = '10'.length>0 ? '10px' : '18px'; refstyling.bg = 'ffffff'.length>0 ? ('ffffff'=='transparent' ? 'transparent' : '#ffffff') : 'transparent'; refstyling.title = { color:'f58220'.length>0 ? '#f58220' : 'black', hcolor:'f58220'.length>0 ? '#f58220' : 'black' }; refstyling.text = { color:'000000'.length>0 ? '#000000' : 'black', hcolor:'000000'.length>0 ? '#000000' : 'black' }; refstyling.link = { color:'f58220'.length>0 ? '#f58220' : 'black', hcolor:'f58220'.length>0 ? '#f58220' : 'black', underline:parseInt('0')>0 ? 1 : 0 }; window.styling['50788'] = refstyling; if(typeof(dataParsed)=='undefined'){ var dataParsed = false; } if(typeof(iframeAdded)=='undefined'){ var iframeAdded = []; } if('0'=='1'){ customWidth = hbparent.clientWidth; logDebug('EHB:(50788) flexi width',customWidth,hbparent); } var wh = _et_checkWidthHeightDocument('468','60'); 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','46860'); if('46860'!='1010'){ /*new HB*/ var etargetbids = {bidder:'etarget',params:{refid:50788,country:2}}; 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('19101558'.length>0 && parseInt('0')===0){ var appnbids = {bidder:'appnexus',params:{placementId:'19101558',video:{skippable:true,playback_method:['auto_play_sound_off']}}}; if(isVisible===1){ appnbids.params.position = 'atf'; } bidders.push(appnbids); } if('812762'.length>0){ var adfnbids = {bidder:'adform',params:{mid:'812762'}}; 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:(50788) !!! NEVIEME SA DOSTAT DO postMessage !!!');window.globalNoadx[50788] = 'noadx';} logDebug('EHB:(50788) slotID:');logDebug('EHB:(50788) bidders',bidders);var codeID = 'code_'+'50788'+'_'+'468x60'+'_'+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:(50788) sizes',addit_sizes,sizes); var mediatypes = {'banner':{'sizes':sizes}}; if(native.indexOf('50788')>=0 || true){ mediatypes.native = { title: { required: true, sendId: true }, body: { required: true, sendId: true }, clickUrl: { sendId: true } }; try{ ajaxcallX('https://cz.search.etargetnet.com/ajax/partner_counter.php?type=request&category=native&ref=50788'); }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:(50788) updateUnit',bidobj); }else{ window.self.adUnits = [bidobj]; logDebug('EHB:(50788) 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:(50788) tryTimeout start'); window.self.loadInt = setTimeout(function(){ logDebug('EHB:(50788) tryTimeout inside'); executeHBJS(); },1000);}catch(e){console.error(e);}function initialLog(refid){ var data = '[]'; var pos = 'btf'; var winner = 'init'; var url = 'https://cz.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:(50788) before dataParsed',dataParsed); if(!dataParsed){ dataParsed = true; logDebug('EHB:(50788) 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() { console.log('%c __tcfapi %c event %c remove ','background:gray;color:white','background:#4e0060;color:white','background:#fffa0c;color:black'); }, a.listenerId); } logDebug('EHB:(50788) TCF after event',a,b); logDebug('EHB:(50788) 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:(50788) 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/gdprV2.0.1.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:(50788) 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:(50788) 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:(50788) 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-50788') || document.querySelectorAll('[data-etarget-id=etarget-id-50788]')[0]; if(typeof(parent)=='undefined'){ var url = 'http://cz.search.etargetnet.com/generic/uni.php?g=ref:50788,area:468x60'; 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-50788'; 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:(50788) ','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:(50788) 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','50788','468x60'); var refid = '50788'; var refcode = 'etarget-id-'+refid; var hbparent = getParentFromRef(refcode,hbparent); var refsize = '468x60'.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); 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){ 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; 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://cz.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:(50788) 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://cz.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'){ doc.close(); iframe.style.display = 'none'; doc = hb.div; doc.style.width = '100%'; doc.style.height = 'auto'; pbjs.renderAd(doc, hb.raw.adId); }else{ pbjs.renderAd(doc, hb.raw.adId); doc.close(); } console.log('isVideo',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://cz.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:(50788) add jQuery');var jquery = document.createElement('script'); jquery.type = 'text/javascript'; jquery.async = false; jquery.src = '//cz.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:(50788) 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 url = 'https://cz.search.etargetnet.com/generic/header_bidding_log.php?ref=50788&position='+pos+'&data='+data+'&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:(50788) 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('50788'=='48800' || '50788'=='55409' || '50788'=='56082' || '50788'=='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); } } var chrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); var isPixel = parseInt('0'); var eident='EPLAYA'; var skanJSForYT=false; var nextVideoAfterEnd=parseInt('0'); var etargetAfterClose = parseInt('0'); var skiptext = 'reklama ETARGET'; var ceuvn = 'YToxOntzOjQ6ImV2dzIiO3M6MTY6IjR5cy0xWjctRGlGLTRURi0iO30='; var xeuvn = ''; var ourips = ''; var videoReferer = parseInt(''); var newStyle = ''; var parentRelated = '1'; var noPrerolls = false; var globalMidroll = ''; if(''=='true'){ noPrerolls = true; } try{ if(typeof(isEplayaRunSet)=='undefined'){ var isEplayaRunSet=false; } if(!isEplayaRunSet){ if(typeof(apiREADY)=='undefined'){ var apiREADY = false; } if(typeof(eplayaAutoplay)=='undefined' || isPixel==1){ var eplayaAutoplay = parseInt('0'); } if((typeof(tryEtarget)=='undefined' || isPixel==1) && '1'=='none'){ var tryEtarget = 0; } if((typeof(defaultVPAIDURL)=='undefined' || isPixel==1) && ''.length>0){ var defaultVPAIDURL = ''; } if((typeof(debugMode)=='undefined' || isPixel==1) && ''.length>0){ var debugMode = ''; } if(typeof(eplayaResponsive)=='undefined' || isPixel==1){ var eplayaResponsive = parseInt('0'); } if(typeof(etargetAfterClose)=='undefined' || isPixel==1){ var etargetAfterClose = parseInt('0'); } if(typeof(eplayaXko)=='undefined' || isPixel==1){ var eplayaXko = 'width:30px;height:30px;'; } if(typeof(blockedJSON)=='undefined' || isPixel==1){ var blockedJSON = 'eyJibG9ja2VkX3NvdXJjZSI6WyJldGFyZ2V0Il19'; } if(typeof(forcedJSON)=='undefined' || isPixel==1){ var forcedJSON = 'W10='; } if(typeof(forcedJSON)=='undefined' || isPixel==1){ var showinfo = parseInt(''); } if(typeof(adsTimeDelay)=='undefined' || isPixel==1){ var adsTimeDelay = parseInt('')*-1; } if(typeof(onReadyFilled)=='undefined'){ var onReadyFilled=false; } if(typeof(dont_touch)=='undefined' || dont_touch.length==0){ var dont_touch=''; } if(typeof(blockedPlayers)=='undefined'){ var blockedPlayers=''; }else{ blockedPlayers = blockedPlayers+','; } if(typeof(allowedPlayers)=='undefined'){ var allowedPlayers=''; }else{ allowedPlayers = allowedPlayers+','; } if(typeof(onLoadFilled)=='undefined'){ var onLoadFilled=false; } if(typeof(alreadyChecked)=='undefined'){ var alreadyChecked=false; } if(typeof(etargetVideoType)=='undefined'){ var etargetVideoType = '0'; } if(typeof(maxAdsCount)=='undefined' || isPixel==1){ var maxAdsCount = parseInt('0'); var niecoX = 1; } if(typeof(etargetVideoReferrer)=='undefined'){ var etargetVideoReferrer = 0; } if(typeof(etargetVideoDomain)=='undefined'){ var etargetVideoDomain = ''; } if(typeof(eplayaDeviceType)=='undefined'){ var eplayaDeviceType = parseInt('0'); } if(document.readyState=='complete' || document.readyState=='interactive'){ if(typeof(checkYURun)=='function' && !alreadyChecked){ checkYURun('start'); } } if(!alreadyChecked){ var docold = ''; if(!alreadyChecked && !onReadyFilled){ if(typeof(document.onreadystatechange)=='function'){ docold = document.onreadystatechange; } document.onreadystatechange = function(){ if(!alreadyChecked){ checkYURun('ready'); } if(typeof(docold)=='function'){ docold(); } onReadyFilled = true; } } var winold = ''; if(!alreadyChecked && !onLoadFilled){ if(typeof(window.onload)=='function'){ winold = window.onload; } window.onload = function(){ if(!alreadyChecked){ checkYURun('loaded'); } if(typeof(winold)=='function'){ winold(); } onLoadFilled = true; } } } if(typeof(onYouTubeIframeAPIReady)=='function'){ skanJSForYT=true; } function checkYURun(where){ var state = document.readyState; if(state=='complete' || state=='interactive'){ if(typeof(checkYUExist)=='function' && !alreadyChecked){ if(typeof(eplayaInit)=='function'){ eplayaInit(); }else{ checkYUExist(); } } } } function checkYUExist(){ var exist = false; var estyle = document.getElementsByTagName('link'); for(key in estyle){ if(estyle[key]){ var esrc = estyle[key].href; if(esrc && esrc.indexOf('eplaya')>=0){ var exist = true; } } } var exist = false; var exist2 = false; var escripts = document.getElementsByTagName('script'); for(key in escripts){ if(escripts[key]){ var esrc = escripts[key].src; if(esrc && esrc.indexOf('eplaya')>=0){ var exist = true; } if(esrc && esrc.indexOf('iframe_api')>=0){ var exist2 = true; } } } if(!exist2){ var yuscript = document.createElement('script'); yuscript.type = 'text/javascript'; yuscript.src = 'https://www.youtube.com/iframe_api'; document.head.appendChild(yuscript); apiREADY = true; }else{ apiREADY = true; } if(!exist){ window.etargetVideoReferrer = parseInt('50788'); window.etargetVideoDomain = 'cz'; var newscript = document.createElement('script'); newscript.type = 'text/javascript'; newscript.src = '//cz.search.etargetnet.com/embed/eplayaV5.32.js'; if(document.head){ document.head.appendChild(newscript); } } } isEplayaRunSet = true; } }catch(e){console.log(e);} var bbLog = []; var newbb = 'true'; if(typeof(bbclosed)=='undefined'){ var bbSetScroll = false; var bbclosed = false; var bbHasTop = false; var bbHasBottom = false; var banner = false; var display = 'block'; } var cCookie = parseInt('0'); var billb = document.getElementsByClassName('_et_billboard_wrap'); var pixel = parseInt('0'); var fix = ''; if(typeof(pos_top)=='number' && pixel>0){ var pos_top = parseInt('0'); } if(typeof(pos_top)=='undefined'){ var pos_top = parseInt('0'); } if(typeof(pos_bottom)=='number' && pixel>0){ var pos_bottom = parseInt('1'); } if(typeof(pos_bottom)=='undefined'){ var pos_bottom = parseInt('1'); } bbLog.bblen = billb.length; var state = document.readyState; if(state=='complete'){ webConsole('bb_complete'); bb_init(); }else{ webConsole('bb_not_complete'); document.onreadystatechange = function(e){ var state = document.readyState; if(state=='complete'){ bb_init(); } } } function bb_init(){ webConsole('bb_start'); if(billb.length==0){ try{ var body = document.getElementsByTagName('body')[0]; if(typeof(body)=='object'){ webConsole('bb_body'); bbLog.body = body; banner = 'script'; var width = parseInt(body.clientWidth); var wrapAdditiClass = ''; bbLog.banner = banner; var newChild = document.createElement('div'); newChild.className = '_et_billboard'; newChild.style.cssText = 'width:100%;height:100%'; if(banner=='script'){ var script = document.createElement('script'); script.src = '//cz.search.etargetnet.com/generic/billboard.php?ref=50788&area=970x250&maxWidth='+width+'&&rand=4847&insider=billboard'; newChild.appendChild(script); wrapAdditiClass = '_et_bb_onload'; display = 'none'; }else{ if(banner.indexOf('url:')==0){ var burl = banner.replace('url:',''); banner = document.createElement('script'); banner.src = burl; newChild.appendChild(banner); }else{ newChild.innerHTML = banner; } } var loaded = 'loaded'; var iframe = document.createElement('iframe'); iframe.style.cssText = 'width:100%;height:100%;border:none;'; var iframe_b = document.createElement('iframe'); iframe_b.style.cssText = 'width:100%;height:100%;border:none;'; var close = document.createElement('div'); close.className = '_et_billboard_close'; close.setAttribute('onclick','closeBillboard();'); var infootera = document.createElement('a'); infootera.href = '//etarget.sk/?ref=50788&from=http%3A%2F%2Fwww.nasepojizeri.cz%2Fsemilsko-aktualne%2Flyzari-%25E2%2580%2593-veterani-si-dobre-vedli-na-mistrovstvi-sveta-v-italii%2F%3FaktualitaId%3D23712'; var infooter = document.createElement('div'); infooter.className = '_et_infooter'; infooter.appendChild(infootera); var footer = document.createElement('div'); footer.className = '_et_footer'; footer.appendChild(infooter); var newWrap = document.createElement('div'); newWrap.className = '_et_billboard_wrap'; /*fill*/ newWrap.appendChild(footer); newWrap.appendChild(close); var newWrapBottom = newWrap.cloneNode(true); newWrapBottom.appendChild(iframe_b); newWrap.appendChild(iframe); if(wrapAdditiClass){ newWrapBottom.className = newWrapBottom.className+' '+wrapAdditiClass; newWrap.className = newWrap.className+' '+wrapAdditiClass; } var firstChild = body.firstChild; bbLog.child = firstChild; webConsole('bb_',banner,typeof(firstChild)=='object',typeof(newChild)=='object',width); if(banner && typeof(firstChild)=='object' && typeof(newChild)=='object' && width>=970){ webConsole('bb_width'); bbLog.make = 1; addBillboardCSS(); var sh = document.body.scrollTop; if(pos_top>0){ if(sh==0){ body.insertBefore(newWrap,firstChild); fillIframe(iframe,newChild); bbHasTop = true; }else{ scrollBillboard(false,body,newWrapBottom,newChild,iframe,iframe_b,newWrap); document.addEventListener('scroll',function(e){scrollBillboard(e,body,newWrapBottom,newWrap,iframe,iframe_b,newChild);},true); bbSetScroll = true; } } if(pos_bottom>0 && !bbSetScroll){ if(fix!='fix'){ scrollBillboard(false,body,newWrapBottom,false,iframe,iframe_b,newChild); } document.addEventListener('scroll',function(e){scrollBillboard(e,body,newWrapBottom,false,iframe,iframe_b,newChild);},true); } } } }catch(e){ webConsole(e); } } } function scrollBillboard(t,b,o_bottom,o_top,iframe,iframe_b,newChild){ webConsole('bb_scroll'); if(bbclosed) return false; var el = document.body; if(typeof(el)=='undefined') return false; var sh = el.scrollHeight; var st = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || el.scrollTop || 0; var sc = parseInt(st+window.innerHeight); if(st==0 && !bbHasTop && typeof(o_top)=='object'){ b.insertBefore(o_top,b.firstChild); fillIframe(iframe,newChild); webConsole('fill_top_bb'); bbHasTop = true; } if(bbHasTop && !bbHasBottom && pos_top && typeof(o_top)!='object'){ webConsole('reset_bottom_bb'); bbHasBottom = true; } if(sc>=(sh-200) && !bbHasBottom){ var f = findFooterForBillboard(); webConsole('fill_bottom_bb'); if(typeof(f)=='object'){ f.parentNode.insertBefore(o_bottom,f); fillIframe(iframe_b,newChild); }else{ if(banner=='script'){ o_bottom.appendChild(newChild); b.appendChild(o_bottom); webConsole('fill_scr_bb'); }else{ b.appendChild(o_bottom); fillIframe(iframe_b,newChild); webConsole('fill_obj_bb'); } } bbHasBottom = true; } } function fillIframe(iframe,body){ var inStyle = document.createElement('style'); inStyle.innerHTML = 'body,html{padding:0px;margin:0px;overflow:hidden;}'; iframe.contentWindow.document.open(); iframe.contentWindow.document.write(body.outerHTML); iframe.contentWindow.document.head.appendChild(inStyle); iframe.contentWindow.document.close(); } function findFooterForBillboard(){ var ids = document.getElementById('footer'); if(typeof(ids)=='object'){ /*return ids;*/ } return false; } function addBillboardCSS(){ var style = document.createElement('style'); style.innerHTML = ''+ '._et_billboard_wrap{margin:0px auto;background-transparent;text-align:center;position:relative;overflow:hidden;display:'+display+';}'+ '._et_billboard{width:970px;height:250px;position:relative;display:inline-block;}'+ '._et_billboard_close{background-color:black;width:20px;height:20px;position:absolute;z-index:1;top:5px;right:5px;box-shadow:0px 0px 4px gray;opacity:0.3;cursor:pointer;border-radius:100%;border:solid 2px white;background-image:url(//sk.search.etargetnet.com/img/close_icon.png);background-position:center;background-size:16px;}'+ '._et_billboard_close:hover{opacity:1;}'+ '._et_footer{width:120px;display:block;position:absolute;right:0px;bottom:0px;}'+ '._et_infooter a{background-image: url(//sk.search.etargetnet.com/img/logo/etarget_logo_dark_uni_small.png);background-position: left center;'+ 'background-repeat:no-repeat;background-size:auto17px;bottom:1px;display:block;'+ 'height:20px;position:absolute;right:4px;transition: width 0.2s ease 0s;width:14px;z-index:1;'+ '}'+ '._et_infooter a:hover{width:108px;right:1px;border-radius:5px 0px 0px;background-color:rgba(255,255,255,0.6);background-position:center;}'+ '._et_bb_onload{height:0px !important;margin:0px !important;}'+ ''; if(newbb=='true'){ style.innerHTML += ''+ '._et_billboard_wrap{position:fixed;bottom:50px;left:0;right:0;box-shadow:0px 0px 30px black;z-index:999999;}'+ ''; } document.head.appendChild(style); } function closeBillboard(){ var d1 = new Date(); var n = parseInt(d1.getTime()/1000); bbclosed = true; if(cCookie){ var scr = document.createElement('script'); scr.type = 'text/javascript'; scr.src = '//sk.search.etargetnet.com/setCookie.php?name=etr_mcls&value='+n; document.body.appendChild(scr); } var bb = document.getElementsByClassName('_et_billboard_wrap')[0]; document.body.removeChild(bb); } function webConsole(){ try{ if(typeof(top.loaction)=='object'){ try{ var tophref = top.location.href; }catch(e){ /*console.log(e);*/ var tophref = window.location.href; } } }catch(e){ /*console.log(e);*/ } if(typeof(tophref)=='string'){ if(tophref.indexOf('etargetdebug')>=0){ if(arguments.length==1){ console.log(arguments[0]); }else{ console.log(arguments); } } } } webConsole('bb_log'); webConsole(bbLog);