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('85947'); logDebug('version',3,'85947'); 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-85947'; var refrand = parseInt(Math.random()*1000); if(typeof(window.globalfallback)=='undefined'){ window.globalfallback = []; } if(typeof(window.globalfallbackType)=='undefined'){ window.globalfallbackType = []; } if(typeof(window.globalFallbackRate)=='undefined'){ window.globalFallbackRate = []; } if(typeof(window.globalFallbackPrice)=='undefined'){ window.globalFallbackPrice = []; } if(typeof(window.globalNoFallback)=='undefined'){ window.globalNoFallback = []; } 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 = []; } if(typeof(window.globalFlags)=='undefined'){ window.globalFlags = []; } if(typeof(window.globalFlags['85947'])=='undefined'){ window.globalFlags['85947'] = {}; } if(typeof(window.hbgoogle)=='undefined'){ window.hbgoogle = []; } if(typeof(window.etParentWrap)=='undefined'){ window.etParentWrap = []; } if(typeof(window.etParentWrap['85947'])=='undefined'){ window.etParentWrap['85947'] = false; } if(typeof(window.hbgoogle['85947'])=='undefined'){ window.hbgoogle['85947'] = []; } if(typeof(window.winnerint)=='undefined'){ window.winnerint = []; } if(typeof(window.winnerShow)=='undefined'){ window.winnerShow = []; } if(typeof(window.winnerShow['85947'])=='undefined'){ window.winnerShow['85947'] = []; } if(typeof(window.winnerLog)=='undefined'){ window.winnerLog = []; } window.globalfallback['85947'] = ''; window.globalfallbackType['85947'] = ''; window.globalFallbackPubID['85947'] = '-1'; window.globalFallbackSlotID['85947'] = ''; window.globalFallbackRate['85947'] = parseFloat('0'); window.globalFallbackPrice['85947'] = parseFloat('0.1'); window.globalFallbackPrcEtarget['85947'] = '0'; window.globalFallbackPrcAdsense['85947'] = '0'; window.globalNoFallback['85947'] = ('nofallback'.length>0 ? true : false); window.globalFlags['85947'].ppc = parseInt('0'); window.globalFlags['85947'].etr = parseInt('0'); window.globalFlags['85947'].apn = parseInt('0'); window.globalFlags['85947'].rub = parseInt('0'); window.globalFlags['85947'].pls = parseInt('0'); window.globalFlags['85947'].tds = parseInt('0'); window.winnerint['85947'] = false; window.hbFindCookieIfLoadedTCFCNT = 0; if(typeof(window.self.initialLoad)=='undefined'){ window.self.initialLoad = 0; } logDebug('fallback',window.globalfallback); window.self.initialLoad += 1; var native = '76940,78646'; native = native.split(','); if(typeof(window.styling)=='undefined'){ window.styling = {}; } var refstyling = {}; refstyling.font = 'verdana'.length>0 ? 'verdana' : 'arial'; refstyling.fsi = '14'.length>0 ? '14px' : '18px'; refstyling.bg = 'ffffff'.length>0 ? ('ffffff'=='transparent' ? 'transparent' : '#ffffff') : 'transparent'; refstyling.title = { color:'000000'.length>0 ? '#000000' : 'black', hcolor:'000000'.length>0 ? '#000000' : 'black' }; refstyling.text = { color:'000000'.length>0 ? '#000000' : 'black', hcolor:'000000'.length>0 ? '#000000' : 'black' }; refstyling.link = { color:'0066d5'.length>0 ? '#0066d5' : 'black', hcolor:'0066d5'.length>0 ? '#0066d5' : 'black', underline:parseInt('0')>0 ? 1 : 0 }; window.styling['85947'] = refstyling; if(typeof(dataParsed)=='undefined'){ var dataParsed = false; } if(typeof(iframeAdded)=='undefined'){ var iframeAdded = []; } if('0'=='1'){ customWidth = hbparent.clientWidth; logDebug('EHB:(85947) flexi width',customWidth,hbparent); } var wh = _et_checkWidthHeightDocument('640','120'); var width = wh[0]; var height = wh[1]; addSuperOptions(hbparent); setGlobalVals(refcode,'hbparent',hbparent); setGlobalVals(refcode,'refrand',refrand);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 version',3); logDebug('EHB sizex','640120'); if('640120'!='1010' && window.globalFlags['85947'].etr===0){ /*new HB*/ var etargetbids = {bidder:'etarget',params:{refid:85947,country:6}}; if(isVisible===1){ etargetbids.params.position = 'atf'; } bidders.push(etargetbids); } if(!justEtarget){ logDebug('teads','',''); if(''.length>0 && ''.length>0 && window.globalFlags['85947'].tds===0){ var teadsbids = {bidder:'teads',params:{pageId:'',placementId:''}}; bidders.push(teadsbids); } if('19557324'.length>0 && window.globalFlags['85947'].apn===0){ var appnbids = {bidder:'appnexus',params:{placementId:'19557324',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 && window.globalFlags['85947'].pls===0){ var pulsbids = {bidder:'pulsepoint',params:{cf:'',cp:'',ct:''}}; if(isVisible===1){ pulsbids.params.position = 'atf'; } bidders.push(pulsbids); } if(''.length>0 && window.globalFlags['85947'].rub===0){ var rubibids = {bidder:'rubicon',params:{accountId:'',siteId:'',zoneId:''}}; if(''.length>0){ rubibids.params.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:(85947) !!! NEVIEME SA DOSTAT DO postMessage !!!');window.globalNoFallback[85947] = true;} logDebug('EHB:(85947) slotID:');logDebug('EHB:(85947) bidders',bidders,'asd',window.globalFlags['85947']);var codeID = 'code_'+'85947'+'_'+'640x120'+'_'+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:(85947) sizes',addit_sizes,sizes); var mediatypes = {'banner':{'sizes':sizes}}; if(native.indexOf('85947')>=0 || true){ mediatypes.native = { title: { required: true, sendId: true }, body: { required: true, sendId: true }, clickUrl: { sendId: true } }; try{ if(false){ ajaxcallX('https://bg.search.etargetnet.com/ajax/partner_counter.php?type=request&category=native&ref=85947'); } }catch(e){ console.log(e); } } if((typeof(teadsbids)!='undefined' || '85947'=='48800') && false){ mediatypes.video = { context: 'outstream', playerSize: [[parseInt(width),parseInt(height)]] } } if('85947'=='48800' && false){ mediatypesnew = {}; mediatypesnew.video = mediatypes.video; mediatypes = mediatypesnew; } logDebug('EHB: mediatypes',mediatypes); var bidobj = { code: codeID, sizes: sizes, bids: bidders, mediaTypes: mediatypes }; if(false){ var floor = { currency: 'USD', modelVersion: 'EFPv1', schema: { fields: ['mediaType'] }, values: { 'banner': 0, 'video': 0 } }; bidobj.floors = floor; console.log('floor',floor,bidobj); } if(typeof(window.self.adUnits)=='object'){ window.self.adUnits.push(bidobj); logDebug('EHB:(85947) updateUnit',bidobj); }else{ window.self.adUnits = [bidobj]; logDebug('EHB:(85947) 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:(85947) tryTimeout start'); window.self.loadInt = setTimeout(function(){ logDebug('EHB:(85947) tryTimeout inside'); executeHBJS(); },1000);}catch(e){console.error(e);}function initialLog(refid){ var data = '[]'; var pos = 'btf'; var winner = 'init'; var url = 'https://bg.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:(85947) before dataParsed',dataParsed); if(!dataParsed){ dataParsed = true; logDebug('EHB:(85947) 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:(85947) TCF after event',a,b); logDebug('EHB:(85947) 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:(85947) 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:(85947) 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:(85947) 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:(85947) 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(){ logDebug('_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-85947') || document.querySelectorAll('[data-etarget-id=etarget-id-85947]')[0]; if(typeof(parent)=='undefined'){ var url = 'http://bg.search.etargetnet.com/generic/header_bidding.php?ref=85947'; 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-85947'; 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:(85947) ','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:(85947) 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; var units = pbjs.adUnits; for(var y in units){ var unit = units[y]; var k = unit.code; 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(window.globalfallback[refid].length>0){ newhb.fallback = window.globalfallback[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 && false){ logDebug('nodata','85947','640x120'); var refid = '85947'; var refcode = 'etarget-id-'+refid; var hbparent = getParentFromRef(refcode,hbparent); var refsize = '640x120'.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 = ''; if(window.globalfallback[refid].length>0){ newhb.fallback = window.globalfallback[refid]; } newhb.size = [refsize[0],refsize[1]]; logDebug('nodata objs',objs,newhb); if(!window.globalNoFallback[refid]){ window.globalNoFallback[refid] = true; if(newhb.fallback.length>0 || window.globalfallbackType[refid]=='adsense'){ window.globalNoFallback[refid] = false; adxcpm = 0; if(window.globalFallbackPrice[refid]){ adxcpm = window.globalFallbackPrice[refid]; } window.hbgoogle[refid].push({'code':'adx_'+refid, 'cpm':adxcpm}); } logDebug('adxPRC1.1',parseInt(window.globalFallbackPrcEtarget[refid]),parseInt(window.globalFallbackPrcAdsense[refid])); logDebug('vchadzam dnu ak mame etarget ppc fallback + mame nastavene percenta pre E+G'); if(!window.globalNoFallback[refid] && typeof(window.globalFallbackPrcEtarget[refid])!='undefined' && typeof(window.globalFallbackPrcAdsense[refid])!='undefined'){ var sum = parseInt(window.globalFallbackPrcEtarget[refid])+parseInt(window.globalFallbackPrcAdsense[refid]); logDebug('adxPRC2.1',sum); if(sum>0){ var rand = Math.random()*sum; window.globalNoFallback[refid] = false; if(Math.ceil(rand)<=parseInt(globalFallbackPrcEtarget[refid])){ window.globalNoFallback[refid] = true; window.globalfallbackType[refid] = 'etarget'; } logDebug('adxPRC3.1',rand,Math.ceil(rand),window.globalfallbackType[refid]); } } } setData(refid,newhb); before_win(refid,false,10,10,iframe,div); } }else{ var forcnt = 0; logDebug('forcecnt start',forcnt,byMaxCmp); var parsedIDs = []; for(var k in byMaxCmp){ if(byMaxCmp[k]){ var bid = byMaxCmp[k]; if(typeof(bid.adId)=='undefined'){ continue; } if(typeof(window.hbCreated)=='undefined'){ window.hbCreated = []; } if(!window.hbCreated[bid.adId]){ window.hbCreated[bid.adId] = 1; }else{ return; } var refid = bid.adUnitCode.split('_')[1]; var refsize = bid.adUnitCode.split('_')[2]; var refcode = 'etarget-id-'+refid; var hbparent = getParentFromRef(refcode,hbparent); parsedIDs.push(refid); logDebug('render?',refid,refsize,refcode,hbparent); if(bid.width===0){ var refsizes = refsize.split('x'); bid.width = refsizes[0]; bid.height = refsizes[1]; } logDebug(hbparent); var code = bid.bidder; var url = bid.adUrl; var vastUrl = bid.vastUrl; var ad = bid.ad; var adx = url ? url : ad; var reason = ''; if(typeof(bid.reason)=='string'){ reason = bid.reason; } var cena = parseFloat(bid.cpm).toFixed(2); if(typeof(bid.netRevenue)!='undefined'){ netto = bid.netRevenue; } if(!netto){ cena = cena*0.75; } var data = {'bid':cena,'url':url,'ad':ad,'vastUrl':vastUrl,'system':code,'netto':netto,'reason':reason}; logDebug('EHB:('+refid+') Objx:',data,bid); var divw = bid.width; if(customWidth>0 && 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(window.globalfallback[refid].length>0){ newhb.fallback = window.globalfallback[refid]; } newhb.size = [bid.width,bid.height]; logDebug('EHB:(uni) setData: before',newhb); if(typeof(window.hb)=='undefined'){ window.hb = []; } logDebug('EHB:(uni) HBData:',window.hb); logDebug('EHB:(uni) global:',window.globalFallbackPrice[refid], newhb.fallback, window.globalNoFallback[refid], window.globalFallbackRate[refid]); if(!window.globalNoFallback[refid]){ window.globalNoFallback[refid] = true; if(newhb.fallback.length>0 || window.globalfallbackType[refid]=='adsense'){ adxcpm = 0; if(window.globalFallbackPrice[refid]){ adxcpm = window.globalFallbackPrice[refid]; } window.hbgoogle[refid].push({'code':'adx_'+refid, 'cpm':adxcpm}); logDebug('EHB:(uni) global2:',cena,window.globalFallbackPrice); if(cena
',script+''); }else{ html = '