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 = '//bg.search.etargetnet.com/generic/billboard.php?ref=85594&area=970x250&maxWidth='+width+'&&rand=3973&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=85594&from=https%3A%2F%2Fsvobodnoslovo.eu%2F'; 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(https://etargetcdn.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);