(function() { var c=1; var x = document.getElementById("Sureview108"); var sureview_logo_container=document.createElement("div"); var vdo = document.createElement("div"); var vi_maindiv = document.createElement("div"); var teads = document.createElement("script"); teads.id="sureview_2"; var third_party = document.createElement("script"); var adipolo = document.createElement("div"); var teads_main_div = document.createElement("div"); var vdo_id=""; var is_active_adipolo=0; var is_active_teads=0; var is_active_aniview=0; var is_active_vdo=0; var is_active_valueImpression=0; var ad_displaying=0; var running_ads=0; var by_tag_name=""; var placement_salector=""; var no_of_tag=""; var placed_by=""; var priority1="2"; var priority2="1"; var priority3="4"; var refreshIntervalId; var iframe="iframe"; var is_added_smc_header=0; var vdo_player; var teads_player; var teads_ads_duration=10000; var vdo_ads_duration=10000; var setlogo_intval; var setlogoTeads_intval; var dailyMotionStyle = document.createElement('style'); dailyMotionStyle.innerHTML="#dailymotion-pip-large-viewport{ --dm--pip-left: 0px;} #dailymotion-pip-large-viewport{ --dm--pip-left: 0; --dm--pip-right: auto; } #dailymotion-pip-small-viewport {--dm--pip-size-width: 200px !important; --dm--pip-size-height: 110px !important;} .dm-player.dm-player-close-show #dailymotion-pip-large-viewport .dm__close-button, .dm-player.dm-player-close-show #dailymotion-pip-small-viewport .dm__close-button { visibility: visible !important;} .dm-player.dm-player-close-show .dm__close-button { visibility: visible !important; } .dm__close-button { position: absolute !important; top: var(--dm-close-top, -28px) !important; right: unset !important; width: var(--dm-close-width, 25px) !important; height: var(--dm-close-height, 25px) !important; background: var(--dm-close-bg, #000) !important; opacity: var(--dm-close-opacity, 0.45) !important; border-radius: 50% !important; padding: var(--dm-close-padding, 7px) !important; border: var(--dm-close-border, 0) !important; cursor: pointer; visibility: hidden; } .dailymotion-player-wrapper#dailymotion-pip-small-viewport .dm__close-button { left: 0px !important; right: unset !important; }"; top.document.getElementsByTagName('head')[0].appendChild(dailyMotionStyle); var dailyMotionStyle = document.createElement('style'); dailyMotionStyle.innerHTML="#dailymotion-pip-small-viewport, #dailymotion-pip-large-viewport { width: var(--dm--pip-size-width, 410px) !important; left: var(--dm--pip-left, 0) !important; height: var(--dm--pip-size-height, 231px) !important; transition: right .5s ease !important; right: var(--dm--pip-right, initial) !important;} .dailymotion-player-wrapper#dailymotion-pip-small-viewport .dm__close-button { left: 0px !important; right: unset !important; }"; var reduce_size_for_big_screen= document.createElement('style'); reduce_size_for_big_screen.innerHTML="@media screen and (min-width: 640px) {.dm-player { padding-left: 20% !important; padding-right: 20% !important; }} #dailymotion-pip-small-viewport .dailymotion-player, #dailymotion-pip-small-viewport .dm__pip-new-controls{ border-radius: 10px; }"; top.document.getElementsByTagName('head')[0].appendChild(reduce_size_for_big_screen); placement_salector=0; setTimeout(function(){ setTimeout(function(){ try{ var s3 = document.createElement("style"); s3.append("#dailymotion-pip-small-viewport, #dailymotion-pip-large-viewport { width: var(--dm--pip-size-width, 410px) !important; left: var(--dm--pip-left, 0) !important; height: var(--dm--pip-size-height, 231px) !important; transition: right .5s ease !important; right: var(--dm--pip-right, initial) !important; display: block !important; bottom: 100px !important; top: var(--dm--pip-top, initial) !important; }"); top.document.head.appendChild(s3); }catch{ } if(document.getElementsByClassName('teads-inread').length>0){ var teadsMarginStyle = document.createElement('style'); teadsMarginStyle.innerHTML=".teads-inread {padding-bottom:10px !important;}"; document.getElementsByClassName('teads-inread')[0].appendChild(teadsMarginStyle); } },8000); },800); function set_aniview_after15sec(){ setlogoTeads_intval=setInterval(function(){ try{ document.querySelector(".teads-inread").remove(); }catch{ } },15000); } function new_logo(company_id){ var isLogoTriggered = false; var isLogoTriggeredTeads = false; if(company_id==2){ var test_id=108; setlogoTeads_intval=setInterval(function(){ teads_primary_div=document.getElementById('teads0'); if(test_id==64 && !isLogoTriggeredTeads){ isLogoTriggeredTeads = true; clearInterval(setlogoTeads_intval); var bottom_div = document.createElement("div"); bottom_div.id="sureview_branding_2"; bottom_div.style.cssText="line-height:0px;"; bottom_div.className="sureviewBottomDiv sureviewtv"; var anchor1=document.createElement("a"); anchor1.href="http://sureview.tv/"; anchor1.target="_BLANK"; var bottom_logo_img = document.createElement("img"); bottom_logo_img.id="sureview_logo_bottom_2"; bottom_logo_img.src="https://app.sureview.tv/logo/sureview_logo.svg"; bottom_logo_img.style.cssText="height: 18px !important; margin: 0 !important; margin-top: 2px !important; width: 70px !important;"; anchor1.appendChild(bottom_logo_img); bottom_div.appendChild(anchor1); teads_primary_div.appendChild(bottom_div); }else{ } },1000); }else{ daily_motion_ads=document.getElementById('daily_motion_ads_div'); setlogo_intval=setInterval(function(){ if(document.getElementsByClassName('dm-player-wrapper').length > 0 && !isLogoTriggered){ isLogoTriggered = true; clearInterval(setlogo_intval); var bottom_div = document.createElement("div"); bottom_div.id="sureview_branding"; bottom_div.style.cssText="line-height:0px;"; bottom_div.className="sureviewBottomDiv sureviewtv"; var anchor1=document.createElement("a"); anchor1.href="http://sureview.tv/"; anchor1.target="_BLANK"; var bottom_logo_img = document.createElement("img"); bottom_logo_img.id="sureview_logo_bottom"; bottom_logo_img.src="https://app.sureview.tv/logo/sureview_logo.svg"; bottom_logo_img.style.cssText="height: 18px !important; margin: 0 !important; margin-top: 2px !important; width: 70px !important;"; anchor1.appendChild(bottom_logo_img); bottom_div.appendChild(anchor1); daily_motion_ads.appendChild(bottom_div); is_dm_ready(); } },1000); } } function is_dm_ready(){ var is_dm_sv_ready = setInterval(function(){ if(top.document.querySelectorAll(".dailymotion-player-wrapper .dm__close-button").length > 0){ clearInterval(is_dm_sv_ready); document.querySelector(".dailymotion-player-wrapper .dm__close-button").innerHTML += ''; } },500); } function is_avail_selector(name, by){ if(by==1){ placement_salector=document.getElementsByTagName(name); if(placement_salector.length>0){ return placement_salector; }else{ return 0; } }else if(by==2){ placement_salector=document.getElementsByClassName(name); if(placement_salector.length>0){ return placement_salector; }else{ return 0; } }else if(by==3){ placement_salector=top.document.getElementById(name); if(placement_salector===null){ return 0; }else{ return placement_salector; } }else if(by==4){ placement_salector=document.querySelectorAll(name); if(placement_salector===null){ return 0; }else{ return placement_salector; } }else{ placement_salector=document.getElementById(name); if(placement_salector===null){ return 0; }else{ return placement_salector; } } } function set_bottom_logo(company){ var counter=1; setlogo_intval=setInterval(function(){ counter++; try{ document.getElementById("sureview_branding").remove(); }catch(error){ } var sureview_div=document.getElementById('Sureview108').clientWidth; try{ if(company==1){ var video_div=document.getElementsByClassName('ima-ad-container')[0].clientWidth; }else if(company==2){ var video_div=document.getElementsByClassName('teads-player')[0].clientWidth; }else if(company==4){ var video_div=document.getElementById('ifr_PGRpdiBpZD0ic3VyZXZpZXctc3RpY2t5LWJhbm5lciIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmNmY2ZjYwMDsgcG9zaXRpb246IGZpeGVkOyBib3R0b206IDEwMHB4OyBsZWZ0OjA7IG92ZXJmbG93OiBoaWRkZW47IGRpcmVjdGlvbjogbHRyICFpbXBvcnRhbnQ7IHRyYW5zZm9ybTogc2NhbGUoLjc1ODcyLC43NTg3Mik7IG1heC13aWR0aDogMzAwcHg7IGxlZnQ6IC0zMHB4OyBtYXJnaW46IGF1dG87IHotaW5kZXg6IDk5OTk5OTk5OSAhaW1wb3J0YW50OyI+CiAgICA8c2NyaXB0IGFzeW5jIHNyYz0iaHR0cHM6Ly9zZWN1cmVwdWJhZHMuZy5kb3VibGVjbGljay5uZXQvdGFnL2pzL2dwdC5qcyI+PC9zY3JpcHQ+CiAgICA8ZGl2IGNsYXNzPSJjcm9zcy1zdi1zdGlja3ktYmFubmVyIiBpZD0iY3Jvc3Mtc3Ytc3RpY2t5LWJhbm5lciIgc3R5bGU9ImRpc3BsYXk6bm9uZSI+CiAgICAgICAgPGltZyBpZD0ic3VyZXZpZXctc3RpY2t5LWJhbm5lci1yZW1vdmUiIHNyYz0iZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFEQUFBQUF3Q0FZQUFBQlhBdm1IQUFBQUNYQklXWE1BQUFzVEFBQUxFd0VBbXB3WUFBQUJJRWxFUVZSNG5PMlozUTRCTVJCR3k3c0xG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InN1cmV2aWV3LXN0aWNreS1iYW5uZXItYWRzIiBjbGFzcz0ic3VyZXZpZXctc3RpY2t5LWJhbm5lci1hZHMiIHN0eWxlPSJtYXgtd2lkdGg6IDMwMHB4OyBtYXgtaGVpZ2h0OiAyNTBweDsgbWFyZ2luLWxlZnQ6IDBweCAhaW1wb3J0YW50O21hcmdpbi10b3A6IDBweDsiPgoKICAgICAgICA8c2NyaXB0PgogICAgICAgICAgICB3aW5kb3cuZ29vZ2xldGFnID0gd2luZG93Lmdvb2dsZXRhZyB8fCB7Y21kOiBbXX07CiAgICAgICAgICAgIGdvb2dsZXRhZy5jbWQucHVzaChmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIHN2X3N0aWNreV9zbG90ID0gZ29vZ2xldGFnLmRlZmluZVNsb3QoJy8yMjA1OTQxNjQ3NSwyMjQ3MzkzNTM3My9hbGJpbGFkcHJlc3MuY29tX193aW52aWRfZGlzcGxheV8zMDB4MjUwJywgWzMwMCwgMjUwXSwgJ3N1cmV2aWV3LXN0aWNreS1iYW5uZXItYWRzJykuYWRkU2VydmljZShnb29nbGV0YWcucHViYWRzKCkpOwogICAgICAgICAgICBnb29nbGV0YWcucHViYWRzKCkuc2V0KCdwYWdlX3VybCcsICdhbGJpbGFkcHJlc3MuY29tJyk7CiAgICAgICAgICAgIGdvb2dsZXRhZy5lbmFibGVTZXJ2aWNlcygpOwogICAgICAgICAgICBnb29nbGV0YWcuZGlzcGxheSgnc3VyZXZpZXctc3RpY2t5LWJhbm5lci1hZHMnKTsKICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBzZXRJbnRlcnZhbChmdW5jdGlvbigpewogICAgICAgICAgICAgICAgICAgICAgZ29vZ2xldGFnLnB1YmFkcygpLnJlZnJlc2goW3N2X3N0aWNreV9zbG90XSk7CiAgICAgICAgICAgICAgICB9LCAyMjAwMCk7CiAgICAgICAgICAgIH0pOwogICAgICA8L3NjcmlwdD4KICAgIDwvZGl2PgoKICAgIDxzY3JpcHQ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hlZDsgYm90dG9tOiAwOyBsZWZ0OjA7IG92ZXJmbG93OiBoaWRkZW47IGRpcmVjdGlvbjogbHRyICFpbXBvcnRhbnQ7IHRyYW5zZm9ybTogc2NhbGUoLjc1ODcyLC43NTg3Mik7IG1heC13aWR0aDogMzAwcHg7IG1heC1oZWlnaHQ6IDI1MHB4OyBsZWZ0OiAtMzBweDsgbWFyZ2luOiBhdXRvOyB6LWluZGV4OiA5OTk5OTk5OTkgIWltcG9ydGFudDsiOwogICAgICAgICAgICAgIH0sICIyMjAwMCIpOwogICAgICAgIH07CiAgICA8L3NjcmlwdD4KPC9kaXY+').clientWidth; }else if(company==9){ var video_div=document.getElementsByClassName("dm-player")[0].clientWidth; }else{ video_div=sureview_div; } var diff=(sureview_div)-(video_div); var padd='0px'; if(diff>10){ padd=diff/2+"px"; } var bottom_div = document.createElement("div"); bottom_div.id="sureview_branding"; bottom_div.className="sureviewBottomDiv sureviewtv"; var anchor1=document.createElement("a"); anchor1.href="http://sureview.tv/"; anchor1.target="_BLANK"; var bottom_logo_img = document.createElement("img"); bottom_logo_img.id="sureview_logo_bottom"; bottom_logo_img.src="https://app.sureview.tv/logo/sureview_logo.svg"; anchor1.appendChild(bottom_logo_img); bottom_div.appendChild(anchor1); if(company==1){ try{ vdo_player= document.getElementsByClassName("vdo_content")[0].getElementsByTagName("video-js")[0].getElementsByClassName('ima-ad-container')[0].getElementsByTagName('div')[1].getElementsByTagName('video')[0]; if(vdo_player.duration>5){ x.appendChild(bottom_div); document.getElementById("sureview_logo_bottom").style.padding = "0px "+padd+" 0px 0px"; if(video_div>0){ clearInterval(setlogo_intval); } }else{ if(counter==2){ clearInterval(setlogo_intval); } } }catch(error){ if(counter==2){ clearInterval(setlogo_intval); } } }else if(company==2){ try{ teads_player=document.getElementsByClassName("teads-inread")[0].getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName('video')[0]; if(teads_player.duration>5){ x.appendChild(bottom_div); document.getElementById("sureview_logo_bottom").style.padding = "0px "+padd+" 0px 0px"; if(video_div>0){ clearInterval(setlogo_intval); } }else{ } }catch(error){ } }else if(company==9){ } }catch(Error){ if(counter==10){ clearInterval(setlogo_intval); } } },1000); } function get_video_duration(){ refreshIntervalId=setInterval(function(){ try{ vdo_player= document.getElementsByClassName("vdo_content")[0].getElementsByTagName("video-js")[0].getElementsByClassName('ima-ad-container')[0].getElementsByTagName('div')[1].getElementsByTagName('video')[0]; if(isNaN(vdo_player.duration) || vdo_player.duration==0){ setTimeout(function(){ clearInterval(refreshIntervalId); change_ads(2); },1000); }else{ } }catch(error){ try{ teads_player=document.getElementsByClassName("teads-inread")[0].getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName("iframe")[0].contentDocument.getElementsByTagName('video')[0]; setTimeout(function(){ if(teads_player.currentTime===0){ change_ads(1); clearInterval(refreshIntervalId); }else{ } },10000); if(isNaN(teads_player.duration)){ setTimeout(function(){ change_ads(1); },10000); }else{ if(teads_player.duration==teads_player.currentTime){ setTimeout(function(){ change_ads(1); },10000); } } }catch(error){ clearInterval(refreshIntervalId); try{ teads_player=document.getElementsByClassName("teads-inread")[0].getElementsByTagName("iframe")[0].children; }catch(error){ change_ads(1); } } } }, 10000); } function change_ads(ads_id){ clearInterval(refreshIntervalId); if(ads_id==1){ add_vdo(); }else if(ads_id==2){ add_teads(); } } function add_vdo(){ if(is_active_vdo==1){ set_bottom_logo(1); try{ document.querySelector('script[src*="vdo.ai"]').remove(); }catch(error){ console.log("VDO ERROR",error); } document.getElementsByClassName("sureview-content")[0].innerHTML = ""; running_ads=1; if(placement_salector!=0){ try { placement_salector[no_of_tag].appendChild(x); } catch (exception_var) { } ad_displaying=1; x.appendChild(vdo); (function(v,d,o,ai) {ai=d.createElement('script');ai.defer=true;ai.async=true;ai.src=v.location.protocol+o;d.head.appendChild(ai);})(window, document, '//a.vdo.ai/core/'+vdo_id+'/vdo.ai.js'); }else{ x.appendChild(vdo); (function(v,d,o,ai) {ai=d.createElement('script');ai.defer=true;ai.async=true;ai.src=v.location.protocol+o;d.head.appendChild(ai);})(window, document, '//a.vdo.ai/core/'+vdo_id+'/vdo.ai.js'); } } } function add_teads(){ if(is_active_teads==1){ set_bottom_logo(2); clearInterval(setlogo_intval); document.getElementsByClassName("sureview-content")[0].innerHTML = ""; running_ads=2; if(placement_salector!=0){ ad_displaying=1; x.appendChild(teads_main_div); try { placement_salector[no_of_tag].appendChild(x); }catch (exception_var) { } }else{ x.appendChild(teads_main_div); } } } function remove_logo_2(){ try{ document.getElementById("sureview_branding").remove(); }catch(error){ } } const box = document.getElementById('Sureview108'); document.addEventListener('scroll', function () { var inVpPartial = isElementPartiallyInViewport(box); if(inVpPartial==true){ }else{ } }, { passive: true }); function isElementPartiallyInViewport(el) { if (typeof jQuery !== 'undefined' && el instanceof jQuery) el = el[0]; var rect = el.getBoundingClientRect(); var windowHeight = (window.innerHeight || document.documentElement.clientHeight); var windowWidth = (window.innerWidth || document.documentElement.clientWidth); var vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0); var horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0); return (vertInView && horInView); } })();