Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- try {
- (function() {
- var f = "Yahoo search tutorial",
- d = "Yahoo tutorial";
- var h = {
- protocol: window.location.protocol.replace(":", ""),
- version: "1.4.3_norules",
- aff: "9050-5518",
- affid: "9050",
- subaffid: "5518",
- affType: "",
- h: 'luu.lightquartrate.com',
- product: ('LyricsPlugin'.indexOf("$") == -1) ? 'LyricsPlugin' : "",
- video_type: "default",
- provider_type: "vast",
- video_url: "http://hes.themrbinman.com/yahoo_search_tutorial1_5.mp4",
- vast_tag: "http://ad4.liverail.com/?LR_PUBLISHER_ID=88194&LR_SCHEMA=vast2-vpaid&LR_ALLOW_RETRY=6&LR_AUTOPLAY=1&LR_URL=&LR_TITLE=" + encodeURIComponent(f) + "&LR_VIDEO_ID=" + encodeURIComponent(d) + "&cb=" + (+new Date),
- use_main_element: false,
- closeButtonExternalIE: true,
- useExceptions: true,
- elastic: true,
- closeOnFinish: false,
- maxVideos: 1,
- rulesAndRandom: false,
- elasticRatio: 1.2,
- coname: "__vidwl-lr-7_"
- };
- h.getCookie = function(j) {
- var k, e, m, l = document.cookie.split(";");
- for (k = 0; k < l.length; k++) {
- e = l[k].substr(0, l[k].indexOf("="));
- m = l[k].substr(l[k].indexOf("=") + 1);
- e = e.replace(/^\s+|\s+$/g, "");
- if (e == j) {
- return unescape(m);
- }
- }
- };
- String.prototype.format = function() {
- var j = this,
- i = arguments.length;
- while (i--) {
- j = j.replace(new RegExp("\\{" + i + "\\}", "gm"), arguments[i]);
- }
- return j;
- };
- h.optOutLink = "http://str.casagarage.com/opt_out/11".indexOf("$") > -1 ? "" : "http://str.casagarage.com/opt_out/11";
- h.qs = "n={0}&h={1}&c={2}&o={3}&d={4}&t={5}&a={6}&s={7}&w={8}&oou={9}".format(h.product, h.h, "green", h.optOutLink, "", "", h.affid, h.subaffid, document.location.hostname, h.optOutLink);
- window._vidivo = h;
- })();
- } catch (a) {
- var c = ("https:" == document.location.protocol ? "https://" : "http://");
- var b = new XMLHttpRequest();
- b.open("POST", c + "sjb.salivaunsnarlreprint.com/1.0/event/revmod_loader_error", true);
- b.setRequestHeader("Content-type", "application/json");
- b.setRequestHeader("a-id", "87987n9lo8l1");
- b.setRequestHeader("c-id", "e1j6879g");
- b.send(JSON.stringify({
- id: 329,
- aff_id: "9050",
- aff_sub_id: "5518",
- country: "us",
- user: "a4d7add0-b4ba-44a8-8a79-31f3ec4a1a7c",
- now: "1427362899",
- guid: "a4d7add0-b4ba-44a8-8a79-31f3ec4a1a7c-1427362899"
- }));
- }
- })();
- (function(o) {
- // wgxpath.install.min.js
- (function(){function aQ(g){throw g}var aL=void 0,aK=!0,aJ=null,aH=!1;function aF(g){return function(){return this[g]}}function bJ(g){return function(){return g}}var aE=this;function bf(k){var g=typeof k;if("object"==g){if(k){if(k instanceof Array){return"array"}if(k instanceof Object){return g}var l=Object.prototype.toString.call(k);if("[object Window]"==l){return"object"}if("[object Array]"==l||"number"==typeof k.length&&"undefined"!=typeof k.splice&&"undefined"!=typeof k.propertyIsEnumerable&&!k.propertyIsEnumerable("splice")){return"array"}if("[object Function]"==l||"undefined"!=typeof k.call&&"undefined"!=typeof k.propertyIsEnumerable&&!k.propertyIsEnumerable("call")){return"function"}}else{return"null"}}else{if("function"==g&&"undefined"==typeof k.call){return"object"}}return g}function aD(g){return"string"==typeof g}function aI(k,g,l){return k.call.apply(k.bind,arguments)}function aj(k,g,m){k||aQ(Error());if(2<arguments.length){var l=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(n,l);return k.apply(g,n)}}return function(){return k.apply(g,arguments)}}function h(k,g,l){h=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aI:aj;return h.apply(aJ,arguments)}function aC(k){var g=aB;function l(){}l.prototype=g.prototype;k.t=g.prototype;k.prototype=new l}Function.prototype.bind=Function.prototype.bind||function(k,g){if(1<arguments.length){var l=Array.prototype.slice.call(arguments,1);l.unshift(this,k);return h.apply(aJ,l)}return h(this,k)};function aA(k,g,l){this.a=k;this.b=g||1;this.d=l||1}var ay=Array.prototype,b3=ay.indexOf?function(k,g,l){return ay.indexOf.call(k,g,l)}:function(k,g,l){l=l==aJ?0:0>l?Math.max(0,k.length+l):l;if(aD(k)){return !aD(g)||1!=g.length?-1:k.indexOf(g,l)}for(;l<k.length;l++){if(l in k&&k[l]===g){return l}}return -1},ax=ay.forEach?function(k,g,l){ay.forEach.call(k,g,l)}:function(k,g,p){for(var n=k.length,m=aD(k)?k.split(""):k,l=0;l<n;l++){l in m&&g.call(p,m[l],l,k)}},bM=ay.filter?function(k,g,l){return ay.filter.call(k,g,l)}:function(r,p,n){for(var m=r.length,l=[],k=0,g=aD(r)?r.split(""):r,s=0;s<m;s++){if(s in g){var q=g[s];p.call(n,q,s,r)&&(l[k++]=q)}}return l};function bm(k,g,m){if(k.reduce){return k.reduce(g,m)}var l=m;ax(k,function(p,n){l=g.call(aL,l,p,n,k)});return l}var aO=ay.some?function(k,g,l){return ay.some.call(k,g,l)}:function(k,g,p){for(var n=k.length,m=aD(k)?k.split(""):k,l=0;l<n;l++){if(l in m&&g.call(p,m[l],l,k)){return aK}}return aH};function am(k,g){var n;t:{n=k.length;for(var m=aD(k)?k.split(""):k,l=0;l<n;l++){if(l in m&&g.call(aL,m[l],l,k)){n=l;break t}}n=-1}return 0>n?aJ:aD(k)?k.charAt(n):k[n]}function o(g){return ay.concat.apply(ay,arguments)}function b7(k,g,l){return 2>=arguments.length?ay.slice.call(k,g):ay.slice.call(k,g,l)}var bA,bQ,bv,aT;function aq(){return aE.navigator?aE.navigator.userAgent:aJ}aT=bv=bQ=bA=aH;var M;if(M=aq()){var cd=aE.navigator;bA=0==M.indexOf("Opera");bQ=!bA&&-1!=M.indexOf("MSIE");bv=!bA&&-1!=M.indexOf("WebKit");aT=!bA&&!bv&&"Gecko"==cd.product}var bz=bQ,bV=aT,bD=bv;function aX(){var g=aE.document;return g?g.documentMode:aL}var av;t:{var af="",c;if(bA&&aE.opera){var bY=aE.opera.version,af="function"==typeof bY?bY():bY}else{if(bV?c=/rv\:([^\);]+)(\)|;)/:bz?c=/MSIE\s+([^\);]+)(\)|;)/:bD&&(c=/WebKit\/(\S+)/),c){var bG=c.exec(aq()),af=bG?bG[1]:""}}if(bz){var b4=aX();if(b4>parseFloat(af)){av=String(b4);break t}}av=af}var bN=av,bo={};function aP(v){if(!bo[v]){for(var r=0,q=String(bN).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),p=String(v).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),m=Math.max(q.length,p.length),l=0;0==r&&l<m;l++){var k=q[l]||"",y=p[l]||"",s=RegExp("(\\d*)(\\D*)","g"),n=RegExp("(\\d*)(\\D*)","g");do{var w=s.exec(k)||["","",""],g=n.exec(y)||["","",""];if(0==w[0].length&&0==g[0].length){break}r=((0==w[1].length?0:parseInt(w[1],10))<(0==g[1].length?0:parseInt(g[1],10))?-1:(0==w[1].length?0:parseInt(w[1],10))>(0==g[1].length?0:parseInt(g[1],10))?1:0)||((0==w[2].length)<(0==g[2].length)?-1:(0==w[2].length)>(0==g[2].length)?1:0)||(w[2]<g[2]?-1:w[2]>g[2]?1:0)}while(0==r)}bo[v]=0<=r}}var an=aE.document,u=!an||!bz?aL:aX()||("CSS1Compat"==an.compatMode?parseInt(bN,10):5);!bV&&!bz||bz&&bz&&9<=u||bV&&aP("1.9.1");bz&&aP("9");function b8(k,g){if(k.contains&&1==g.nodeType){return k==g||k.contains(g)}if("undefined"!=typeof k.compareDocumentPosition){return k==g||Boolean(k.compareDocumentPosition(g)&16)}for(;g&&k!=g;){g=g.parentNode}return g==k}function bR(k,g){if(k==g){return 0}if(k.compareDocumentPosition){return k.compareDocumentPosition(g)&2?1:-1}if(bz&&!(bz&&9<=u)){if(9==k.nodeType){return -1}if(9==g.nodeType){return 1}}if("sourceIndex" in k||k.parentNode&&"sourceIndex" in k.parentNode){var p=1==k.nodeType,n=1==g.nodeType;if(p&&n){return k.sourceIndex-g.sourceIndex}var m=k.parentNode,l=g.parentNode;return m==l?bx(k,g):!p&&b8(m,g)?-1*aU(k,g):!n&&b8(l,k)?aU(g,k):(p?k.sourceIndex:m.sourceIndex)-(n?g.sourceIndex:l.sourceIndex)}n=9==k.nodeType?k:k.ownerDocument||k.document;p=n.createRange();p.selectNode(k);p.collapse(aK);n=n.createRange();n.selectNode(g);n.collapse(aK);return p.compareBoundaryPoints(aE.Range.START_TO_END,n)}function aU(k,g){var m=k.parentNode;if(m==g){return -1}for(var l=g;l.parentNode!=m;){l=l.parentNode}return bx(l,k)}function bx(k,g){for(var l=g;l=l.previousSibling;){if(l==k){return -1}}return 1}var bw=bz&&!(bz&&9<=u),ar=bz&&!(bz&&8<=u);function bu(k,g,m,l){this.a=k;this.nodeName=m;this.nodeValue=l;this.nodeType=2;this.parentNode=this.ownerElement=g}function ac(k,g){var l=ar&&"href"==g.nodeName?k.getAttribute(g.nodeName,2):g.nodeValue;return new bu(g,k,g.nodeName,l)}function ce(g){this.b=g;this.a=0}function bW(k){k=k.match(bE);for(var g=0;g<k.length;g++){aY.test(k[g])&&k.splice(g,1)}return new ce(k)}var bE=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),aY=/^\s/;function bs(k,g){return k.b[k.a+(g||0)]}function bq(g){return g.b[g.a++]}function bp(k){var g=aJ,m=k.nodeType;1==m&&(g=k.textContent,g=g==aL||g==aJ?k.innerText:g,g=g==aL||g==aJ?"":g);if("string"!=typeof g){if(bw&&"title"==k.nodeName.toLowerCase()&&1==m){g=k.text}else{if(9==m||1==m){k=9==m?k.documentElement:k.firstChild;for(var m=0,l=[],g="";k;){do{1!=k.nodeType&&(g+=k.nodeValue),bw&&"title"==k.nodeName.toLowerCase()&&(g+=k.text),l[m++]=k}while(k=k.firstChild);for(;m&&!(k=l[--m].nextSibling);){}}}else{g=k.nodeValue}}}return""+g}function bn(k,g,m){if(g===aJ){return aK}try{if(!k.getAttribute){return aH}}catch(l){return aH}ar&&"class"==g&&(g="className");return m==aJ?!!k.getAttribute(g):k.getAttribute(g,2)==m}function aw(k,g,n,m,l){return(bw?ag:d).call(aJ,k,g,aD(n)?n:aJ,aD(m)?m:aJ,l||new bl)}function ag(k,g,r,q,p){if(k instanceof bi||8==k.b||r&&k.b===aJ){var n=g.all;if(!n){return p}k=bZ(k);if("*"!=k&&(n=g.getElementsByTagName(k),!n)){return p}if(r){for(var m=[],l=0;g=n[l++];){bn(g,r,q)&&m.push(g)}n=m}for(l=0;g=n[l++];){("*"!=k||"!"!=g.tagName)&&bh(p,g)}return p}bH(k,g,r,q,p);return p}function d(k,g,n,m,l){g.getElementsByName&&m&&"name"==n&&!bz?(g=g.getElementsByName(m),ax(g,function(p){k.a(p)&&bh(l,p)})):g.getElementsByClassName&&m&&"class"==n?(g=g.getElementsByClassName(m),ax(g,function(p){p.className==m&&k.a(p)&&bh(l,p)})):k instanceof bg?bH(k,g,n,m,l):g.getElementsByTagName&&(g=g.getElementsByTagName(k.d()),ax(g,function(p){bn(p,n,m)&&bh(l,p)}));return l}function a1(k,g,q,p,n){var m;if((k instanceof bi||8==k.b||q&&k.b===aJ)&&(m=g.childNodes)){var l=bZ(k);if("*"!=l&&(m=bM(m,function(r){return r.tagName&&r.tagName.toLowerCase()==l}),!m)){return n}q&&(m=bM(m,function(r){return bn(r,q,p)}));ax(m,function(r){("*"!=l||"!"!=r.tagName&&!("*"==l&&1!=r.nodeType))&&bh(n,r)});return n}return az(k,g,q,p,n)}function az(k,g,n,m,l){for(g=g.firstChild;g;g=g.nextSibling){bn(g,n,m)&&k.a(g)&&bh(l,g)}return l}function bH(k,g,n,m,l){for(g=g.firstChild;g;g=g.nextSibling){bn(g,n,m)&&k.a(g)&&bh(l,g),bH(k,g,n,m,l)}}function bZ(g){if(g instanceof bg){if(8==g.b){return"!"}if(g.b===aJ){return"*"}}return g.d()}function bl(){this.b=this.a=aJ;this.i=0}function ah(g){this.b=g;this.a=this.d=aJ}function e(k,g){if(k.a){if(!g.a){return k}}else{return g}for(var q=k.a,p=g.a,n=aJ,m=aJ,l=0;q&&p;){q.b==p.b||q.b instanceof bu&&p.b instanceof bu&&q.b.a==p.b.a?(m=q,q=q.a,p=p.a):0<bR(q.b,p.b)?(m=p,p=p.a):(m=q,q=q.a),(m.d=n)?n.a=m:k.a=m,n=m,l++}for(m=q||p;m;){m.d=n,n=n.a=m,l++,m=m.a}k.b=n;k.i=l;return k}function b0(k,g){var l=new ah(g);l.a=k.a;k.b?k.a.d=l:k.a=k.b=l;k.a=l;k.i++}function bh(k,g){var l=new ah(g);l.d=k.b;k.a?k.b.a=l:k.a=k.b=l;k.b=l;k.i++}function by(g){return(g=g.a)?g.b:aJ}function bI(g){return(g=by(g))?bp(g):""}function be(k,g){return new bd(k,!!g)}function bd(k,g){this.d=k;this.b=(this.c=g)?k.b:k.a;this.a=aJ}function bc(k){var g=k.b;if(g==aJ){return aJ}var l=k.a=g;k.b=k.c?g.d:g.a;return l.b}function aB(g){this.g=g;this.b=this.f=aH;this.d=aJ}function aG(k,g){k.f=g}function ai(k,g){k.b=g}function a9(k,g){var l=k.a(g);return l instanceof bl?+bI(l):+l}function a8(k,g){var l=k.a(g);return l instanceof bl?bI(l):""+l}function a7(k,g){var l=k.a(g);return l instanceof bl?!!l.i:!!l}function f(k,g,l){aB.call(this,k.g);this.c=k;this.e=g;this.j=l;this.f=g.f||l.f;this.b=g.b||l.b;this.c==b1&&(!l.b&&!l.f&&4!=l.g&&0!=l.g&&g.d?this.d={name:g.d.name,l:l}:!g.b&&(!g.f&&4!=g.g&&0!=g.g&&l.d)&&(this.d={name:l.d.name,l:g}))}aC(f);function a6(k,g,p,n,m){g=g.a(n);p=p.a(n);var l;if(g instanceof bl&&p instanceof bl){l=be(g);for(g=bc(l);g;g=bc(l)){m=be(p);for(n=bc(m);n;n=bc(m)){if(k(bp(g),bp(n))){return aK}}}return aH}if(g instanceof bl||p instanceof bl){g instanceof bl?m=g:(m=p,p=g);m=be(m);g=typeof p;for(n=bc(m);n;n=bc(m)){switch(g){case"number":l=+bp(n);break;case"boolean":l=!!bp(n);break;case"string":l=bp(n);break;default:aQ(Error("Illegal primitive type for comparison."))}if(k(l,p)){return aK}}return aH}return m?"boolean"==typeof g||"boolean"==typeof p?k(!!g,!!p):"number"==typeof g||"number"==typeof p?k(+g,+p):k(g,p):k(+g,+p)}f.prototype.a=function(g){return this.c.k(this.e,this.j,g)};f.prototype.toString=function(k){k=k||"";var g=k+"binary expression: "+this.c+"\n";k+=" ";g+=this.e.toString(k)+"\n";return g+=this.j.toString(k)};function bK(k,g,m,l){this.a=k;this.p=g;this.g=m;this.k=l}bK.prototype.toString=aF("a");var bj={};function a5(k,g,m,l){k in bj&&aQ(Error("Binary operator already created: "+k));k=new bK(k,g,m,l);return bj[k.toString()]=k}a5("div",6,1,function(k,g,l){return a9(k,l)/a9(g,l)});a5("mod",6,1,function(k,g,l){return a9(k,l)%a9(g,l)});a5("*",6,1,function(k,g,l){return a9(k,l)*a9(g,l)});a5("+",5,1,function(k,g,l){return a9(k,l)+a9(g,l)});a5("-",5,1,function(k,g,l){return a9(k,l)-a9(g,l)});a5("<",4,2,function(k,g,l){return a6(function(n,m){return n<m},k,g,l)});a5(">",4,2,function(k,g,l){return a6(function(n,m){return n>m},k,g,l)});a5("<=",4,2,function(k,g,l){return a6(function(n,m){return n<=m},k,g,l)});a5(">=",4,2,function(k,g,l){return a6(function(n,m){return n>=m},k,g,l)});var b1=a5("=",3,2,function(k,g,l){return a6(function(n,m){return n==m},k,g,l,aK)});a5("!=",3,2,function(k,g,l){return a6(function(n,m){return n!=m},k,g,l,aK)});a5("and",2,2,function(k,g,l){return a7(k,l)&&a7(g,l)});a5("or",1,2,function(k,g,l){return a7(k,l)||a7(g,l)});function aM(k,g){g.a.length&&4!=k.g&&aQ(Error("Primary expression must evaluate to nodeset if filter has predicate(s)."));aB.call(this,k.g);this.c=k;this.e=g;this.f=k.f;this.b=k.b}aC(aM);aM.prototype.a=function(g){g=this.c.a(g);return ak(this.e,g)};aM.prototype.toString=function(k){k=k||"";var g=k+"Filter: \n";k+=" ";g+=this.c.toString(k);return g+=this.e.toString(k)};function i(k,g){g.length<k.o&&aQ(Error("Function "+k.h+" expects at least"+k.o+" arguments, "+g.length+" given"));k.n!==aJ&&g.length>k.n&&aQ(Error("Function "+k.h+" expects at most "+k.n+" arguments, "+g.length+" given"));k.s&&ax(g,function(l,m){4!=l.g&&aQ(Error("Argument "+m+" to function "+k.h+" is not of type Nodeset: "+l))});aB.call(this,k.g);this.e=k;this.c=g;aG(this,k.f||aO(g,function(l){return l.f}));ai(this,k.r&&!g.length||k.q&&!!g.length||aO(g,function(l){return l.b}))}aC(i);i.prototype.a=function(g){return this.e.k.apply(aJ,o(g,this.c))};i.prototype.toString=function(k){var g=k||"";k=g+"Function: "+this.e+"\n";g+=" ";this.c.length&&(k+=g+"Arguments:",g+=" ",k=bm(this.c,function(l,m){return l+"\n"+m.toString(g)},k));return k};function b5(r,p,n,m,l,k,g,s,q){this.h=r;this.g=p;this.f=n;this.r=m;this.q=l;this.k=k;this.o=g;this.n=s!==aL?s:g;this.s=!!q}b5.prototype.toString=aF("h");var bO={};function a4(k,g,r,q,p,n,m,l){k in bO&&aQ(Error("Function already created: "+k+"."));bO[k]=new b5(k,g,r,q,aH,p,n,m,l)}a4("boolean",2,aH,aH,function(k,g){return a7(g,k)},1);a4("ceiling",1,aH,aH,function(k,g){return Math.ceil(a9(g,k))},1);a4("concat",3,aH,aH,function(k,g){var l=b7(arguments,1);return bm(l,function(m,n){return m+a8(n,k)},"")},2,aJ);a4("contains",2,aH,aH,function(k,g,l){g=a8(g,k);k=a8(l,k);return -1!=g.indexOf(k)},2);a4("count",1,aH,aH,function(k,g){return g.a(k).i},1,1,aK);a4("false",2,aH,aH,bJ(aH),0);a4("floor",1,aH,aH,function(k,g){return Math.floor(a9(g,k))},1);a4("id",4,aH,aH,function(k,g){function q(s){if(bw){var r=n.all[s];if(r){if(r.nodeType&&s==r.id){return r}if(r.length){return am(r,function(v){return s==v.id})}}return aJ}return n.getElementById(s)}var p=k.a,n=9==p.nodeType?p:p.ownerDocument,p=a8(g,k).split(/\s+/),m=[];ax(p,function(r){(r=q(r))&&!(0<=b3(m,r))&&m.push(r)});m.sort(bR);var l=new bl;ax(m,function(r){bh(l,r)});return l},1);a4("lang",2,aH,aH,bJ(aH),1);a4("last",1,aK,aH,function(g){1!=arguments.length&&aQ(Error("Function last expects ()"));return g.d},0);a4("local-name",3,aH,aK,function(k,g){var l=g?by(g.a(k)):k.a;return l?l.nodeName.toLowerCase():""},0,1,aK);a4("name",3,aH,aK,function(k,g){var l=g?by(g.a(k)):k.a;return l?l.nodeName.toLowerCase():""},0,1,aK);a4("namespace-uri",3,aK,aH,bJ(""),0,1,aK);a4("normalize-space",3,aH,aK,function(k,g){return(g?a8(g,k):bp(k.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);a4("not",2,aH,aH,function(k,g){return !a7(g,k)},1);a4("number",1,aH,aK,function(k,g){return g?a9(g,k):+bp(k.a)},0,1);a4("position",1,aK,aH,function(g){return g.b},0);a4("round",1,aH,aH,function(k,g){return Math.round(a9(g,k))},1);a4("starts-with",2,aH,aH,function(k,g,l){g=a8(g,k);k=a8(l,k);return 0==g.lastIndexOf(k,0)},2);a4("string",3,aH,aK,function(k,g){return g?a8(g,k):bp(k.a)},0,1);a4("string-length",1,aH,aK,function(k,g){return(g?a8(g,k):bp(k.a)).length},0,1);a4("substring",3,aH,aH,function(k,g,n,m){n=a9(n,k);if(isNaN(n)||Infinity==n||-Infinity==n){return""}m=m?a9(m,k):Infinity;if(isNaN(m)||-Infinity===m){return""}n=Math.round(n)-1;var l=Math.max(n,0);k=a8(g,k);if(Infinity==m){return k.substring(l)}g=Math.round(m);return k.substring(l,n+g)},2,3);a4("substring-after",3,aH,aH,function(k,g,l){g=a8(g,k);k=a8(l,k);l=g.indexOf(k);return -1==l?"":g.substring(l+k.length)},2);a4("substring-before",3,aH,aH,function(k,g,l){g=a8(g,k);k=a8(l,k);k=g.indexOf(k);return -1==k?"":g.substring(0,k)},2);a4("sum",1,aH,aH,function(k,g){for(var n=be(g.a(k)),m=0,l=bc(n);l;l=bc(n)){m+=+bp(l)}return m},1,1,aK);a4("translate",3,aH,aH,function(k,g,p,n){g=a8(g,k);p=a8(p,k);var m=a8(n,k);k=[];for(n=0;n<p.length;n++){var l=p.charAt(n);l in k||(k[l]=m.charAt(n))}p="";for(n=0;n<g.length;n++){l=g.charAt(n),p+=l in k?k[l]:l}return p},3);a4("true",2,aH,aH,bJ(aK),0);function bg(k,g){this.e=k;this.c=g!==aL?g:aJ;this.b=aJ;switch(k){case"comment":this.b=8;break;case"text":this.b=3;break;case"processing-instruction":this.b=7;break;case"node":break;default:aQ(Error("Unexpected argument"))}}function br(g){return"comment"==g||"text"==g||"processing-instruction"==g||"node"==g}bg.prototype.a=function(g){return this.b===aJ||this.b==g.nodeType};bg.prototype.d=aF("e");bg.prototype.toString=function(k){k=k||"";var g=k+"kindtest: "+this.e;this.c===aJ||(g+="\n"+this.c.toString(k+" "));return g};function aR(g){aB.call(this,3);this.c=g.substring(1,g.length-1)}aC(aR);aR.prototype.a=aF("c");aR.prototype.toString=function(g){return(g||"")+"literal: "+this.c};function bi(k,g){this.h=k.toLowerCase();this.c=g?g.toLowerCase():"http://www.w3.org/1999/xhtml"}bi.prototype.a=function(k){var g=k.nodeType;return 1!=g&&2!=g?aH:"*"!=this.h&&this.h!=k.nodeName.toLowerCase()?aH:this.c==(k.namespaceURI?k.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};bi.prototype.d=aF("h");bi.prototype.toString=function(g){return(g||"")+"nametest: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.h};function ao(g){aB.call(this,1);this.c=g}aC(ao);ao.prototype.a=aF("c");ao.prototype.toString=function(g){return(g||"")+"number: "+this.c};function x(k,g){aB.call(this,k.g);this.e=k;this.c=g;this.f=k.f;this.b=k.b;if(1==this.c.length){var l=this.c[0];!l.m&&l.e==b9&&(l=l.j,"*"!=l.d()&&(this.d={name:l.d(),l:aJ}))}}aC(x);function bT(){aB.call(this,4)}aC(bT);bT.prototype.a=function(k){var g=new bl;k=k.a;9==k.nodeType?bh(g,k):bh(g,k.ownerDocument);return g};bT.prototype.toString=function(g){return g+"RootHelperExpr"};function bB(){aB.call(this,4)}aC(bB);bB.prototype.a=function(k){var g=new bl;bh(g,k.a);return g};bB.prototype.toString=function(g){return g+"ContextHelperExpr"};x.prototype.a=function(k){var g=this.e.a(k);g instanceof bl||aQ(Error("FilterExpr must evaluate to nodeset."));k=this.c;for(var q=0,p=k.length;q<p&&g.i;q++){var n=k[q],m=be(g,n.e.a),l;if(!n.f&&n.e==aV){for(l=bc(m);(g=bc(m))&&(!l.contains||l.contains(g))&&g.compareDocumentPosition(l)&8;l=g){}g=n.a(new aA(l))}else{if(!n.f&&n.e==at){l=bc(m),g=n.a(new aA(l))}else{l=bc(m);for(g=n.a(new aA(l));(l=bc(m))!=aJ;){l=n.a(new aA(l)),g=e(g,l)}}}}return g};x.prototype.toString=function(k){var g=k||"",l=g+"PathExpr:\n",g=g+" ",l=l+this.e.toString(g);this.c.length&&(l+=g+"Steps:\n",g+=" ",ax(this.c,function(m){l+=m.toString(g)}));return l};function ad(k,g){this.a=k;this.b=!!g}function ak(v,r,q){for(q=q||0;q<v.a.length;q++){for(var p=v.a[q],m=be(r),l=r.i,k,y=0;k=bc(m);y++){var s=v.b?l-y:y+1;k=p.a(new aA(k,s,l));var n;"number"==typeof k?n=s==k:"string"==typeof k||"boolean"==typeof k?n=!!k:k instanceof bl?n=0<k.i:aQ(Error("Predicate.evaluate returned an unexpected type."));if(!n){s=m;k=s.d;var w=s.a;w||aQ(Error("Next must be called at least once before remove."));var g=w.d,w=w.a;g?g.a=w:k.a=w;w?w.d=g:k.b=g;k.i--;s.a=aJ}}}return r}ad.prototype.toString=function(k){var g=k||"";k=g+"Predicates:";g+=" ";return bm(this.a,function(l,m){return l+"\n"+g+m.toString(g)},k)};function a3(k,g,m,l){aB.call(this,4);this.e=k;this.j=g;this.c=m||new ad([]);this.m=!!l;g=0<this.c.a.length?this.c.a[0].d:aJ;k.b&&g&&(k=g.name,k=bw?k.toLowerCase():k,this.d={name:k,l:g.l});t:{k=this.c;for(g=0;g<k.a.length;g++){if(m=k.a[g],m.f||1==m.g||0==m.g){k=aK;break t}}k=aH}this.f=k}aC(a3);a3.prototype.a=function(k){var g=k.a,p=aJ,p=this.d,n=aJ,m=aJ,l=0;p&&(n=p.name,m=p.l?a8(p.l,k):aJ,l=1);if(this.m){if(!this.f&&this.e==a){p=aw(this.j,g,n,m),p=ak(this.c,p,l)}else{if(k=be((new a3(bX,new bg("node"))).a(k)),g=bc(k)){for(p=this.k(g,n,m,l);(g=bc(k))!=aJ;){p=e(p,this.k(g,n,m,l))}}else{p=new bl}}}else{p=this.k(k.a,n,m,l)}return p};a3.prototype.k=function(k,g,m,l){k=this.e.d(this.j,k,g,m);return k=ak(this.c,k,l)};a3.prototype.toString=function(k){k=k||"";var g=k+"Step: \n";k+=" ";g+=k+"Operator: "+(this.m?"//":"/")+"\n";this.e.h&&(g+=k+"Axis: "+this.e+"\n");g+=this.j.toString(k);if(this.c.length){for(var g=g+(k+"Predicates: \n"),m=0;m<this.c.length;m++){var l=m<this.c.length-1?", ":"",g=g+(this.c[m].toString(k)+l)}}return g};function bF(k,g,m,l){this.h=k;this.d=g;this.a=m;this.b=l}bF.prototype.toString=aF("h");var b2={};function a2(k,g,m,l){k in b2&&aQ(Error("Axis already created: "+k));g=new bF(k,g,m,!!l);return b2[k]=g}a2("ancestor",function(k,g){for(var m=new bl,l=g;l=l.parentNode;){k.a(l)&&b0(m,l)}return m},aK);a2("ancestor-or-self",function(k,g){var m=new bl,l=g;do{k.a(l)&&b0(m,l)}while(l=l.parentNode);return m},aK);var b9=a2("attribute",function(k,g){var p=new bl,n=k.d();if("style"==n&&g.style&&bw){return bh(p,new bu(g.style,g,"style",g.style.cssText)),p}var m=g.attributes;if(m){if(k instanceof bg&&k.b===aJ||"*"==n){for(var n=0,l;l=m[n];n++){bw?l.nodeValue&&bh(p,ac(g,l)):bh(p,l)}}else{(l=m.getNamedItem(n))&&(bw?l.nodeValue&&bh(p,ac(g,l)):bh(p,l))}}return p},aH),a=a2("child",function(k,g,n,m,l){return(bw?a1:az).call(aJ,k,g,aD(n)?n:aJ,aD(m)?m:aJ,l||new bl)},aH,aK);a2("descendant",aw,aH,aK);var bX=a2("descendant-or-self",function(k,g,n,m){var l=new bl;bn(g,n,m)&&k.a(g)&&bh(l,g);return aw(k,g,n,m,l)},aH,aK),aV=a2("following",function(k,g,p,n){var m=new bl;do{for(var l=g;l=l.nextSibling;){bn(l,p,n)&&k.a(l)&&bh(m,l),m=aw(k,l,p,n,m)}}while(g=g.parentNode);return m},aH,aK);a2("following-sibling",function(k,g){for(var m=new bl,l=g;l=l.nextSibling;){k.a(l)&&bh(m,l)}return m},aH);a2("namespace",function(){return new bl},aH);var bL=a2("parent",function(k,g){var m=new bl;if(9==g.nodeType){return m}if(2==g.nodeType){return bh(m,g.ownerElement),m}var l=g.parentNode;k.a(l)&&bh(m,l);return m},aH),at=a2("preceding",function(s,q,p,n){var l=new bl,k=[];do{k.unshift(q)}while(q=q.parentNode);for(var g=1,w=k.length;g<w;g++){var r=[];for(q=k[g];q=q.previousSibling;){r.unshift(q)}for(var m=0,v=r.length;m<v;m++){q=r[m],bn(q,p,n)&&s.a(q)&&bh(l,q),l=aw(s,q,p,n,l)}}return l},aK,aK);a2("preceding-sibling",function(k,g){for(var m=new bl,l=g;l=l.previousSibling;){k.a(l)&&b0(m,l)}return m},aK);var bk=a2("self",function(k,g){var l=new bl;k.a(g)&&bh(l,g);return l},aH);function aN(g){aB.call(this,1);this.c=g;this.f=g.f;this.b=g.b}aC(aN);aN.prototype.a=function(g){return -a9(this.c,g)};aN.prototype.toString=function(k){k=k||"";var g=k+"UnaryExpr: -\n";return g+=this.c.toString(k+" ")};function al(g){aB.call(this,4);this.c=g;aG(this,aO(this.c,function(k){return k.f}));ai(this,aO(this.c,function(k){return k.b}))}aC(al);al.prototype.a=function(k){var g=new bl;ax(this.c,function(l){l=l.a(k);l instanceof bl||aQ(Error("PathExpr must evaluate to NodeSet."));g=e(g,l)});return g};al.prototype.toString=function(k){var g=k||"",l=g+"UnionExpr:\n",g=g+" ";ax(this.c,function(m){l+=m.toString(g)+"\n"});return l.substring(0,l.length)};function j(k,g){this.a=k;this.b=g}function b6(k){for(var g,n=[];;){a0(k,"Missing right hand side of binary expression.");g=bP(k);var m=bq(k.a);if(!m){break}var l=(m=bj[m]||aJ)&&m.p;if(!l){k.a.a--;break}for(;n.length&&l<=n[n.length-1].p;){g=new f(n.pop(),n.pop(),g)}n.push(g,m)}for(;n.length;){g=new f(n.pop(),n.pop(),g)}return g}function a0(k,g){k.a.b.length<=k.a.a&&aQ(Error(g))}function bt(k,g){var l=bq(k.a);l!=g&&aQ(Error("Bad token, expected: "+g+" got: "+l))}function aS(g){g=bq(g.a);")"!=g&&aQ(Error("Bad token: "+g))}function ap(g){g=bq(g.a);2>g.length&&aQ(Error("Unclosed literal string"));return new aR(g)}function A(k){var g=bq(k.a),m=g.indexOf(":");if(-1==m){return new bi(g)}var l=g.substring(0,m);(k=k.b(l))||aQ(Error("Namespace prefix not declared: "+l));g=g.substr(m+1);return new bi(g,k)}function cc(k){var g,m=[],l;if("/"==bs(k.a)||"//"==bs(k.a)){g=bq(k.a);l=bs(k.a);if("/"==g&&(k.a.b.length<=k.a.a||"."!=l&&".."!=l&&"@"!=l&&"*"!=l&&!/(?![0-9])[\w]/.test(l))){return new bT}l=new bT;a0(k,"Missing next location step.");g=bU(k,g);m.push(g)}else{t:{g=bs(k.a);l=g.charAt(0);switch(l){case"$":aQ(Error("Variable reference not allowed in HTML XPath"));case"(":bq(k.a);g=b6(k);a0(k,'unclosed "("');bt(k,")");break;case'"':case"'":g=ap(k);break;default:if(isNaN(+g)){if(!br(g)&&/(?![0-9])[\w]/.test(l)&&"("==bs(k.a,1)){g=bq(k.a);g=bO[g]||aJ;bq(k.a);for(l=[];")"!=bs(k.a);){a0(k,"Missing function argument list.");l.push(b6(k));if(","!=bs(k.a)){break}bq(k.a)}a0(k,"Unclosed function argument list.");aS(k);g=new i(g,l)}else{g=aJ;break t}}else{g=new ao(+bq(k.a))}}"["==bs(k.a)&&(l=new ad(bC(k)),g=new aM(g,l))}if(g){if("/"==bs(k.a)||"//"==bs(k.a)){l=g}else{return g}}else{g=bU(k,"/"),l=new bB,m.push(g)}}for(;"/"==bs(k.a)||"//"==bs(k.a);){g=bq(k.a),a0(k,"Missing next location step."),g=bU(k,g),m.push(g)}return new x(l,m)}function bU(k,g){var q,p,n;"/"!=g&&"//"!=g&&aQ(Error('Step op should be "/" or "//"'));if("."==bs(k.a)){return p=new a3(bk,new bg("node")),bq(k.a),p}if(".."==bs(k.a)){return p=new a3(bL,new bg("node")),bq(k.a),p}var m;"@"==bs(k.a)?(m=b9,bq(k.a),a0(k,"Missing attribute name")):"::"==bs(k.a,1)?(/(?![0-9])[\w]/.test(bs(k.a).charAt(0))||aQ(Error("Bad token: "+bq(k.a))),n=bq(k.a),(m=b2[n]||aJ)||aQ(Error("No axis with name: "+n)),bq(k.a),a0(k,"Missing node name")):m=a;n=bs(k.a);if(/(?![0-9])[\w]/.test(n.charAt(0))){if("("==bs(k.a,1)){br(n)||aQ(Error("Invalid node type: "+n));q=bq(k.a);br(q)||aQ(Error("Invalid type name: "+q));bt(k,"(");a0(k,"Bad nodetype");n=bs(k.a).charAt(0);var l=aJ;if('"'==n||"'"==n){l=ap(k)}a0(k,"Bad nodetype");aS(k);q=new bg(q,l)}else{q=A(k)}}else{"*"==n?q=A(k):aQ(Error("Bad token: "+bq(k.a)))}n=new ad(bC(k),m.a);return p||new a3(m,q,n,"//"==g)}function bC(k){for(var g=[];"["==bs(k.a);){bq(k.a);a0(k,"Missing predicate expression.");var l=b6(k);g.push(l);a0(k,"Unclosed predicate expression.");bt(k,"]")}return g}function bP(k){if("-"==bs(k.a)){return bq(k.a),new aN(bP(k))}var g=cc(k);if("|"!=bs(k.a)){k=g}else{for(g=[g];"|"==bq(k.a);){a0(k,"Missing next union location path."),g.push(cc(k))}k.a.a--;k=new al(g)}return k}function aW(k,g){k.length||aQ(Error("Empty XPath expression."));var m=bW(k);m.b.length<=m.a&&aQ(Error("Invalid XPath expression."));g?"function"==bf(g)||(g=h(g.lookupNamespaceURI,g)):g=bJ(aJ);var l=b6(new j(m,g));m.b.length<=m.a||aQ(Error("Bad token: "+bq(m)));this.evaluate=function(p,n){var q=l.a(new aA(p));return new aZ(q,n)}}function aZ(k,g){0==g&&(k instanceof bl?g=4:"string"==typeof k?g=2:"number"==typeof k?g=1:"boolean"==typeof k?g=3:aQ(Error("Unexpected evaluation result.")));2!=g&&(1!=g&&3!=g&&!(k instanceof bl))&&aQ(Error("value could not be converted to the specified type"));this.resultType=g;var p;switch(g){case 2:this.stringValue=k instanceof bl?bI(k):""+k;break;case 1:this.numberValue=k instanceof bl?+bI(k):+k;break;case 3:this.booleanValue=k instanceof bl?0<k.i:!!k;break;case 4:case 5:case 6:case 7:var n=be(k);p=[];for(var m=bc(n);m;m=bc(n)){p.push(m instanceof bu?m.a:m)}this.snapshotLength=k.i;this.invalidIteratorState=aH;break;case 8:case 9:n=by(k);this.singleNodeValue=n instanceof bu?n.a:n;break;default:aQ(Error("Unknown XPathResult type."))}var l=0;this.iterateNext=function(){4!=g&&5!=g&&aQ(Error("iterateNext called with wrong result type"));return l>=p.length?aJ:p[l++]};this.snapshotItem=function(q){6!=g&&7!=g&&aQ(Error("snapshotItem called with wrong result type"));return q>=p.length||0>q?aJ:p[q]}}aZ.ANY_TYPE=0;aZ.NUMBER_TYPE=1;aZ.STRING_TYPE=2;aZ.BOOLEAN_TYPE=3;aZ.UNORDERED_NODE_ITERATOR_TYPE=4;aZ.ORDERED_NODE_ITERATOR_TYPE=5;aZ.UNORDERED_NODE_SNAPSHOT_TYPE=6;aZ.ORDERED_NODE_SNAPSHOT_TYPE=7;aZ.ANY_UNORDERED_NODE_TYPE=8;aZ.FIRST_ORDERED_NODE_TYPE=9;function au(k){k=k||aE;var g=k.document;g.evaluate||(k.XPathResult=aZ,g.evaluate=function(m,l,p,n){return(new aW(m,p)).evaluate(l,n)},g.createExpression=function(m,l){return new aW(m,l)})}var ae=["wgxpath","install"],bS=aE;!(ae[0] in bS)&&bS.execScript&&bS.execScript("var "+ae[0]);for(var b;ae.length&&(b=ae.shift());){!ae.length&&au!==aL?bS[b]=au:bS=bS[b]?bS[b]:bS[b]={}}})();
- wgxpath.install();
- var spotException;
- if (o.useExceptions && setExceptions() && o.exceptions) runExceptions();
- if (!o.debug) {
- try { delete window._vidivo; } catch(e) { window._vidivo = undefined; }
- var scripts = document.getElementsByTagName('script'),
- regex = new RegExp('https??://('+o.h.replace(/\./g, '\\.')+')/.*?('+o.version.replace(/\./g, '\\.')+').js', 'i');
- for (var i = 0; i < scripts.length; ++i) {
- var script = scripts[i],
- src = script.src;
- if (src && src.match(regex)) script.parentNode.removeChild(script);
- }
- }
- function setExceptions () {
- o.exceptions = [
- { type: 'spot', domain: 'cnn.com', sizes: ['640x480'], classes: ['cnn_adcntrt728x90'] }
- // { type: 'flags', domain: 'cnn.com', flags: ['use_main_element', 'false'] }
- ];
- return true;
- }
- String.prototype.format = function(){var s = this,i = arguments.length;while (i--) {s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]);}return s;};
- var B64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(r){var t="";var i,m,o,l,n,p,q;var s=0;r=B64._utf8_encode(r);while(s<r.length){i=r.charCodeAt(s++);m=r.charCodeAt(s++);o=r.charCodeAt(s++);l=i>>2;n=((i&3)<<4)|(m>>4);p=((m&15)<<2)|(o>>6);q=o&63;if(isNaN(m)){p=q=64}else{if(isNaN(o)){q=64}}t=t+this._keyStr.charAt(l)+this._keyStr.charAt(n)+this._keyStr.charAt(p)+this._keyStr.charAt(q)}return t},decode:function(A){var m={},j,h,y=[],a="",u=String.fromCharCode;var f=[[65,91],[97,123],[48,58],[43,44],[47,48]];for(z in f){for(j=f[z][0];j<f[z][1];j++){y.push(u(j))}}for(j=0;j<64;j++){m[y[j]]=j}for(j=0;j<A.length;j+=72){var q=0,p,t,g=0,d=A.substring(j,j+72);for(t=0;t<d.length;t++){p=m[d.charAt(t)];q=(q<<6)+p;g+=6;while(g>=8){a+=u((q>>>(g-=8))%256)}}}return a},_utf8_encode:function(c){c=c.replace(/\r\n/g,"\n");var f="";for(var g=0;g<c.length;g++){var h=c.charCodeAt(g);if(h<128){f+=String.fromCharCode(h)}else{if((h>127)&&(h<2048)){f+=String.fromCharCode((h>>6)|192);f+=String.fromCharCode((h&63)|128)}else{f+=String.fromCharCode((h>>12)|224);f+=String.fromCharCode(((h>>6)&63)|128);f+=String.fromCharCode((h&63)|128)}}}return f}};
- function getRandomString(size) {for(var result='',c=0;c<size;c++)result+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.charAt(Math.floor(Math.random()*52));return result;}
- function getBrowser(){var e,r=navigator.userAgent,a=r.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(a[1])?(e=/\brv[ :]+(\d+)/g.exec(r)||[],"MSIE_"+(e[1]||"")):"Chrome"===a[1]&&(e=r.match(/\bOPR\/(\d+)/),null!=e)?"Opera_"+e[1]:(a=a[2]?[a[1],a[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=r.match(/version\/(\d+)/i))&&a.splice(1,1,e[1]),a.join("_"))}
- /*
- rules[]{} - set of rules to apply on the page. currently supports:
- * domain (required) - wanted domain
- * path (required) - xpath to the element in which you want to inject the video before to
- * width (required) - width of the video
- * height (required) - height of the video
- * excludeCountries - countries to exclude (for multiple countries: separate with a pipe), country codes are lowercased
- * excludeSubDomain - subdomains to exclude. for multiple subdomains - separate with a pipe
- * onlyInSubDomain - apply this rule only on this subdomains. for multiple subdomains - separate with a pipe
- * excludePath - paths to exclude (for multiple paths: separate with a pipe)
- * onlyInPath - apply this rule only to this url path, start and end each path with a '/' (i.e.: /path/), for multiple paths - separate with double pipes
- * excludeBrowsers - browsers to exclude from this rule, uses browser name+ver convention from getBrowser(). for multiple browsers - separate with a pipe
- * onlyInBrowsers - apply this rule only to these browsers, uses browser name+ver convention from getBrowser(). for multiple browsers - separate with a pipe
- * ruleID - used by 'conflictsWith'
- * conflictsWith - if a rule conflicts with another rule (pointed by a ruleID) - the first one 'wins'
- * skipIfFound - skip this rule if this xpath is found (for multiple rules - separate with double pipes)
- * onlyIfFound - apply this rule if the element pointed by the xpath exists
- * skipIfVisible - skipped if the element pointed by the xpath in 'skipIfVisible' is visible. Doesn't check if the object is visible to the user, but on the page
- * onlyIfVisible - apply this rule only if the xpath in 'path' is visible. Doesn't check if the object is visible to the user, but on the page
- */
- var rules=[],
- /*var rules = [
- {domain: 'roblox.com', path: '//*[@id="InnerWhatsRobloxContainer1"]'},
- {domain: 'roblox.com', path: '//*[@class="section"]'},
- {domain: 'roblox.com', path: '//*[@class="builder divider-bottom"]'},
- {domain: 'roblox.com', path: '//*[@id="GamePageAdDiv1"]'},
- {domain: 'leboncoin.fr', path: '//*[@class="lbc"]'},
- {domain: 'leboncoin.fr', path: '//*[@id="oas-middle"]'},
- {domain: 'dailymotion.com', path: '//*[@id="mc_Middle"]'},
- {domain: 'dailymotion.com', path: '//*[@class="pull-start full mrg-top-lg"]'},
- {domain: 'dailymotion.com', path: '//*[@class="pl_user_videolist"]'},
- {domain: 'dailymotion.com', path: '//*[@class="pl_user_playlists"]'},
- {domain: 'booking.com', path: '//*[@class="destmore right_hotels"]'},
- {domain: 'booking.com', path: '//*[@class="oneusp usp_tick2 top"]'},
- {domain: 'booking.com', path: '//*[@id="searchboxInc"]', ruleID:1},
- {domain: 'booking.com', path: '//*[@id="summary"]', conflictsWith:'1'},
- {domain: 'booking.com', path: '//*[@class="dsf_masonry"]'},
- {domain: 'booking.com', path: '//*[@id="review_list_page_container"]'},
- {domain: 'pelis24.com', path: '//*[@id="bcalendar"]'},
- {domain: 'pelis24.com', path: '//*[@class="related"]'},
- {domain: 'subito.it', path: '//*[@class="ad container"]'},
- {domain: 'subito.it', path: '//*[@id="mpu_placeholder"]'},
- {domain: 'watch4.de', path: '//*[@class="boxcontainer"]'},
- {domain: 'watch4.de', path: '//*[@class="suggestbox"]'},
- {domain: 'search.smartshopping.com', path: '//*[@class="gRsTopLinks"]'},
- {domain: 'globososo.com', path: '//*[@id="resultsMain"]'},
- {domain: 'globososo.com', path: '//*[@id="additionalBottomRegion"]'},
- {domain: 'easydriverpro.com', path: '//*[@class="recognitions"]'},
- {domain: 'easydriverpro.com', path: '//*[@class="features"]'},
- {domain: 'easydriverpro.com', path: '//*[@id="sidebar_box1"]'},
- {domain: 'easydriverpro.com', path: '//*[@class="features_table"]'},
- {domain: 'steampowered.com', path: '//*[@class="block game_details underlined_links"]'},
- {domain: 'steampowered.com', path: '//*[@class="leftcol game_description_column"]'},
- {domain: 'steampowered.com', path: '//*[@class="block"]'},
- {domain: 'steampowered.com', path: '//*[@class="recommendation_area_ctn genre_highlights_ctn"]'},
- {domain: 'primewire.ag', path: '//*[@class="index_container"]',ruleID: 2},
- {domain: 'primewire.ag', path: '//*[@class="loginform"]', conflictsWith: '2'},
- {domain: 'primewire.ag', path: '//*[@class="playlist_listing"]', conflictsWith: '2'},
- {domain: 'rufftv.com', path: '//*[@class="videoDescBlock"]', ruleID:3},
- {domain: 'rufftv.com', path: '//*[@id="main-nav"]', conflictsWith:'3'},
- {domain: 'rufftv.com', path: '//*[@class="sidebar"]'},
- {domain: 'marca.com', path: '//*[@id="conjunto"]'},
- {domain: 'marca.com', path: '//*[@class="principal"]'},
- {domain: 'marca.com', path: '//*[@class="cuerpo_articulo"]'},
- {domain: 'marca.com', path: '//*[@class="lomas el_js_esta_activo_GDP"]'},
- {domain: 'marca.com', path: '//*[@id="div-gpt-ad-e_opinion_r"]'},
- {domain: 'marca.com', path: '//*[@id="altConsolaEjemplo"]'},
- {domain: 'marca.com', path: '//*[@class="ultimos-disputados borde-caja"]'},
- {domain: 'animeflv.net', path: '//*[@class="ads_der"]'},
- {domain: 'animeflv.net', path: '//*[@class="sub_h1"]'},
- {domain: 'animeflv.net', path: '//*[@class="titulo"]'},
- {domain: 'kleinanzeigen.ebay.de', path: '//*[@id="home-ads"]'},
- {domain: 'kleinanzeigen.ebay.de', path: '//*[@id="home-ctgrs"]'},
- {domain: 'kleinanzeigen.ebay.de', path: '//*[@class="position-relative"]'},
- {domain: 'kleinanzeigen.ebay.de', path: '//*[@id="viewad-contact-box"]'},
- {domain: 'diretta.it', path: '//*[@id="lsadvert-zid-1145"]'},
- {domain: 'diretta.it', path: '//*[@class="scrolling-banner-wrap"]'},
- {domain: 'amazon.com', path: '//*[@id="desktop-ad-atf"]'},
- {domain: 'amazon.com', path: '//*[@class="a-box-inner a-padding-null"]'},
- {domain: 'amazon.com', path: '//*[@id="dv-side-box-container"]'},
- {domain: 'amazon.com', path: '//*[@class="acs-tiles-wrap"]'},
- {domain: 'amazon.com', path: '//*[@id="raw-sitewide-rhf"]'},
- {domain: 'amazon.com', path: '//*[@class="a-box-inner"]'},
- {domain: 'amazon.com', path: '//*[@class="side-box-body"]'},
- {domain: 'amazon.com', path: '//*[@class="acs-ft-headers a-spacing-base"]'},
- {domain: 'amazon.com', path: '//*[@id="sims_fbt"]'},
- {domain: 'amazon.com', path: '//*[@id="purchaseShvl"]'},
- {domain: 'amazon.com', path: '//*[@id="navFooter"]'},
- {domain: 'ebay.co.uk', path: '//*[@class="position-relative"]'},
- {domain: 'ebay.co.uk', path: '//*[@id="DashLeftPanel"]'},
- {domain: 'ebay.co.uk', path: '//*[@class="si-cnt si-cnt-eu"]'},
- {domain: 'ebay.co.uk', path: '//*[@class="si-cnt si-trs-top"]'},
- {domain: 'ebay.co.uk', path: '//*[@id="rtm_div_415"]'},
- {domain: 'ebay.co.uk', path: '//*[@class="wrapper-wrapper"]'},
- {domain: 'ebay.co.uk', path: '//*[@class="menu-list"]'},
- {domain: 'ebay.co.uk', path: '//*[@class="myb-lw"]'},
- {domain: 'imdb.com', path: '//*[@id="media_index_filters"]'},
- {domain: 'imdb.com', path: '//*[@class="aux-content-widget-2"]'},
- {domain: 'imdb.com', path: '//*[@class="aux-content-widget-3"]'},
- {domain: 'imdb.com', path: '//*[@class="aux-content-widget-3 links subnav"]'},
- {domain: 'imdb.com', path: '//*[@class="ad_design_special_section_details"]'},
- {domain: 'imdb.com', path: '//*[@id="top_rhs_wrapper"]'},
- {domain: 'spike.com', path: '//*[@id="ad_eud5pt"]', ruleID:4},
- {domain: 'spike.com', path: '//*[@id="t4_lc"]', conflictsWith:'4'},
- {domain: 'spike.com', path: '//*[@class="background_sibling"]'},
- {domain: 'zdnet.com', path: '//*[@class="ad-wrap"]'},
- {domain: 'zdnet.com', path: '//*[@class="keepUp"]'},
- {domain: 'pogo.com', path: '//*[@class="popularGamesModule clearfix"]'},
- {domain: 'pogo.com', path: '//*[@class="searchResult cp-only"]'},
- {domain: 'pogo.com', path: '//*[@class="overview-ss-bkg"]'},
- {domain: 'pogo.com', path: '//*[@class="upsell whatChallenge"]'},
- {domain: 'pogo.com', path: '//*[@id="linkcat-12"]'},
- {domain: 'buzzfeed.com', path: '//*[@class="small-posts pinned bf_dom "]'},
- {domain: 'buzzfeed.com', path: '//*[@class="indepth-module bf_dom"]'},
- {domain: 'buzzfeed.com', path: '//*[@class="vertical-section"]', onlyInPath:'/quizzes'},
- {domain: 'buzzfeed.com', path: '//*[@class="connect-widget"]'},
- {domain: 'buzzfeed.com', path: '//*[@class="vertical-section"]'},
- {domain: 'buzzfeed.com', path: '//*[@class="section sidebar_featured_unit sidebar_featured_animals"]',onlyInPath:'/animals'},
- {domain: 'buzzfeed.com', path: '//*[@class="section block user_follow"]'},
- {domain: 'twitter.com', path: '//*[@class="ProfileWTFAndTrends"]', ruleID:5},
- {domain: 'twitter.com', path: '//*[@class="flex-module"]', conflictsWith:'5'},
- {domain: 'yelp.com', path: '//*[@id="activity-feed"]', ruleID:6},
- {domain: 'yelp.com', path: '//*[@class="ysection clearfix rotd"]', conflictsWith:'6'},
- {domain: 'yelp.com', path: '//*[@class="open-rail clearfix"]'},
- {domain: 'yelp.com', path: '//*[@id="userCharts"]', ruleID:7},
- {domain: 'yelp.com', path: '//*[@id="profile_questions"]', conflictsWith:'7'},
- {domain: 'yelp.com', path: '//*[@class="member-search-container"]'},
- {domain: 'yelp.com', path: '//*[@id="event_feed"]'},
- {domain: 'yelp.com', path: '//*[@id="map-container"]'},
- {domain: 'yelp.com', path: '//*[@class="titled-nav"]'},
- {domain: 'weather.com', path: '//*[@class="unified_map ng-scope"]', onlyInPath:'/weather/today/'},
- {domain: 'weather.com', path: '//*[@class="main-content column panel-panel"]', onlyInPath:'/slideshow'},
- {domain: 'weather.com', path: '//*[@id="wrapper_WX_Top300Variable"]'},
- {domain: 'weather.com', path: '//*[@class="wx-corsican-latest-stories content-module ng-scope"]'},
- {domain: 'weather.com', path: '//*[@class="content-row-4 grid-12 panel-panel clearfix"]', ruleID:8},
- {domain: 'weather.com', path: '//*[@class="panel-pane content module-padding width-100 float-left column data-eq-pane-sm"]', conflictsWith:'8', excludePath:'/slideshow'},
- {domain: 'crackle.com', path: '//*[@id="home-container"]'},
- {domain: 'crackle.com', path: '//*[@class="content-holder about-channel"]'},
- {domain: 'crackle.com', path: '//*[@id="television"]'},
- {domain: 'walmart.com', path: '//*[@id="sponsored-container-middle-2"]'},
- {domain: 'walmart.com', path: '//*[@class="inner"]'},
- {domain: 'walmart.com', path: '//*[@class="product-controls product-buying-table-row module"]'},
- {domain: 'walmart.com', path: '//*[@class="productsTitle"]'},
- {domain: 'walmart.com', path: '//*[@class="js-tile tile-landscape"]'},
- {domain: 'walmart.com', path: '//*[@class="module-item-cards-curated container-responsive"]'},
- {domain: 'walmart.com', path: '//*[@class="featured-categories featured-categories-standard tempo-module slick-module"]'},
- {domain: 'walmart.com', path: '//*[@class="single-item tempo-module slick-module"]'},
- {domain: 'walmart.com', path: '//*[@id="WM_TBL"]'},
- {domain: 'walmart.com', path: '//*[@class="js-lhn-menu lhn-menu expander-content-inner block-list"]'},
- {domain: 'walmart.com', path: '//*[@class="TableOfContents"]'},
- {domain: 'walmart.com', path: '//*[@class="facet expander expanded"]'},
- {domain: 'walmart.com', path: '//*[@class="single-item tempo-module slick-module"]'},
- {domain: 'espn.go.com', path: '//*[@id="mod_packagemodule"]'},
- {domain: 'espn.go.com', path: '//*[@id="videohaveyouseen"]'},
- {domain: 'espn.go.com', path: '//*[@class="mod-container mod-tabs mod-no-footer top-headlines"]'},
- {domain: 'espn.go.com', path: '//*[@id="columnistsstripe"]'},
- {domain: 'espn.go.com', path: '//*[@class="mod-container mod-no-footer nationtable"]'},
- {domain: 'espn.go.com', path: '//*[@class="mod-container mod-tabs mod-no-footer top-headlines"]'},
- {domain: 'espn.go.com', path: '//*[@id="AdContainer"]'},
- {domain: 'espn.go.com', path: '//*[@class="mod-container mod-no-footer mod-open"]'},
- {domain: 'espn.go.com', path: '//*[@class="feed feed-single"]'},
- {domain: 'cbs.com', path: '//*[@id="yahwidHeader"]'},
- {domain: 'cbs.com', path: '//*[@id="ad-carousel"]'},
- {domain: 'cbs.com', path: '//*[@id="mpu-top"]', skipIfFound:'//*[@class="locations-wrapper"]'},
- {domain: 'cbs.com', path: '//*[@id="full-ep-carousel"]'},
- {domain: 'cbs.com', path: '//*[@class="cbs-show-mod-blog container"]'},
- {domain: 'cbs.com', path: '//*[@id="id-carousel-237956"]'},
- {domain: 'cbs.com', path: '//*[@id="id-carousel-238558"]'},
- {domain: 'cbs.com', path: '//*[@id="cbs-classics-wrapper"]'},
- {domain: 'cbs.com', path: '//*[@id="yahwidBtmSgWidget"]'},
- {domain: 'cbs.com', path: '//*[@class="locations-wrapper"]'},
- {domain: 'philadelphia.cbslocal.com', path: '//*[@class="headlines news-style"]'},
- {domain: 'philadelphia.cbslocal.com', path: '//*[@id="ad_2"]'},
- ],*/
- maxVideos = o.maxVideos || 1,
- videoCount = 0,
- activeRules = [],
- windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.parentNode,
- totalHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight),
- TOTAL_OFFSET_CHECK = windowHeight + 100,
- BODY_WIDTH = document.body.offsetWidth,
- INSPECT_ELEMENTS = [ 'DIV', 'TABLE', 'TBODY', 'TR', 'FORM', 'SECTION', 'ARTICLE', 'SPAN', 'LAYER'],
- DIVIZER_WIDTH_SIZES = [602, 301, 0],
- DIVIZER_MIN_WIDTH = 200,
- DIVIZER_MAX_WIDTH = 602,
- DIVIZER_MIN_HEIGHT = 100,
- DIVIZER_MAX_HEIGHT = 480,
- DIVIZER_WEIGHT_PERCENTAGE = 50,
- MAX_LOWEST_HEIGHT = 1000,
- ELASTIC = o.elastic,
- PROVIDERS = {
- vast: {type: 'element'},
- marimedia_vast: {type: 'iframe'},
- vast_lr: {type: 'iframe'},
- saymedia_adprotech_iframe: {width: 600, height: 500, type: 'iframe'},
- reelfeed: {width: 645, height: 375, type: 'iframe'},
- marimedia_s: {width: 300, height: 250, type: 'iframe'},
- marimedia_l: {width: 800, height: 440, type: 'iframe'},
- marimedia_script_1: {width: 640, height: 360, type: 'script', wrapper: 'vdb_player vdb_54477274e4b027f83d76e2ea543b24ffe4b0aba38922a796'},
- marimedia_script_2: {width: 640, height: 360, type: 'script', wrapper: 'vdb_player vdb_5447717ce4b070da0197d031543b24ffe4b0aba38922a796'},
- gms_iframe: {width: 600, height: 500, type: 'iframe'},
- kitara: {width: 800, height: 450, type: 'iframe'},
- sekindo: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_us: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_ca: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_gb: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_au: {width: 600, height: 500, type: 'iframe'},
- marsmedia: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_us_640: {width: 640, height: 480, type: 'iframe'},
- sekindo_iframe_ca_640: {width: 640, height: 480, type: 'iframe'},
- sekindo_iframe_gb_640: {width: 640, height: 480, type: 'iframe'},
- sekindo_iframe_au_640: {width: 640, height: 480, type: 'iframe'},
- sekindo_iframe_de: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_fr: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_br: {width: 600, height: 500, type: 'iframe'},
- sekindo_iframe_de_640: {width: 640, height: 480, type: 'iframe'},
- sekindo_iframe_fr_640: {width: 640, height: 480, type: 'iframe'},
- sekindo_iframe_br_640: {width: 640, height: 480, type: 'iframe'},
- verta_iframe: {width: 400, height: 200, type: 'iframe'},
- dsnr_iframe: {width: 600, height: 500, type: 'iframe'},
- adperience_iframe: {width: 602, height: 395, type: 'iframe'},
- saymedia_iframe: {width: 300, height: 250, type: 'iframe'}
- },
- PROVIDER_TYPE = o.provider_type,
- PROVIDER_PROPS = PROVIDERS[o.provider_type],
- PROVIDER_ELEMENT_TYPE = (PROVIDER_PROPS.type) ? PROVIDER_PROPS.type : '',
- VIDEO_WIDTH = (PROVIDER_PROPS && PROVIDER_PROPS.width) ? PROVIDER_PROPS.width : false,
- VIDEO_HEIGHT = (PROVIDER_PROPS && PROVIDER_PROPS.height) ? PROVIDER_PROPS.height : false,
- PLAYER_FOLDER = '//'+o.h+'/sd/apps/vidiv/flowplayer',
- childrenUsed = [],
- divizerToCheck = [],
- divDensity = 2,
- bd2BasicA = '#999999',
- closeButtonHeight = 17,
- close = document.createElement('a'),
- blockDesign = {
- bdID: 1,
- bottomPartCSS: 'display: none; bottom: 0px; left:0; height: 20px; position: absolute; width: 100%; line-height: 13px;text-transform: none; font-weight: normal; letter-spacing: normal;',
- bottomText: 'Ads by ' + o.product,
- bottomTextCSS: 'position:absolute; color:' + bd2BasicA + '; font-family: Tahoma; font-size: 9px; line-height: 15px; left:2px; top:2px;',
- containerCSS: 'position:relative;',
- bottomExtraElement: 'div',
- bottomExtraElementCSS: 'top: 0px; display: block; position: absolute; right: 15px; width:0; border-width: 6px 6px 0 0; border-style: solid; border-color:' + bd2BasicA + ' transparent;',
- actionLinkURL: 'http://{0}/sd/apps/adinfo-1.1{1}/index.html?{qs}'.format(o.h, o.affType),
- actionLinkCSS: 'background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA3CAYAAABUzvmMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAS5JREFUeNrsl8FtwkAQRTeIe9xB3AGU4A6gg8DJR+gASnCOvjkdUEJSQSiBdIA7yIz0LY2iIHHgNHlPGq21e3ozuzvrUgAAAAAAAAAAAOCRPGUT6vv+1Ya1RRWmTx5t236nEzfhhQRrjWcteQI2+t6b/HsacUl/WFy82rGyWn92aYujJ8Hls4h/6bMxqVFzB80NUyJsbmdDZ7GcJTnTS1V6DEtHRT1N2PqbdsZ+nqDgze+LK4gXbf/I4FXPIF6riuWGuK/FpHgiqln5p2QQv+qM30uVRdx7dqOWdQ/e1k5ZxKdLq/xxq19CB1jpMuyy9PGVEjDodTbeaHudOsA205N1ErtqPIdbf6NK+2Nmm+4nxeRfdIbX8eGi3dCZ9Cf/pQAAAAAAAAAAAPBQfgQYAFHxW7U+T6iJAAAAAElFTkSuQmCC) no-repeat 7px -20px; color: ' + bd2BasicA + '; height: 15px; font-family: Tahoma; font-size: 9px; padding-right: 26px; right:0px; position: absolute; text-align: left; top: 2px;text-transform: none; font-weight: normal; letter-spacing: normal;',
- actionLinkText: 'Ad Options'
- },
- mainElement,
- player;
- if (o.closeButtonExternalIE && getBrowser().split('_')[0] != 'MSIE') o.closeButtonExternalIE = false;
- function injectVideo (beforeElement, vidivWidth, vidivHeight) {
- var classBanner = getRandomString(Math.floor(Math.random()*10)+7),
- container = document.createElement('div'),
- inner = document.createElement('div'),
- chosenWrapper = document.createElement('div'),
- chosenElement = null,
- script = document.createElement('script'),
- refObjWidth = parseInt(getFinalStyle(beforeElement, 'width')),
- refObjBackgroundColor = getFinalStyle(beforeElement, 'background-color'),
- refObjParentClear = getFinalStyle(beforeElement.parentNode, 'clear'),
- refObjClear = getFinalStyle(beforeElement, 'clear'),
- refObjFloat = getFinalStyle(beforeElement, 'float'),
- refObjPaddingRight = parseInt(getFinalStyle(beforeElement, 'padding-right')),
- refObjPaddingLeft = parseInt(getFinalStyle(beforeElement, 'padding-left')),
- complaince = addComplaince(vidivWidth),
- nextElement = getNextSibling(beforeElement),
- nextFloat = (nextElement) ? getFinalStyle(nextElement, 'float') : false,
- currentUrl = encodeURIComponent(document.location.href),
- currentTitle = encodeURIComponent(document.title),
- triggerVideo,
- posY,
- videoIsVisible,
- receiver,
- cbuster = (+new Date());
- if (PROVIDER_ELEMENT_TYPE == 'iframe') {
- chosenElement = getNewIframe(vidivWidth, vidivHeight);
- } else if (PROVIDER_ELEMENT_TYPE == 'script') {
- chosenElement = document.createElement('script');
- chosenElement.type = 'text/javascript';
- if (PROVIDER_PROPS.wrapper) {
- chosenWrapper.className = PROVIDER_PROPS.wrapper;
- }
- } else if (PROVIDER_ELEMENT_TYPE == 'element') {
- chosenElement = document.createElement('div');
- chosenElement.id = 'player';
- //chosenElement.style.cssText='position:absolute; top:0; left:0;';
- }
- container.className = classBanner;
- container.appendChild(inner);
- //container.appendChild(complaince);
- container.style.display = 'block';
- container.style.width = '100%';
- chosenWrapper.appendChild(chosenElement);
- chosenWrapper.appendChild(complaince);
- inner.appendChild(chosenWrapper);
- inner.appendChild(createCloseButton(inner, chosenElement, vidivHeight));
- inner.style.width = vidivWidth + 'px';
- if (ELASTIC) inner.style.background = '#000000';
- inner.style.cssText += ';0;margin: 0 auto; height: 0; overflow: hidden; position: relative;-moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box;';
- if (PROVIDER_TYPE == 'marimedia_vast') {
- chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_vast.html?w='+vidivWidth+'&h='+vidivHeight+'&ref='+encodeURIComponent(PLAYER_FOLDER)+'&vurl='+encodeURIComponent(o.video_url)+'&url='+encodeURIComponent(currentUrl)+'&type='+o.video_type+'&title='+currentTitle+'&tag='+encodeURIComponent(o.vast_tag)+'&'+(+new Date());
- if (o.closeOnFinish) closeVastOnFinish();
- } else if (PROVIDER_TYPE == 'vast_lr') {
- chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_vast_lr.html?w='+vidivWidth+'&h='+vidivHeight+'&ref='+encodeURIComponent(PLAYER_FOLDER)+'&vurl='+encodeURIComponent(o.video_url)+'&url='+encodeURIComponent(currentUrl)+'&type='+o.video_type+'&title='+currentTitle+'&'+(+new Date());
- if (o.closeOnFinish) closeVastOnFinish();
- } else if (PROVIDER_TYPE == 'reelfeed') {
- chosenElement.src = 'http://embed.reelfeed.tv/'+vidivWidth+'x'+vidivHeight+'/?referid=754065743335&url=' + currentUrl + '&partner=&mute=0&theme=dark&mouse=1&vod=1&cid=&autoStart=1';
- } else if (PROVIDER_TYPE == 'marimedia_s') {
- chosenElement.src = 'http://besttv39.cdn.it.best-tv.com/besttv/players/jwbcmain/player.html?autostart=1&loop=1&repeat=50&tag=cpr&volume=1&midrollinterval=10&prerollcount=2&publisher_id=65804&partner_id=758205&auction_retries=4&cid=' + (+new Date()) + '&url=' + currentUrl + '&LR_TAGS=' + escape('${TAG_ID}') + '&video=' + escape('http://besttv39.cdn.it.best-tv.com/besttv/marimedia/media/goal_short_e.mp4');
- } else if (PROVIDER_TYPE == 'marimedia_l') {
- chosenElement.src = 'http://besttv39.cdn.it.best-tv.com/besttv/players/jwbcmain/player.html?autostart=1&loop=1&repeat=50&tag=cpr&volume=1&midrollinterval=10&prerollcount=2&publisher_id=65804&partner_id=758205&auction_retries=4&cid=' + (+new Date()) + '&url=' + currentUrl + '&LR_TAGS=' + escape('${TAG_ID}') + '&video=' + escape('http://besttv39.cdn.it.best-tv.com/besttv/marimedia/media/Miley_madona_e.mp4');
- } else if (PROVIDER_TYPE == 'marimedia_script_1') {
- chosenElement.src = '//delivery.vidible.tv/jsonp/pid=54477274e4b027f83d76e2ea/543b24ffe4b0aba38922a796.js';
- } else if (PROVIDER_TYPE == 'marimedia_script_2') {
- chosenElement.src = '//delivery.vidible.tv/jsonp/pid=5447717ce4b070da0197d031/543b24ffe4b0aba38922a796.js';
- } else if (PROVIDER_TYPE == 'kitara') {
- chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_kitara.html';
- } else if (PROVIDER_TYPE == 'sekindo_iframe_us') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55269&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_ca') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55309&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_gb') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55310&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_au') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55311&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'marsmedia') {
- chosenElement.src = 'http://video.playitviral.com/srv/player/?hash=4hj2r5&pub_domain='+currentUrl+'&p1='+o.affid+'-'+o.subaffid;
- } else if (PROVIDER_TYPE == 'sekindo') {
- chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_sekindo.html';
- } else if (PROVIDER_TYPE == 'sekindo_iframe_us_640') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55404&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_ca_640') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55405&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_gb_640') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55406&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_au_640') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55407&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'verta_iframe') {
- chosenElement.src = '//vertamedia.com/videejs/iframe.html?token=1b4296d843582b3e95f9ccfb1d54a51e';
- } else if (PROVIDER_TYPE == 'dsnr_iframe') {
- chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_dsnr.html?u='+currentUrl;
- } else if (PROVIDER_TYPE == 'saymedia_iframe') {
- chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_saymedia.html';
- } else if (PROVIDER_TYPE == 'sekindo_iframe_de') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55977&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_fr') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55979&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_fr_640') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55980&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'sekindo_iframe_de_640') {
- chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55978&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
- } else if (PROVIDER_TYPE == 'adperience_iframe') {
- chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_adperience.html?u='+currentUrl+'&g='+o.country_code+'&a='+o.affid+'-'+o.subaffid;
- }else if (PROVIDER_TYPE == 'sekindo_iframe_br') {
- chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_sekindo_br.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
- }else if (PROVIDER_TYPE == 'sekindo_iframe_br_640') {
- chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_sekindo_br_640.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
- } else if (PROVIDER_TYPE == 'gms_iframe') {
- chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_gms.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
- } else if (PROVIDER_TYPE == 'saymedia_adprotech_iframe') {
- chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_saymedia_adprotech.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
- }
- // css clear/floats settings
- if (refObjClear == 'left' || refObjClear == 'right') container.style.clear = refObjClear;
- else if (refObjParentClear == 'both' || refObjClear == 'both') container.style.clear = 'both';
- if (((refObjFloat == 'left' && nextFloat != 'right') || (refObjFloat == 'right' && nextFloat != 'left')) && beforeElement.offsetWidth != BODY_WIDTH) container.style.cssFloat = refObjFloat;
- if (refObjBackgroundColor && refObjWidth < DIVIZER_MAX_WIDTH) container.style.backgroundColor = refObjBackgroundColor;
- // injecting the container
- if (beforeElement.parentNode !== null) beforeElement.parentNode.insertBefore(container,beforeElement);
- else beforeElement.appendChild(container);
- if (PROVIDER_ELEMENT_TYPE == 'element') {
- console.log ('here');
- vastPlayer.init({width: vidivWidth, height: vidivHeight, url: currentUrl});
- }
- // increasing the video count
- ++videoCount;
- triggerVideo = function() {
- posY = window.pageYOffset || document.documentElement.scrollTop || document.body.parentNode.scrollTop;
- videoIsVisible = getPosition(container).y - windowHeight + (vidivWidth / 2);
- if (posY >= videoIsVisible) {
- if (PROVIDER_ELEMENT_TYPE == 'iframe') {
- animate(inner, 'height', 'px', 0, (ELASTIC ? (vidivHeight+20) : vidivHeight+20), 680, function() {
- sendToIframe('init', chosenElement);
- inner.style.overflow = 'visible';
- });
- } else {
- animate(inner, 'height', 'px', 0, (ELASTIC ? (vidivHeight+20) : vidivHeight+20), 680, function() {
- inner.style.overflow = 'visible';
- });
- }
- container.style.marginTop = (o.closeButtonExternalIE) ? (10+closeButtonHeight) + 'px' : '10px';
- container.style.marginBottom = '10px';
- complaince.style.display = 'block';
- removeListener(window, 'scroll', triggerVideo);
- }
- }
- // triggers slidedown after slide
- addListener(window,'scroll', triggerVideo);
- // add page css to the video
- addPageCSS('.'+classBanner+' .player_wrap{height: '+vidivHeight+'px;} .ac_results { width: '+vidivWidth+'px !important; margin: 0 auto !important; } .ac_results img.close_it_btn { width: 14px !important; height: 14px !important;');
- }
- function addComplaince (width) {
- var bottom, bottomText, actionLink, bottomExtra;
- // bottom container
- bottom = document.createElement('div');
- bottom.style.cssText += blockDesign.bottomPartCSS
- //bottom.style.position = 'relative';
- bottom.style.position = 'absolute';
- bottom.style.marginLeft = 'auto';
- bottom.style.marginRight = 'auto';
- // bottom text
- bottomText = document.createElement('span');
- bottomText.appendChild(document.createTextNode(blockDesign.bottomText));
- bottomText.style.cssText += blockDesign.bottomTextCSS;
- // action link
- actionLink = document.createElement('a');
- actionLink.setAttribute('href', createActionLinkURL(blockDesign.actionLinkURL, '', '', ''));
- actionLink.setAttribute('target', '_blank');
- actionLink.style.cssText += blockDesign.actionLinkCSS;
- actionLink.appendChild(document.createTextNode(blockDesign.actionLinkText));
- // bottom extra (border)
- bottomExtra = document.createElement(blockDesign.bottomExtraElement);
- bottomExtra.style.cssText = blockDesign.bottomExtraElementCSS;
- bottom.appendChild(bottomText);
- bottom.appendChild(actionLink);
- bottom.appendChild(bottomExtra);
- return bottom;
- }
- function runExceptions () {
- var exceptions = {
- spot: function (exc) { spotException = exc },
- flags: function (exc) {
- var flags = exception.flags;
- for (var j = 0; j < flags.length; j+=2) {
- o[flags[j]] = flags[j+1];
- }
- }
- }
- for (var i = 0; i < o.exceptions.length; ++i) {
- var exception = o.exceptions[i];
- if (document.location.href.indexOf(exception.domain) > -1) {
- if (!exception.action) exceptions[exception.type](exception);
- else exceptions[exception.type][exception.action](exception);
- }
- }
- }
- function createCloseButton (inner, iframe, height) {
- close.setAttribute('href', 'javascript:void(0)');
- close.style.display = 'block';
- close.style.width = '17px';
- close.style.height = '17px';
- close.style.top = (o.closeButtonExternalIE) ? (-closeButtonHeight) + 'px' : '0px';
- close.style.right = '0px';
- close.style.position = 'absolute';
- close.style.padding = '0px';
- close.style.background = 'url(data:image/gif;base64,R0lGODlhEQARAMQAAJiYlp2dm/39+/r6+vz8+p6enJ+fn/v7+Z6enpaWlpeXlaGhoaCgnpiYmJaWlJ+fnZeXl/v7+/z8/JycnP7+/JycmpmZl5qampubmZqamJubm/39/f7+/v///ZmZmf///yH5BAAAAAAALAAAAAARABEAAAWwYFZYWIaVWqqq1dEJXdx9dE1fWEfFRGzbOMpnw/nsOq4NjbMxdZQ0HYzw4UhoGcCMo0loXxaEhzbIBGY3hoNy0nwkxUymwyl+AIUKIBBZfkxUdh1mFQI/TkocAw8WJBURG0oRGRZ0NBMWFRQBCgh+GW5DExehHAYeE4kVGhJXiUQfA0pXHwVjNVB+dhwAF0MbV31VRVAcGBMDNcJDzBFFFhcLCRAXFxMe1h4NFwakFSEAOw==)';
- close.style.cssText += ';z-index: 9999999;';
- addListener(close, 'click', function(e) {
- e || (e = window.event);
- e.target || (e.target = e.srcElement);
- e.preventDefault ? e.preventDefault() : (e.returnValue = false);
- inner.style.overflow = 'hidden';
- if (PROVIDER_ELEMENT_TYPE == 'iframe') {
- sendToIframe('close', iframe);
- animate(inner, 'height', 'px', height+20, 0, 680, function() {
- inner.parentNode.style.display = 'none';
- });
- } else {
- animate(inner, 'height', 'px', height+20, 0, 680, function() {
- var wrapper = inner.parentNode;
- wrapper.parentNode.removeChild(wrapper);
- });
- }
- });
- return close;
- }
- function sendToIframe(msg,iframe) {
- if (!iframe) return;
- var receiver = iframe.contentWindow;
- receiver.postMessage(msg, iframe.src || '*');
- }
- function getNewIframe (width, height) {
- var iframe = document.createElement('iframe');
- iframe.style.width = width + 'px';
- iframe.style.height = height + 'px';
- iframe.style.display = 'block';
- iframe.style.margin = '0px';
- iframe.style.border = '0px';
- iframe.style.left = '0px';
- iframe.style.bottom = '0px';
- iframe.style.position = 'absolute';
- iframe.setAttribute('marginwidth', '0');
- iframe.setAttribute('marginheight', '0');
- iframe.setAttribute('frameborder', '0');
- iframe.setAttribute('scrolling', 'no');
- if (o.iframeOpacity) iframe.style.opacity = o.iframeOpacity;
- return iframe;
- }
- function findMainElement (obj, width, height) {
- var bChildren = obj.children,
- objHeight = parseInt(getFinalStyle(obj, 'height')),
- child,
- childHeight,
- childWidth,
- childClass,
- childDisplay,
- childPosition,
- divCount = 0,
- skipChild,
- childMarginTop,
- childOffsetTop,
- childTotalTop,
- screenHeight = (window.innerHeight || document.documentElement.clientHeight) - 25;
- for (var i = 0; i < bChildren.length; ++i) {
- child = bChildren[i];
- childDisplay = getFinalStyle(child, 'display');
- childPosition = getFinalStyle(child, 'position');
- skipChild = false;
- if (spotException) {
- var childSize = width + 'x' + height;
- if (!spotException.sizes || matchArray(childSize, spotException.sizes, true)) {
- var childId = child.getAttribute('id'),
- childClass = child.getAttribute('class');
- if ((childId && spotException.ids && matchArray(childId, spotException.ids, true)) ||
- (childClass && spotException.classes && matchArray(childClass, spotException.classes, true))) {
- skipChild = true;
- }
- }
- }
- if (!skipChild && matchArray(child.tagName.toUpperCase(), INSPECT_ELEMENTS, true) && childDisplay != 'none') {
- childHeight = parseInt(getFinalStyle(child, 'height'));
- childWidth = parseInt(getFinalStyle(child, 'width'));
- childClass = child.className;
- childMarginTop = parseInt(getFinalStyle(child,'margin-top'));
- childOffsetTop = findTotalOffset(child).top;
- childTotalTop = childOffsetTop - childMarginTop;
- if (isNaN(childWidth) || isNaN(childHeight) || isNaN(objHeight)) {
- childWidth = getRealSize(child,'clientWidth');
- childHeight = getRealSize(child,'clientHeight');
- objHeight = getRealSize(obj,'clientHeight');
- }
- if (childHeight >= objHeight * DIVIZER_WEIGHT_PERCENTAGE / 100) {
- if (o.use_main_element && !mainElement && childOffsetTop > 1 && childTotalTop > 44
- && childTotalTop < screenHeight && childWidth >= width) {
- mainElement = child;
- }
- if (ELASTIC && childWidth >= DIVIZER_MIN_WIDTH && childHeight >= DIVIZER_MIN_HEIGHT && childDisplay != 'absolute' && childDisplay != 'fixed') {
- divizerToCheck.push({'obj': child, 'width': childWidth});
- }
- if (childWidth >= width) {
- if (findMainElement(child, width, height)) {
- return true;
- } else {
- // Keep on going
- }
- } else if (!ELASTIC && childWidth >= width) {
- divizerToCheck.push(child);
- }
- }
- if (childPosition == 'absolute' || childPosition == 'fixed') continue;
- if (childHeight >= DIVIZER_MIN_HEIGHT) {
- if (childWidth >= width) {
- var prevChild = (i > 0) ? bChildren[i-1] : null;
- for (var j = 0; j < childrenUsed.length; ++j) {
- if (child == childrenUsed[j]) {
- skipChild = true;
- }
- }
- if (prevChild && prevChild.tagName.toUpperCase() == 'TABLE' && child.tagName.toUpperCase() == 'TABLE') skipChild = true;
- if (!skipChild) ++divCount;
- if (divCount >= divDensity && !skipChild) {
- childrenUsed.push(child);
- }
- }
- }
- }
- }
- return false;
- }
- if (!window.getComputedStyle) {
- window.getComputedStyle = function(el, pseudo) {
- this.el = el;
- this.getPropertyValue = function(prop) {
- var re = /(\-([a-z]){1})/g;
- if (prop == 'float') prop = 'styleFloat';
- if (re.test(prop)) {
- prop = prop.replace(re, function () {
- return arguments[2].toUpperCase();
- });
- }
- return el.currentStyle[prop] ? el.currentStyle[prop] : null;
- }
- return this;
- }
- }
- function getFinalStyle (obj, prop) {
- if (obj.tagName) return window.getComputedStyle(obj, null).getPropertyValue(prop);
- else return null;
- }
- function animate (element, style, unit, from, to, time, callback) {
- if (!element) return;
- var start = new Date().getTime(),
- timer = setInterval(function() {
- var step = Math.min(1, (new Date().getTime()-start)/time);
- element.style.cssText += style + ':' + (from+step*(to-from)) + unit + '!important;';
- if(step == 1) {
- clearInterval(timer);
- if (typeof(callback) == 'function') callback();
- }
- }, 1);
- element.style.cssText += style + ':' + from + unit + '!important;';
- }
- function createActionLinkURL (base, domain, adDomainId, adRuleId) {
- var qs = o.qs + '&b=' + blockDesign.bdID + '&rd=' + domain + '&ri=' + adDomainId + adRuleId;
- return base.replace('{qs}', B64.encode(qs));
- }
- function matchArray (str, arr, exact) {
- if (!arr.length) return false;
- if (typeof(arr) === 'string') {
- return ((!exact && str.indexOf(arr) > -1) || str.toString() == arr);
- } else {
- for (var i = 0; i < arr.length; i++) {
- if ((!exact && str.indexOf(arr[i]) > -1) || str.toString() == arr[i]) return true;
- }
- }
- return false;
- }
- function getPosition (element) {
- var xPosition = 0;
- var yPosition = 0;
- while(element) {
- xPosition += (element.offsetLeft );
- yPosition += (element.offsetTop);
- element = element.offsetParent;
- }
- return { x: xPosition, y: yPosition };
- }
- function addListener (element, eventName, handler) {
- if (element.addEventListener) {
- element.addEventListener(eventName, handler, false);
- } else if (element.attachEvent) {
- element.attachEvent('on' + eventName, handler);
- } else {
- element['on' + eventName] = handler;
- }
- }
- function removeListener (element, eventName, handler) {
- if (element.addEventListener) {
- element.removeEventListener(eventName, handler, false);
- } else if (element.detachEvent) {
- element.detachEvent('on' + eventName, handler);
- } else {
- element['on' + eventName] = null;
- }
- }
- function calcVideoSize (obj) {
- var objWidth = parseInt(getFinalStyle(obj,'width')),
- width = 0;
- for (var i = 0; i < DIVIZER_WIDTH_SIZES.length && width == 0; ++i) {
- var currWidth = DIVIZER_WIDTH_SIZES[i];
- if (currWidth == 0) {
- width = objWidth;
- } else if (currWidth <= objWidth) {
- width = currWidth;
- }
- }
- height = width / o.elasticRatio;
- return {width: width, height: Math.ceil(height)};
- }
- function addPageCSS (rule) {
- var head = document.getElementsByTagName('head')[0],
- style = document.createElement('style'),
- rules = document.createTextNode(rule);
- style.type = 'text/css';
- if (style.styleSheet)
- style.styleSheet.cssText = rules.nodeValue;
- else
- style.appendChild(rules);
- head.appendChild(style);
- }
- function getBrowser () {
- var ua= navigator.userAgent, tem,
- M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
- if(/trident/i.test(M[1])){
- tem= /\brv[ :]+(\d+)/g.exec(ua) || [];
- return 'MSIE_'+(tem[1] || '');
- }
- if(M[1]=== 'Chrome'){
- tem= ua.match(/\bOPR\/(\d+)/)
- if(tem!= null) return 'Opera_'+tem[1];
- }
- M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
- if((tem= ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]);
- return M.join('_');
- }
- function getNextSibling (elem) {
- var next = elem.nextSibling
- while (next && next.nodeType != 1) {
- next = next.nextSibling;
- }
- if (next && matchArray(next.tagName.toUpperCase(), INSPECT_ELEMENTS, true)) return next;
- else return false;
- }
- function findTotalOffset (obj) {
- var ol = ot = 0;
- if (obj.offsetParent) {
- do {
- ol += obj.offsetLeft;
- ot += obj.offsetTop;
- } while (obj = obj.offsetParent);
- }
- return {left : ol, top : ot};
- }
- function getRealSize (obj,type) {
- var clientSize, getPadding = 0;
- if (obj == null || !obj[type]) return 0;
- clientSize = obj[type];
- if (type == 'clientWidth') {
- getPadding = parseInt(getFinalStyle(obj,'padding-left')) + parseInt(getFinalStyle(obj,'padding-right'));
- } else {
- getPadding = parseInt(getFinalStyle(obj,'padding-top')) + parseInt(getFinalStyle(obj,'padding-bottom'));
- }
- return (!isNaN(getPadding)) ? clientSize - getPadding : clientSize;
- }
- function closeVastOnFinish () {
- addListener(window, 'message', function(e) {
- if (e.origin.indexOf(o.h) > -1 && e.data == 'finished') {
- close.click();
- }
- });
- }
- function getRandomSpot () {
- var width = 602,
- height = 502;
- if (VIDEO_WIDTH && VIDEO_HEIGHT) {
- width = VIDEO_WIDTH;
- height = VIDEO_HEIGHT;
- } else {
- ELASTIC = true;
- }
- findMainElement(document.body, width, height);
- var childLength = childrenUsed.length,
- divizerCheckLength = divizerToCheck.length,
- chosenChild,
- posY,
- siblingElement,
- playerScript;
- if (!childLength && !divizerCheckLength) return;
- chosenChild = childrenUsed[0]; // default - first divizer for video
- posY = posY = getPosition(childrenUsed[0]).y; // init posY of the default element
- if (divizerCheckLength) {
- for (var i = 0; i<divizerCheckLength; i++) {
- if (ELASTIC) width = divizerToCheck[i].width;
- findMainElement(divizerToCheck[i].obj, width, height);
- }
- childLength = childrenUsed.length;
- }
- if (childLength > 1) {
- // looping through the divizers
- var i = childLength;
- while (i--) {
- posY = getPosition(childrenUsed[i]).y;
- //checking the offset - if bigger than the windowHeight+EXTRA HEIGHT then choosing it
- if (posY >= TOTAL_OFFSET_CHECK && childrenUsed[i].offsetWidth <= DIVIZER_MAX_WIDTH) {
- chosenChild = childrenUsed[i];
- }
- }
- }
- if (chosenChild) {
- if (mainElement && (totalHeight - findTotalOffset(chosenChild).top) <= MAX_LOWEST_HEIGHT) chosenChild = mainElement
- }
- if (!chosenChild) return;
- if (posY < TOTAL_OFFSET_CHECK) {
- //if found only one child and it's below below the fold, then inserting it to the element after
- siblingElement = chosenChild.nextSibling;
- while (siblingElement && siblingElement.nodeType != 1) {
- siblingElement = siblingElement.nextSibling;
- }
- if (siblingElement && siblingElement.offsetWidth >= chosenChild.offsetWidth && siblingElement.offsetHeight > 0) chosenChild = siblingElement;
- }
- // flowplayer script settings
- if (ELASTIC) {
- var obj = calcVideoSize(chosenChild);
- width = obj.width;
- height = obj.height;
- }
- return {elem: chosenChild, width: width, height: height};
- }
- function getXPath (path) {
- // Can't use XPathResult.ANY_TYPE because of IE, using 0.
- return document.evaluate(path, document, null, 0, null);
- }
- function checkElements (xpathes, checkIfVisible) {
- var arr = xpathes.split("||"),
- isFoundElement = false,
- findElements,
- foundElement;
- for (var i = 0; i < arr.length; ++i) {
- findElements = getXPath(arr[i]);
- if (findElements) {
- foundElement = findElements.iterateNext();
- if (foundElement) {
- if (checkIfVisible) {
- if (foundElement.offsetHeight > 0) isFoundElement = true;
- } else {
- isFoundElement = true;
- }
- }
- }
- }
- return isFoundElement;
- }
- var vastPlayer = {
- init: function (obj) {
- var playerElement = document.getElementById('player'),
- playerScript = document.createElement('script'),
- scriptCounter = 0,
- scriptLoaded,
- _this = this;
- // player css setting
- _this.width = obj.width;
- _this.height = obj.height;
- _this.url = obj.url;
- _this.title = obj.title;
- addPageCSS('#player {height: '+_this.height+'px !important;}');
- // player scripts settings
- playerScript = document.createElement('script');
- playerScript.type = 'text/javascript';
- playerScript.src = PLAYER_FOLDER + '/flowplayer-3.2.13.min.js';
- document.getElementsByTagName('head')[0].appendChild(playerScript);
- // trying to load the player script (js)
- scriptLoaded = function() {
- if (typeof flowplayer == 'undefined' && scriptCounter <= 4800) {
- window.setTimeout(scriptLoaded, 200);
- scriptCounter += 200;
- }
- else if (typeof flowplayer != 'undefined') _this.handleVideo(playerElement);
- setTimeout(function () {
- try {
- player.play();
- } catch(e) {}
- }, 1000);
- }
- scriptLoaded();
- },
- handleVideo: function (elem) {
- var _this = this,
- getIEVersion = _this.detectIE(),
- detectFlash = (Boolean(flashembed.isSupported([10, 1]))) ? true : false;
- if (!detectFlash && !Boolean(getIEVersion)) {
- // if no flash is detected and no IE, building html video element
- player = _this.configHtmlVideo(elem);
- elem.appendChild(player);
- }
- else {
- // using the flash flow player or displaying a message for flash is missing (IE)
- player = _this.configFlashVideo(elem);
- player.onFinish(function () {
- close.click();
- });
- }
- },
- configFlashVideo: function (elem) {
- var vastTag = o.vast_tag,
- _this = this;
- vastTag = vastTag.replace(/\{CB\}/g, (+new Date));
- vastTag = vastTag.replace(/\{WIDTH\}/g, _this.width);
- vastTag = vastTag.replace(/\{HEIGHT\}/g, _this.height);
- vastTag = vastTag.replace(/\{PAGE_URL\}/g, _this.url);
- vastTag = vastTag.replace(/\{PAGE_TITLE\}/g, _this.title);
- vastTag = vastTag.replace(/\{VIDEO_URL\}/g, o.video_url);
- vastTag = vastTag.replace(/\{VIDEO_TYPE\}/g, o.video_type || 'default');
- vastTag = vastTag.replace(/&/g, '__amp__');
- return flowplayer(elem, {src: PLAYER_FOLDER + '/flowplayer-3.2.18.swf'}, {
- playlist: [
- {
- url: o.video_url
- }
- ],
- clip: {
- onBegin: function () {
- player.setVolume(0);
- player.mute();
- },
- },
- plugins: {
- ova: {
- url: PLAYER_FOLDER + '/ova-1.1.0.swf',
- // autoPlay: true,
- ads: {
- schedule: [
- {
- position: 'pre-roll',
- // position: 'mid-roll',
- // startTime: '00:00:05',
- // position: 'post-roll',
- tag: vastTag
- }
- ]
- },
- debug: {
- // levels: 'fatal, config, vast_template, http_calls'
- levels: false
- }
- }
- }
- });
- },
- configHtmlVideo: function () {
- var video = document.createElement('video'),
- source = document.createElement('source'),
- _this = this;
- // video attributes settings
- video.controls = true;
- video.autoPlay = true;
- video.muted = true;
- video.mute = true; // un-needed?
- video.volume = 0;
- video.preload = "true";
- video.width = _this.width;
- video.height = _this.height;
- video.style.background = "#000000";
- // source attributes settings
- source.src = o.video_url;
- source.type ="video/mp4";
- video.appendChild(source);
- return video;
- },
- detectIE: function () {
- var ua = window.navigator.userAgent,
- msie = ua.indexOf('MSIE '),
- trident = ua.indexOf('Trident/');
- if (msie > 0) { // IE 10 or older => return version number
- return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
- } else if (trident > 0) { // IE 11 (or newer) => return version number
- var rv = ua.indexOf('rv:');
- return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
- }
- return false;
- }
- }
- function init () {
- // reelfeed doesn't work on IE9
- if (getBrowser() == 'MSIE_9' && (PROVIDER_TYPE == 'reelfeed' || PROVIDER_TYPE == 'marimedia_script_1' || PROVIDER_TYPE == 'marimedia_script_2')) return;
- // SET WS CHANGES
- for (var i = 0; i < rules.length; ++i) {
- var rule = rules[i],
- obj = rule;
- if (!rule.domain || !rule.path) continue;
- if (matchArray(document.location.host, rule.domain.split('|'))) {
- var elements = getXPath(rule.path),
- elem = (elements) ? elements.iterateNext() : null;
- if (!elements || !elem) continue;
- if (!rule.width || !rule.height) {
- if (parseInt(getFinalStyle(elem,'width')) < DIVIZER_MIN_WIDTH) continue;
- obj = calcVideoSize(elem);
- }
- if (o.country_code && rule.excludeCountries && matchArray(o.country_code, rule.excludeCountries.split('|'), true)) continue;
- if (rule.excludeSubDomain && matchArray(document.location.host, rule.excludeSubDomain.split('|'), true)) continue;
- if (rule.onlyInSubDomain && !matchArray(document.location.host, rule.onlyInSubDomain.split('|'), true)) continue;
- // Checks if the right path
- if (rule.excludePath && matchArray(document.location.pathname, rule.excludePath.split('|'))) continue;
- if (rule.onlyInPath && !matchArray(document.location.pathname, rule.onlyInPath.split('|'))) continue;
- // Checks if the right browser
- if (rule.excludeBrowsers && matchArray(curBrowser, rule.excludeBrowsers.split('|'), true)) continue;
- if (rule.onlyInBrowsers && !matchArray(curBrowser, rule.onlyInBrowsers.split('|'), true)) continue;
- // Go to next rule if conflicts
- if (rule.conflictsWith) {
- var conflictsArr = (rule.conflictsWith+'').split('|'),
- isFoundSkip=false;
- for (var j = 0; j < conflictsArr.length; j++) {
- if (matchArray(conflictsArr[j], activeRules, true)) {
- isFoundSkip = true;
- }
- }
- if (isFoundSkip) continue;
- }
- if (rule.onlyIfFound && !checkElements(rule.onlyIfFound)) continue;
- if (rule.skipIfFound && checkElements(rule.skipIfFound, false)) continue;
- if (rule.skipIfVisible && checkElements(rule.skipIfVisible, true)) continue;
- if (rule.onlyIfVisible && elem.offsetHeight < 10) continue;
- if (rule.ruleID) activeRules.push(rule.ruleID+'');
- injectVideo(elem, obj.width, obj.height);
- // if more are needed, go to next rule, if not, exsit
- if (videoCount < maxVideos) continue;
- else return true;
- }
- }
- // continue only if no videos are added, or if videoCount is less than maxVideos if flag rulesAndRandom
- if (!videoCount || (o.rulesAndRandom && videoCount < maxVideos)) {
- var obj = getRandomSpot();
- injectVideo(obj.elem, obj.width, obj.height);
- }
- }
- init();
- })(_vidivo);
Add Comment
Please, Sign In to add comment