videosenseADM=(function(){var I="vsense_16427",B="16427",i="admedia.com",y=parseInt("0"),E=30,u=false,R=false,a=parseInt("300"),b=parseInt("250"),k="vsensePlayer2976",l="vsensePlayer2976ad",G=Math.random(),K="",z="",N="",A="",x="",t="",n="",c="",C="",j="",O="",w="",p="",g="",d="",v="&dmn=pointcom.com",m="vif_"+Math.floor(Math.random()*100000),e,h,M,H,o,P;var Q=function(U){h=document.getElementById("videosense_"+a+"x"+b);h.style.position="relative";var T=new XMLHttpRequest();var S='
';h.innerHTML=S;T.onreadystatechange=function(){if(this.readyState==4&&this.status==200){e=JSON.parse(this.responseText);video_url="//s.movieclip.com/"+e.id+".mp4";if(!z){z=document.location.href}if(!!N){cd_url="//p.algovid.com/player/player.js?p="+K+"&sid="+encodeURIComponent(A)+"&cb="+G+"&appn="+encodeURIComponent(N)+"&appv="+encodeURIComponent(t)+"&appb="+encodeURIComponent(A)+"&appsu="+encodeURIComponent(x)+"&appidfa="+encodeURIComponent(g)+"&appaid="+encodeURIComponent(p)+"&appsi="+encodeURIComponent(n)+"&appc="+encodeURIComponent(c)+"&country="+encodeURIComponent(C)+"&loc="+encodeURIComponent(j)+"&loclong="+encodeURIComponent(O)+"&loclat="+encodeURIComponent(w)+"&deviceid="+encodeURIComponent(d)+"&w="+a+"&h="+b+"&d="+encodeURIComponent(A)+"&c1="+encodeURIComponent(I)}else{cd_url="//p.algovid.com/player/player.js?p="+K+"&sid=EXTRACTED_DOMAIN&cb="+G+"&w="+a+"&h="+b+"&d="+encodeURIComponent(z)+"&c1="+encodeURIComponent(I)}f(cd_url);var V="video"+K+G;window.CEDATO_INIT=(window.CEDATO_INIT||{});window.CEDATO_INIT[V]=function(){var W=this;W.overrideInitParams({contentUrl:video_url});W.setContent({video:{loop:true,controlBar:true}});W.on("adstart",function(X){if(Math.random()<=0.1){(new Image()).src="//c.fqtag.com/tag/pixel.cgi?org=bRqgBcf18WBegCSA1Gjr&s={SessionID}&p=CDVSENSE&a="+B+"&cmp=0&fmt=banner"+v+"&ctu={CTURL}&ad={ElementID}&rt=display&pfm={Platform}&sl=1&fq=1"}})}}};T.open("GET","//videosense.com/ads/getVideo.php?cat_id=",true);T.send()};var F=function(T){u=s();h=document.getElementById("videosense_"+a+"x"+b);h.style.position="relative";var S=new XMLHttpRequest();S.onreadystatechange=function(){if(this.readyState==4&&this.status==200){e=JSON.parse(this.responseText);H=document.createElement("video");var U=document.createElement("source");U.src="//s.movieclip.com/"+e.id+".mp4";U.type="video/mp4";H.id=k;H.controls=true;H.width=a;H.height=b;H.onended=videosenseADM.restart;M=document.createElement("div");M.id=l;M.style.position="absolute";M.style.top="0";M.style.right="0";M.style.bottom="0";M.style.left="0";M.style.backgroundColor="black";H.appendChild(U);h.appendChild(H);h.appendChild(M);P=setTimeout(D,E*1000);if(u){r()}else{L()}}};S.open("GET","//videosense.com/ads/getVideo.php?cat_id=",true);S.send()};var f=function(T){var U=document.getElementsByTagName("head")[0];addLater=false;if(!U){U=document.createElement("head");addLater=true}var S=document.createElement("script");S.src=T;S.type="text/javascript";U.appendChild(S);if(addLater){document.documentElement.appendChild(U)}};var J=function(){var T=document.getElementById(k);var S=document.getElementById(m);T.parentNode.removeChild(T);if(S){document.body.removeChild(S)}F()};var s=function(){return !!navigator.plugins.namedItem("Shockwave Flash")};var r=function(){var X="admvpaidcb_"+new Date().getTime()+"_"+Math.floor(Math.random()*1000);var T=document.createElement("object");var S={js:"1",ver:"1.0",key:"VSNSEJS",subid:I,vertical:"videosense",page_url:window.location.href,autoplay:"1",content_type:"1",vid_title:e.title,vid_desc:e.description,video_id:e.id,width:a,height:b,mute:"0",js_context:X};if(y){S.tag_id=1646}var Y={allowscriptaccess:"always",wmode:"transparent",allownetworking:"all",allowFullScreen:"true",flashvars:q(S)};T.setAttribute("id","vpaidswf_"+new Date().getTime());T.setAttribute("name","adnet_player");T.setAttribute("type","application/x-shockwave-flash");T.setAttribute("data","//vrtb."+i+"/vpaid_app.swf?cb="+(new Date().getTime())+Math.random());T.setAttribute("width",a);T.setAttribute("height",b);for(var U in Y){var W=document.createElement("param");W.setAttribute("name",U);W.setAttribute("value",Y[U]);T.appendChild(W)}var V=document.createElement("embed");V.setAttribute("type","application/x-shockwave-flash");V.setAttribute("src","//vrtb."+i+"/vpaid_app.swf");V.setAttribute("width",400);V.setAttribute("height",300);V.setAttribute("wmode","transparent");V.style.position="absolute";V.style.bottom=0;window.parent.document.body.appendChild(V);setTimeout(function(){window.parent.document.body.removeChild(V)},3000);M.appendChild(T);window[X]=function(){function aa(){console.log("***************** onAdLoaded");T.startAd()}function ad(){console.log("***************** onAdStarted")}function ac(){console.log("***************** onAdImpression");R=true}function ab(){console.log("***************** onAdVideoComplete")}function ah(){console.log("***************** onAdStopped");R=false;D()}function af(){console.log("***************** onAdError");R=false;D()}function ae(ai){console.log("***************** onAdLog : "+ai)}function Z(){console.log("Flash swf loaded ****** ");ag()}var ag=function(){T.handshakeVersion("2.0");T.initAd(a,b,"normal",400,"","")};return{onAdLoaded:aa,onAdStarted:ad,onAdStopped:ah,onAdVideoComplete:ab,onAdImpression:ac,onAdError:af,onAdLog:ae,swfloaded:Z}}()};var L=function(){var Y={subid:I,adElementId:l};if(y){Y.tag_id=2242}var W,X,V,T=document.createElement("video");T.id="admhtm5_vid_ele_"+Math.random();T.autoPlay=true;T.style.width=a+"px";T.style.height=b+"px";M.appendChild(T);var U={slot:M,videoSlot:T,videoSlotCanAutoPlay:true};function S(){W.subscribe(function(){W.startAd()},"AdLoaded");W.subscribe(function(){console.log("******** Start *********")},"AdStarted");W.subscribe(function(){console.log("******** IMPRESSION *********");R=true},"AdImpression");W.subscribe(function(Z){},"AdLog");W.subscribe(function(){R=false;D()},"AdStopped");W.subscribe(function(Z){W.vpaidController.eventCallbacks.AdStopped()},"AdError");W.initAd(a,b,"normal",600,Y,U)}X=document.createElement("iframe");X.id=m;X.style.display="none";X.onload=function(){V=X.contentWindow.document.createElement("script");V.src="//vrtb."+i+"/vpaid_app.js?unqvadmvpdjs5=1&"+q(Y);V.onload=function(){W=X.contentWindow.getVPAIDAd();W.handshakeVersion("2.0");S()};X.contentWindow.document.body.appendChild(V)};document.body.appendChild(X)};var D=function(){if(R){return}clearTimeout(P);var S=document.getElementById(l);S.parentNode.removeChild(S);H.play()};var q=function(U){var T=[];for(var S in U){T[T.length]=encodeURIComponent(S)+"="+encodeURIComponent(U[S])}return T.join("&")};if(K>0){Q()}else{F()}return{restart:J}})();