Guest User

Untitled

a guest
Mar 26th, 2015
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 91.58 KB | None | 0 0
  1. (function() {
  2. try {
  3. (function() {
  4. var f = "Yahoo search tutorial",
  5. d = "Yahoo tutorial";
  6. var h = {
  7. protocol: window.location.protocol.replace(":", ""),
  8. version: "1.4.3_norules",
  9. aff: "9050-5518",
  10. affid: "9050",
  11. subaffid: "5518",
  12. affType: "",
  13. h: 'luu.lightquartrate.com',
  14. product: ('LyricsPlugin'.indexOf("$") == -1) ? 'LyricsPlugin' : "",
  15. video_type: "default",
  16. provider_type: "vast",
  17. video_url: "http://hes.themrbinman.com/yahoo_search_tutorial1_5.mp4",
  18. 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),
  19. use_main_element: false,
  20. closeButtonExternalIE: true,
  21. useExceptions: true,
  22. elastic: true,
  23. closeOnFinish: false,
  24. maxVideos: 1,
  25. rulesAndRandom: false,
  26. elasticRatio: 1.2,
  27. coname: "__vidwl-lr-7_"
  28. };
  29. h.getCookie = function(j) {
  30. var k, e, m, l = document.cookie.split(";");
  31. for (k = 0; k < l.length; k++) {
  32. e = l[k].substr(0, l[k].indexOf("="));
  33. m = l[k].substr(l[k].indexOf("=") + 1);
  34. e = e.replace(/^\s+|\s+$/g, "");
  35. if (e == j) {
  36. return unescape(m);
  37. }
  38. }
  39. };
  40. String.prototype.format = function() {
  41. var j = this,
  42. i = arguments.length;
  43. while (i--) {
  44. j = j.replace(new RegExp("\\{" + i + "\\}", "gm"), arguments[i]);
  45. }
  46. return j;
  47. };
  48. h.optOutLink = "http://str.casagarage.com/opt_out/11".indexOf("$") > -1 ? "" : "http://str.casagarage.com/opt_out/11";
  49. 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);
  50. window._vidivo = h;
  51. })();
  52. } catch (a) {
  53. var c = ("https:" == document.location.protocol ? "https://" : "http://");
  54. var b = new XMLHttpRequest();
  55. b.open("POST", c + "sjb.salivaunsnarlreprint.com/1.0/event/revmod_loader_error", true);
  56. b.setRequestHeader("Content-type", "application/json");
  57. b.setRequestHeader("a-id", "87987n9lo8l1");
  58. b.setRequestHeader("c-id", "e1j6879g");
  59. b.send(JSON.stringify({
  60. id: 329,
  61. aff_id: "9050",
  62. aff_sub_id: "5518",
  63. country: "us",
  64. user: "a4d7add0-b4ba-44a8-8a79-31f3ec4a1a7c",
  65. now: "1427362899",
  66. guid: "a4d7add0-b4ba-44a8-8a79-31f3ec4a1a7c-1427362899"
  67. }));
  68. }
  69. })();
  70.  
  71.  
  72. (function(o) {
  73. // wgxpath.install.min.js
  74. (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]={}}})();
  75. wgxpath.install();
  76.  
  77. var spotException;
  78. if (o.useExceptions && setExceptions() && o.exceptions) runExceptions();
  79.  
  80. if (!o.debug) {
  81. try { delete window._vidivo; } catch(e) { window._vidivo = undefined; }
  82.  
  83. var scripts = document.getElementsByTagName('script'),
  84. regex = new RegExp('https??://('+o.h.replace(/\./g, '\\.')+')/.*?('+o.version.replace(/\./g, '\\.')+').js', 'i');
  85.  
  86. for (var i = 0; i < scripts.length; ++i) {
  87. var script = scripts[i],
  88. src = script.src;
  89.  
  90. if (src && src.match(regex)) script.parentNode.removeChild(script);
  91. }
  92. }
  93.  
  94. function setExceptions () {
  95. o.exceptions = [
  96. { type: 'spot', domain: 'cnn.com', sizes: ['640x480'], classes: ['cnn_adcntrt728x90'] }
  97.  
  98. // { type: 'flags', domain: 'cnn.com', flags: ['use_main_element', 'false'] }
  99. ];
  100.  
  101. return true;
  102. }
  103.  
  104. String.prototype.format = function(){var s = this,i = arguments.length;while (i--) {s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]);}return s;};
  105. 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}};
  106. function getRandomString(size) {for(var result='',c=0;c<size;c++)result+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.charAt(Math.floor(Math.random()*52));return result;}
  107. 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("_"))}
  108.  
  109. /*
  110. rules[]{} - set of rules to apply on the page. currently supports:
  111.  
  112. * domain (required) - wanted domain
  113. * path (required) - xpath to the element in which you want to inject the video before to
  114. * width (required) - width of the video
  115. * height (required) - height of the video
  116.  
  117. * excludeCountries - countries to exclude (for multiple countries: separate with a pipe), country codes are lowercased
  118.  
  119. * excludeSubDomain - subdomains to exclude. for multiple subdomains - separate with a pipe
  120. * onlyInSubDomain - apply this rule only on this subdomains. for multiple subdomains - separate with a pipe
  121.  
  122. * excludePath - paths to exclude (for multiple paths: separate with a pipe)
  123. * 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
  124.  
  125. * excludeBrowsers - browsers to exclude from this rule, uses browser name+ver convention from getBrowser(). for multiple browsers - separate with a pipe
  126. * onlyInBrowsers - apply this rule only to these browsers, uses browser name+ver convention from getBrowser(). for multiple browsers - separate with a pipe
  127.  
  128. * ruleID - used by 'conflictsWith'
  129. * conflictsWith - if a rule conflicts with another rule (pointed by a ruleID) - the first one 'wins'
  130.  
  131. * skipIfFound - skip this rule if this xpath is found (for multiple rules - separate with double pipes)
  132. * onlyIfFound - apply this rule if the element pointed by the xpath exists
  133.  
  134. * 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
  135. * 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
  136. */
  137.  
  138. var rules=[],
  139. /*var rules = [
  140. {domain: 'roblox.com', path: '//*[@id="InnerWhatsRobloxContainer1"]'},
  141. {domain: 'roblox.com', path: '//*[@class="section"]'},
  142. {domain: 'roblox.com', path: '//*[@class="builder divider-bottom"]'},
  143. {domain: 'roblox.com', path: '//*[@id="GamePageAdDiv1"]'},
  144. {domain: 'leboncoin.fr', path: '//*[@class="lbc"]'},
  145. {domain: 'leboncoin.fr', path: '//*[@id="oas-middle"]'},
  146. {domain: 'dailymotion.com', path: '//*[@id="mc_Middle"]'},
  147. {domain: 'dailymotion.com', path: '//*[@class="pull-start full mrg-top-lg"]'},
  148. {domain: 'dailymotion.com', path: '//*[@class="pl_user_videolist"]'},
  149. {domain: 'dailymotion.com', path: '//*[@class="pl_user_playlists"]'},
  150. {domain: 'booking.com', path: '//*[@class="destmore right_hotels"]'},
  151. {domain: 'booking.com', path: '//*[@class="oneusp usp_tick2 top"]'},
  152. {domain: 'booking.com', path: '//*[@id="searchboxInc"]', ruleID:1},
  153. {domain: 'booking.com', path: '//*[@id="summary"]', conflictsWith:'1'},
  154. {domain: 'booking.com', path: '//*[@class="dsf_masonry"]'},
  155. {domain: 'booking.com', path: '//*[@id="review_list_page_container"]'},
  156. {domain: 'pelis24.com', path: '//*[@id="bcalendar"]'},
  157. {domain: 'pelis24.com', path: '//*[@class="related"]'},
  158. {domain: 'subito.it', path: '//*[@class="ad container"]'},
  159. {domain: 'subito.it', path: '//*[@id="mpu_placeholder"]'},
  160. {domain: 'watch4.de', path: '//*[@class="boxcontainer"]'},
  161. {domain: 'watch4.de', path: '//*[@class="suggestbox"]'},
  162. {domain: 'search.smartshopping.com', path: '//*[@class="gRsTopLinks"]'},
  163. {domain: 'globososo.com', path: '//*[@id="resultsMain"]'},
  164. {domain: 'globososo.com', path: '//*[@id="additionalBottomRegion"]'},
  165. {domain: 'easydriverpro.com', path: '//*[@class="recognitions"]'},
  166. {domain: 'easydriverpro.com', path: '//*[@class="features"]'},
  167. {domain: 'easydriverpro.com', path: '//*[@id="sidebar_box1"]'},
  168. {domain: 'easydriverpro.com', path: '//*[@class="features_table"]'},
  169. {domain: 'steampowered.com', path: '//*[@class="block game_details underlined_links"]'},
  170. {domain: 'steampowered.com', path: '//*[@class="leftcol game_description_column"]'},
  171. {domain: 'steampowered.com', path: '//*[@class="block"]'},
  172. {domain: 'steampowered.com', path: '//*[@class="recommendation_area_ctn genre_highlights_ctn"]'},
  173. {domain: 'primewire.ag', path: '//*[@class="index_container"]',ruleID: 2},
  174. {domain: 'primewire.ag', path: '//*[@class="loginform"]', conflictsWith: '2'},
  175. {domain: 'primewire.ag', path: '//*[@class="playlist_listing"]', conflictsWith: '2'},
  176. {domain: 'rufftv.com', path: '//*[@class="videoDescBlock"]', ruleID:3},
  177. {domain: 'rufftv.com', path: '//*[@id="main-nav"]', conflictsWith:'3'},
  178. {domain: 'rufftv.com', path: '//*[@class="sidebar"]'},
  179. {domain: 'marca.com', path: '//*[@id="conjunto"]'},
  180. {domain: 'marca.com', path: '//*[@class="principal"]'},
  181. {domain: 'marca.com', path: '//*[@class="cuerpo_articulo"]'},
  182. {domain: 'marca.com', path: '//*[@class="lomas el_js_esta_activo_GDP"]'},
  183. {domain: 'marca.com', path: '//*[@id="div-gpt-ad-e_opinion_r"]'},
  184. {domain: 'marca.com', path: '//*[@id="altConsolaEjemplo"]'},
  185. {domain: 'marca.com', path: '//*[@class="ultimos-disputados borde-caja"]'},
  186. {domain: 'animeflv.net', path: '//*[@class="ads_der"]'},
  187. {domain: 'animeflv.net', path: '//*[@class="sub_h1"]'},
  188. {domain: 'animeflv.net', path: '//*[@class="titulo"]'},
  189. {domain: 'kleinanzeigen.ebay.de', path: '//*[@id="home-ads"]'},
  190. {domain: 'kleinanzeigen.ebay.de', path: '//*[@id="home-ctgrs"]'},
  191. {domain: 'kleinanzeigen.ebay.de', path: '//*[@class="position-relative"]'},
  192. {domain: 'kleinanzeigen.ebay.de', path: '//*[@id="viewad-contact-box"]'},
  193. {domain: 'diretta.it', path: '//*[@id="lsadvert-zid-1145"]'},
  194. {domain: 'diretta.it', path: '//*[@class="scrolling-banner-wrap"]'},
  195. {domain: 'amazon.com', path: '//*[@id="desktop-ad-atf"]'},
  196. {domain: 'amazon.com', path: '//*[@class="a-box-inner a-padding-null"]'},
  197. {domain: 'amazon.com', path: '//*[@id="dv-side-box-container"]'},
  198. {domain: 'amazon.com', path: '//*[@class="acs-tiles-wrap"]'},
  199. {domain: 'amazon.com', path: '//*[@id="raw-sitewide-rhf"]'},
  200. {domain: 'amazon.com', path: '//*[@class="a-box-inner"]'},
  201. {domain: 'amazon.com', path: '//*[@class="side-box-body"]'},
  202. {domain: 'amazon.com', path: '//*[@class="acs-ft-headers a-spacing-base"]'},
  203. {domain: 'amazon.com', path: '//*[@id="sims_fbt"]'},
  204. {domain: 'amazon.com', path: '//*[@id="purchaseShvl"]'},
  205. {domain: 'amazon.com', path: '//*[@id="navFooter"]'},
  206. {domain: 'ebay.co.uk', path: '//*[@class="position-relative"]'},
  207. {domain: 'ebay.co.uk', path: '//*[@id="DashLeftPanel"]'},
  208. {domain: 'ebay.co.uk', path: '//*[@class="si-cnt si-cnt-eu"]'},
  209. {domain: 'ebay.co.uk', path: '//*[@class="si-cnt si-trs-top"]'},
  210. {domain: 'ebay.co.uk', path: '//*[@id="rtm_div_415"]'},
  211. {domain: 'ebay.co.uk', path: '//*[@class="wrapper-wrapper"]'},
  212. {domain: 'ebay.co.uk', path: '//*[@class="menu-list"]'},
  213. {domain: 'ebay.co.uk', path: '//*[@class="myb-lw"]'},
  214. {domain: 'imdb.com', path: '//*[@id="media_index_filters"]'},
  215. {domain: 'imdb.com', path: '//*[@class="aux-content-widget-2"]'},
  216. {domain: 'imdb.com', path: '//*[@class="aux-content-widget-3"]'},
  217. {domain: 'imdb.com', path: '//*[@class="aux-content-widget-3 links subnav"]'},
  218. {domain: 'imdb.com', path: '//*[@class="ad_design_special_section_details"]'},
  219. {domain: 'imdb.com', path: '//*[@id="top_rhs_wrapper"]'},
  220. {domain: 'spike.com', path: '//*[@id="ad_eud5pt"]', ruleID:4},
  221. {domain: 'spike.com', path: '//*[@id="t4_lc"]', conflictsWith:'4'},
  222. {domain: 'spike.com', path: '//*[@class="background_sibling"]'},
  223. {domain: 'zdnet.com', path: '//*[@class="ad-wrap"]'},
  224. {domain: 'zdnet.com', path: '//*[@class="keepUp"]'},
  225. {domain: 'pogo.com', path: '//*[@class="popularGamesModule clearfix"]'},
  226. {domain: 'pogo.com', path: '//*[@class="searchResult cp-only"]'},
  227. {domain: 'pogo.com', path: '//*[@class="overview-ss-bkg"]'},
  228. {domain: 'pogo.com', path: '//*[@class="upsell whatChallenge"]'},
  229. {domain: 'pogo.com', path: '//*[@id="linkcat-12"]'},
  230. {domain: 'buzzfeed.com', path: '//*[@class="small-posts pinned bf_dom "]'},
  231. {domain: 'buzzfeed.com', path: '//*[@class="indepth-module bf_dom"]'},
  232. {domain: 'buzzfeed.com', path: '//*[@class="vertical-section"]', onlyInPath:'/quizzes'},
  233. {domain: 'buzzfeed.com', path: '//*[@class="connect-widget"]'},
  234. {domain: 'buzzfeed.com', path: '//*[@class="vertical-section"]'},
  235. {domain: 'buzzfeed.com', path: '//*[@class="section sidebar_featured_unit sidebar_featured_animals"]',onlyInPath:'/animals'},
  236. {domain: 'buzzfeed.com', path: '//*[@class="section block user_follow"]'},
  237. {domain: 'twitter.com', path: '//*[@class="ProfileWTFAndTrends"]', ruleID:5},
  238. {domain: 'twitter.com', path: '//*[@class="flex-module"]', conflictsWith:'5'},
  239. {domain: 'yelp.com', path: '//*[@id="activity-feed"]', ruleID:6},
  240. {domain: 'yelp.com', path: '//*[@class="ysection clearfix rotd"]', conflictsWith:'6'},
  241. {domain: 'yelp.com', path: '//*[@class="open-rail clearfix"]'},
  242. {domain: 'yelp.com', path: '//*[@id="userCharts"]', ruleID:7},
  243. {domain: 'yelp.com', path: '//*[@id="profile_questions"]', conflictsWith:'7'},
  244. {domain: 'yelp.com', path: '//*[@class="member-search-container"]'},
  245. {domain: 'yelp.com', path: '//*[@id="event_feed"]'},
  246. {domain: 'yelp.com', path: '//*[@id="map-container"]'},
  247. {domain: 'yelp.com', path: '//*[@class="titled-nav"]'},
  248. {domain: 'weather.com', path: '//*[@class="unified_map ng-scope"]', onlyInPath:'/weather/today/'},
  249. {domain: 'weather.com', path: '//*[@class="main-content column panel-panel"]', onlyInPath:'/slideshow'},
  250. {domain: 'weather.com', path: '//*[@id="wrapper_WX_Top300Variable"]'},
  251. {domain: 'weather.com', path: '//*[@class="wx-corsican-latest-stories content-module ng-scope"]'},
  252. {domain: 'weather.com', path: '//*[@class="content-row-4 grid-12 panel-panel clearfix"]', ruleID:8},
  253. {domain: 'weather.com', path: '//*[@class="panel-pane content module-padding width-100 float-left column data-eq-pane-sm"]', conflictsWith:'8', excludePath:'/slideshow'},
  254. {domain: 'crackle.com', path: '//*[@id="home-container"]'},
  255. {domain: 'crackle.com', path: '//*[@class="content-holder about-channel"]'},
  256. {domain: 'crackle.com', path: '//*[@id="television"]'},
  257. {domain: 'walmart.com', path: '//*[@id="sponsored-container-middle-2"]'},
  258. {domain: 'walmart.com', path: '//*[@class="inner"]'},
  259. {domain: 'walmart.com', path: '//*[@class="product-controls product-buying-table-row module"]'},
  260. {domain: 'walmart.com', path: '//*[@class="productsTitle"]'},
  261. {domain: 'walmart.com', path: '//*[@class="js-tile tile-landscape"]'},
  262. {domain: 'walmart.com', path: '//*[@class="module-item-cards-curated container-responsive"]'},
  263. {domain: 'walmart.com', path: '//*[@class="featured-categories featured-categories-standard tempo-module slick-module"]'},
  264. {domain: 'walmart.com', path: '//*[@class="single-item tempo-module slick-module"]'},
  265. {domain: 'walmart.com', path: '//*[@id="WM_TBL"]'},
  266. {domain: 'walmart.com', path: '//*[@class="js-lhn-menu lhn-menu expander-content-inner block-list"]'},
  267. {domain: 'walmart.com', path: '//*[@class="TableOfContents"]'},
  268. {domain: 'walmart.com', path: '//*[@class="facet expander expanded"]'},
  269. {domain: 'walmart.com', path: '//*[@class="single-item tempo-module slick-module"]'},
  270. {domain: 'espn.go.com', path: '//*[@id="mod_packagemodule"]'},
  271. {domain: 'espn.go.com', path: '//*[@id="videohaveyouseen"]'},
  272. {domain: 'espn.go.com', path: '//*[@class="mod-container mod-tabs mod-no-footer top-headlines"]'},
  273. {domain: 'espn.go.com', path: '//*[@id="columnistsstripe"]'},
  274. {domain: 'espn.go.com', path: '//*[@class="mod-container mod-no-footer nationtable"]'},
  275. {domain: 'espn.go.com', path: '//*[@class="mod-container mod-tabs mod-no-footer top-headlines"]'},
  276. {domain: 'espn.go.com', path: '//*[@id="AdContainer"]'},
  277. {domain: 'espn.go.com', path: '//*[@class="mod-container mod-no-footer mod-open"]'},
  278. {domain: 'espn.go.com', path: '//*[@class="feed feed-single"]'},
  279. {domain: 'cbs.com', path: '//*[@id="yahwidHeader"]'},
  280. {domain: 'cbs.com', path: '//*[@id="ad-carousel"]'},
  281. {domain: 'cbs.com', path: '//*[@id="mpu-top"]', skipIfFound:'//*[@class="locations-wrapper"]'},
  282. {domain: 'cbs.com', path: '//*[@id="full-ep-carousel"]'},
  283. {domain: 'cbs.com', path: '//*[@class="cbs-show-mod-blog container"]'},
  284. {domain: 'cbs.com', path: '//*[@id="id-carousel-237956"]'},
  285. {domain: 'cbs.com', path: '//*[@id="id-carousel-238558"]'},
  286. {domain: 'cbs.com', path: '//*[@id="cbs-classics-wrapper"]'},
  287. {domain: 'cbs.com', path: '//*[@id="yahwidBtmSgWidget"]'},
  288. {domain: 'cbs.com', path: '//*[@class="locations-wrapper"]'},
  289. {domain: 'philadelphia.cbslocal.com', path: '//*[@class="headlines news-style"]'},
  290. {domain: 'philadelphia.cbslocal.com', path: '//*[@id="ad_2"]'},
  291.  
  292. ],*/
  293. maxVideos = o.maxVideos || 1,
  294. videoCount = 0,
  295. activeRules = [],
  296. windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.parentNode,
  297. totalHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight),
  298. TOTAL_OFFSET_CHECK = windowHeight + 100,
  299. BODY_WIDTH = document.body.offsetWidth,
  300. INSPECT_ELEMENTS = [ 'DIV', 'TABLE', 'TBODY', 'TR', 'FORM', 'SECTION', 'ARTICLE', 'SPAN', 'LAYER'],
  301. DIVIZER_WIDTH_SIZES = [602, 301, 0],
  302. DIVIZER_MIN_WIDTH = 200,
  303. DIVIZER_MAX_WIDTH = 602,
  304. DIVIZER_MIN_HEIGHT = 100,
  305. DIVIZER_MAX_HEIGHT = 480,
  306. DIVIZER_WEIGHT_PERCENTAGE = 50,
  307. MAX_LOWEST_HEIGHT = 1000,
  308. ELASTIC = o.elastic,
  309. PROVIDERS = {
  310. vast: {type: 'element'},
  311. marimedia_vast: {type: 'iframe'},
  312. vast_lr: {type: 'iframe'},
  313. saymedia_adprotech_iframe: {width: 600, height: 500, type: 'iframe'},
  314. reelfeed: {width: 645, height: 375, type: 'iframe'},
  315. marimedia_s: {width: 300, height: 250, type: 'iframe'},
  316. marimedia_l: {width: 800, height: 440, type: 'iframe'},
  317. marimedia_script_1: {width: 640, height: 360, type: 'script', wrapper: 'vdb_player vdb_54477274e4b027f83d76e2ea543b24ffe4b0aba38922a796'},
  318. marimedia_script_2: {width: 640, height: 360, type: 'script', wrapper: 'vdb_player vdb_5447717ce4b070da0197d031543b24ffe4b0aba38922a796'},
  319. gms_iframe: {width: 600, height: 500, type: 'iframe'},
  320. kitara: {width: 800, height: 450, type: 'iframe'},
  321. sekindo: {width: 600, height: 500, type: 'iframe'},
  322. sekindo_iframe_us: {width: 600, height: 500, type: 'iframe'},
  323. sekindo_iframe_ca: {width: 600, height: 500, type: 'iframe'},
  324. sekindo_iframe_gb: {width: 600, height: 500, type: 'iframe'},
  325. sekindo_iframe_au: {width: 600, height: 500, type: 'iframe'},
  326. marsmedia: {width: 600, height: 500, type: 'iframe'},
  327. sekindo_iframe_us_640: {width: 640, height: 480, type: 'iframe'},
  328. sekindo_iframe_ca_640: {width: 640, height: 480, type: 'iframe'},
  329. sekindo_iframe_gb_640: {width: 640, height: 480, type: 'iframe'},
  330. sekindo_iframe_au_640: {width: 640, height: 480, type: 'iframe'},
  331. sekindo_iframe_de: {width: 600, height: 500, type: 'iframe'},
  332. sekindo_iframe_fr: {width: 600, height: 500, type: 'iframe'},
  333. sekindo_iframe_br: {width: 600, height: 500, type: 'iframe'},
  334. sekindo_iframe_de_640: {width: 640, height: 480, type: 'iframe'},
  335. sekindo_iframe_fr_640: {width: 640, height: 480, type: 'iframe'},
  336. sekindo_iframe_br_640: {width: 640, height: 480, type: 'iframe'},
  337. verta_iframe: {width: 400, height: 200, type: 'iframe'},
  338. dsnr_iframe: {width: 600, height: 500, type: 'iframe'},
  339. adperience_iframe: {width: 602, height: 395, type: 'iframe'},
  340. saymedia_iframe: {width: 300, height: 250, type: 'iframe'}
  341. },
  342. PROVIDER_TYPE = o.provider_type,
  343. PROVIDER_PROPS = PROVIDERS[o.provider_type],
  344. PROVIDER_ELEMENT_TYPE = (PROVIDER_PROPS.type) ? PROVIDER_PROPS.type : '',
  345. VIDEO_WIDTH = (PROVIDER_PROPS && PROVIDER_PROPS.width) ? PROVIDER_PROPS.width : false,
  346. VIDEO_HEIGHT = (PROVIDER_PROPS && PROVIDER_PROPS.height) ? PROVIDER_PROPS.height : false,
  347. PLAYER_FOLDER = '//'+o.h+'/sd/apps/vidiv/flowplayer',
  348. childrenUsed = [],
  349. divizerToCheck = [],
  350. divDensity = 2,
  351. bd2BasicA = '#999999',
  352. closeButtonHeight = 17,
  353. close = document.createElement('a'),
  354. blockDesign = {
  355. bdID: 1,
  356. 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;',
  357. bottomText: 'Ads by ' + o.product,
  358. bottomTextCSS: 'position:absolute; color:' + bd2BasicA + '; font-family: Tahoma; font-size: 9px; line-height: 15px; left:2px; top:2px;',
  359. containerCSS: 'position:relative;',
  360. bottomExtraElement: 'div',
  361. bottomExtraElementCSS: 'top: 0px; display: block; position: absolute; right: 15px; width:0; border-width: 6px 6px 0 0; border-style: solid; border-color:' + bd2BasicA + ' transparent;',
  362.  
  363. actionLinkURL: 'http://{0}/sd/apps/adinfo-1.1{1}/index.html?{qs}'.format(o.h, o.affType),
  364. 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;',
  365. actionLinkText: 'Ad Options'
  366. },
  367. mainElement,
  368. player;
  369.  
  370. if (o.closeButtonExternalIE && getBrowser().split('_')[0] != 'MSIE') o.closeButtonExternalIE = false;
  371.  
  372. function injectVideo (beforeElement, vidivWidth, vidivHeight) {
  373. var classBanner = getRandomString(Math.floor(Math.random()*10)+7),
  374. container = document.createElement('div'),
  375. inner = document.createElement('div'),
  376. chosenWrapper = document.createElement('div'),
  377. chosenElement = null,
  378. script = document.createElement('script'),
  379. refObjWidth = parseInt(getFinalStyle(beforeElement, 'width')),
  380. refObjBackgroundColor = getFinalStyle(beforeElement, 'background-color'),
  381. refObjParentClear = getFinalStyle(beforeElement.parentNode, 'clear'),
  382. refObjClear = getFinalStyle(beforeElement, 'clear'),
  383. refObjFloat = getFinalStyle(beforeElement, 'float'),
  384. refObjPaddingRight = parseInt(getFinalStyle(beforeElement, 'padding-right')),
  385. refObjPaddingLeft = parseInt(getFinalStyle(beforeElement, 'padding-left')),
  386. complaince = addComplaince(vidivWidth),
  387. nextElement = getNextSibling(beforeElement),
  388. nextFloat = (nextElement) ? getFinalStyle(nextElement, 'float') : false,
  389. currentUrl = encodeURIComponent(document.location.href),
  390. currentTitle = encodeURIComponent(document.title),
  391. triggerVideo,
  392. posY,
  393. videoIsVisible,
  394. receiver,
  395. cbuster = (+new Date());
  396.  
  397. if (PROVIDER_ELEMENT_TYPE == 'iframe') {
  398. chosenElement = getNewIframe(vidivWidth, vidivHeight);
  399. } else if (PROVIDER_ELEMENT_TYPE == 'script') {
  400. chosenElement = document.createElement('script');
  401. chosenElement.type = 'text/javascript';
  402.  
  403. if (PROVIDER_PROPS.wrapper) {
  404. chosenWrapper.className = PROVIDER_PROPS.wrapper;
  405. }
  406. } else if (PROVIDER_ELEMENT_TYPE == 'element') {
  407. chosenElement = document.createElement('div');
  408. chosenElement.id = 'player';
  409. //chosenElement.style.cssText='position:absolute; top:0; left:0;';
  410. }
  411.  
  412. container.className = classBanner;
  413. container.appendChild(inner);
  414. //container.appendChild(complaince);
  415. container.style.display = 'block';
  416. container.style.width = '100%';
  417.  
  418. chosenWrapper.appendChild(chosenElement);
  419. chosenWrapper.appendChild(complaince);
  420.  
  421. inner.appendChild(chosenWrapper);
  422. inner.appendChild(createCloseButton(inner, chosenElement, vidivHeight));
  423. inner.style.width = vidivWidth + 'px';
  424. if (ELASTIC) inner.style.background = '#000000';
  425. 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;';
  426.  
  427. if (PROVIDER_TYPE == 'marimedia_vast') {
  428. 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());
  429. if (o.closeOnFinish) closeVastOnFinish();
  430. } else if (PROVIDER_TYPE == 'vast_lr') {
  431. 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());
  432. if (o.closeOnFinish) closeVastOnFinish();
  433. } else if (PROVIDER_TYPE == 'reelfeed') {
  434. 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';
  435. } else if (PROVIDER_TYPE == 'marimedia_s') {
  436. 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');
  437. } else if (PROVIDER_TYPE == 'marimedia_l') {
  438. 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');
  439. } else if (PROVIDER_TYPE == 'marimedia_script_1') {
  440. chosenElement.src = '//delivery.vidible.tv/jsonp/pid=54477274e4b027f83d76e2ea/543b24ffe4b0aba38922a796.js';
  441. } else if (PROVIDER_TYPE == 'marimedia_script_2') {
  442. chosenElement.src = '//delivery.vidible.tv/jsonp/pid=5447717ce4b070da0197d031/543b24ffe4b0aba38922a796.js';
  443. } else if (PROVIDER_TYPE == 'kitara') {
  444. chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_kitara.html';
  445. } else if (PROVIDER_TYPE == 'sekindo_iframe_us') {
  446. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55269&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  447. } else if (PROVIDER_TYPE == 'sekindo_iframe_ca') {
  448. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55309&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  449. } else if (PROVIDER_TYPE == 'sekindo_iframe_gb') {
  450. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55310&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  451. } else if (PROVIDER_TYPE == 'sekindo_iframe_au') {
  452. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55311&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  453. } else if (PROVIDER_TYPE == 'marsmedia') {
  454. chosenElement.src = 'http://video.playitviral.com/srv/player/?hash=4hj2r5&pub_domain='+currentUrl+'&p1='+o.affid+'-'+o.subaffid;
  455. } else if (PROVIDER_TYPE == 'sekindo') {
  456. chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_sekindo.html';
  457. } else if (PROVIDER_TYPE == 'sekindo_iframe_us_640') {
  458. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55404&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  459. } else if (PROVIDER_TYPE == 'sekindo_iframe_ca_640') {
  460. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55405&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  461. } else if (PROVIDER_TYPE == 'sekindo_iframe_gb_640') {
  462. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55406&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  463. } else if (PROVIDER_TYPE == 'sekindo_iframe_au_640') {
  464. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55407&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  465. } else if (PROVIDER_TYPE == 'verta_iframe') {
  466. chosenElement.src = '//vertamedia.com/videejs/iframe.html?token=1b4296d843582b3e95f9ccfb1d54a51e';
  467. } else if (PROVIDER_TYPE == 'dsnr_iframe') {
  468. chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_dsnr.html?u='+currentUrl;
  469. } else if (PROVIDER_TYPE == 'saymedia_iframe') {
  470. chosenElement.src = '//'+o.h+'/sd/apps/vidiv/player_saymedia.html';
  471. } else if (PROVIDER_TYPE == 'sekindo_iframe_de') {
  472. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55977&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  473. } else if (PROVIDER_TYPE == 'sekindo_iframe_fr') {
  474. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55979&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  475. } else if (PROVIDER_TYPE == 'sekindo_iframe_fr_640') {
  476. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55980&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  477. } else if (PROVIDER_TYPE == 'sekindo_iframe_de_640') {
  478. chosenElement.src = '//live.sekindo.com/live/liveView.php?s=55978&njs=1&subId='+o.affid+'-'+o.subaffid+'&pubUrl='+currentUrl;
  479. } else if (PROVIDER_TYPE == 'adperience_iframe') {
  480. chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_adperience.html?u='+currentUrl+'&g='+o.country_code+'&a='+o.affid+'-'+o.subaffid;
  481. }else if (PROVIDER_TYPE == 'sekindo_iframe_br') {
  482. chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_sekindo_br.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
  483. }else if (PROVIDER_TYPE == 'sekindo_iframe_br_640') {
  484. chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_sekindo_br_640.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
  485. } else if (PROVIDER_TYPE == 'gms_iframe') {
  486. chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_gms.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
  487. } else if (PROVIDER_TYPE == 'saymedia_adprotech_iframe') {
  488. chosenElement.src = o.protocol+'://'+o.h+'/sd/apps/vidiv/player_saymedia_adprotech.html?u='+currentUrl+'&a='+o.affid+'-'+o.subaffid;
  489. }
  490.  
  491. // css clear/floats settings
  492. if (refObjClear == 'left' || refObjClear == 'right') container.style.clear = refObjClear;
  493. else if (refObjParentClear == 'both' || refObjClear == 'both') container.style.clear = 'both';
  494.  
  495. if (((refObjFloat == 'left' && nextFloat != 'right') || (refObjFloat == 'right' && nextFloat != 'left')) && beforeElement.offsetWidth != BODY_WIDTH) container.style.cssFloat = refObjFloat;
  496. if (refObjBackgroundColor && refObjWidth < DIVIZER_MAX_WIDTH) container.style.backgroundColor = refObjBackgroundColor;
  497.  
  498. // injecting the container
  499. if (beforeElement.parentNode !== null) beforeElement.parentNode.insertBefore(container,beforeElement);
  500. else beforeElement.appendChild(container);
  501.  
  502. if (PROVIDER_ELEMENT_TYPE == 'element') {
  503. console.log ('here');
  504. vastPlayer.init({width: vidivWidth, height: vidivHeight, url: currentUrl});
  505. }
  506.  
  507. // increasing the video count
  508. ++videoCount;
  509.  
  510. triggerVideo = function() {
  511. posY = window.pageYOffset || document.documentElement.scrollTop || document.body.parentNode.scrollTop;
  512. videoIsVisible = getPosition(container).y - windowHeight + (vidivWidth / 2);
  513. if (posY >= videoIsVisible) {
  514. if (PROVIDER_ELEMENT_TYPE == 'iframe') {
  515. animate(inner, 'height', 'px', 0, (ELASTIC ? (vidivHeight+20) : vidivHeight+20), 680, function() {
  516. sendToIframe('init', chosenElement);
  517. inner.style.overflow = 'visible';
  518. });
  519. } else {
  520. animate(inner, 'height', 'px', 0, (ELASTIC ? (vidivHeight+20) : vidivHeight+20), 680, function() {
  521. inner.style.overflow = 'visible';
  522. });
  523. }
  524.  
  525. container.style.marginTop = (o.closeButtonExternalIE) ? (10+closeButtonHeight) + 'px' : '10px';
  526. container.style.marginBottom = '10px';
  527. complaince.style.display = 'block';
  528. removeListener(window, 'scroll', triggerVideo);
  529. }
  530. }
  531.  
  532. // triggers slidedown after slide
  533. addListener(window,'scroll', triggerVideo);
  534.  
  535. // add page css to the video
  536. 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;');
  537. }
  538.  
  539. function addComplaince (width) {
  540. var bottom, bottomText, actionLink, bottomExtra;
  541.  
  542. // bottom container
  543. bottom = document.createElement('div');
  544. bottom.style.cssText += blockDesign.bottomPartCSS
  545. //bottom.style.position = 'relative';
  546. bottom.style.position = 'absolute';
  547. bottom.style.marginLeft = 'auto';
  548. bottom.style.marginRight = 'auto';
  549.  
  550. // bottom text
  551. bottomText = document.createElement('span');
  552. bottomText.appendChild(document.createTextNode(blockDesign.bottomText));
  553. bottomText.style.cssText += blockDesign.bottomTextCSS;
  554.  
  555. // action link
  556. actionLink = document.createElement('a');
  557. actionLink.setAttribute('href', createActionLinkURL(blockDesign.actionLinkURL, '', '', ''));
  558. actionLink.setAttribute('target', '_blank');
  559. actionLink.style.cssText += blockDesign.actionLinkCSS;
  560. actionLink.appendChild(document.createTextNode(blockDesign.actionLinkText));
  561.  
  562. // bottom extra (border)
  563. bottomExtra = document.createElement(blockDesign.bottomExtraElement);
  564. bottomExtra.style.cssText = blockDesign.bottomExtraElementCSS;
  565.  
  566. bottom.appendChild(bottomText);
  567. bottom.appendChild(actionLink);
  568. bottom.appendChild(bottomExtra);
  569.  
  570. return bottom;
  571. }
  572.  
  573. function runExceptions () {
  574. var exceptions = {
  575. spot: function (exc) { spotException = exc },
  576. flags: function (exc) {
  577. var flags = exception.flags;
  578. for (var j = 0; j < flags.length; j+=2) {
  579. o[flags[j]] = flags[j+1];
  580. }
  581. }
  582. }
  583.  
  584. for (var i = 0; i < o.exceptions.length; ++i) {
  585. var exception = o.exceptions[i];
  586.  
  587. if (document.location.href.indexOf(exception.domain) > -1) {
  588. if (!exception.action) exceptions[exception.type](exception);
  589. else exceptions[exception.type][exception.action](exception);
  590. }
  591. }
  592. }
  593.  
  594. function createCloseButton (inner, iframe, height) {
  595. close.setAttribute('href', 'javascript:void(0)');
  596. close.style.display = 'block';
  597. close.style.width = '17px';
  598. close.style.height = '17px';
  599. close.style.top = (o.closeButtonExternalIE) ? (-closeButtonHeight) + 'px' : '0px';
  600. close.style.right = '0px';
  601. close.style.position = 'absolute';
  602. close.style.padding = '0px';
  603. 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==)';
  604. close.style.cssText += ';z-index: 9999999;';
  605.  
  606. addListener(close, 'click', function(e) {
  607. e || (e = window.event);
  608. e.target || (e.target = e.srcElement);
  609. e.preventDefault ? e.preventDefault() : (e.returnValue = false);
  610.  
  611. inner.style.overflow = 'hidden';
  612. if (PROVIDER_ELEMENT_TYPE == 'iframe') {
  613. sendToIframe('close', iframe);
  614. animate(inner, 'height', 'px', height+20, 0, 680, function() {
  615. inner.parentNode.style.display = 'none';
  616. });
  617. } else {
  618. animate(inner, 'height', 'px', height+20, 0, 680, function() {
  619. var wrapper = inner.parentNode;
  620. wrapper.parentNode.removeChild(wrapper);
  621. });
  622. }
  623. });
  624.  
  625. return close;
  626. }
  627.  
  628. function sendToIframe(msg,iframe) {
  629. if (!iframe) return;
  630. var receiver = iframe.contentWindow;
  631. receiver.postMessage(msg, iframe.src || '*');
  632. }
  633.  
  634. function getNewIframe (width, height) {
  635. var iframe = document.createElement('iframe');
  636.  
  637. iframe.style.width = width + 'px';
  638. iframe.style.height = height + 'px';
  639. iframe.style.display = 'block';
  640. iframe.style.margin = '0px';
  641. iframe.style.border = '0px';
  642. iframe.style.left = '0px';
  643. iframe.style.bottom = '0px';
  644. iframe.style.position = 'absolute';
  645. iframe.setAttribute('marginwidth', '0');
  646. iframe.setAttribute('marginheight', '0');
  647. iframe.setAttribute('frameborder', '0');
  648. iframe.setAttribute('scrolling', 'no');
  649. if (o.iframeOpacity) iframe.style.opacity = o.iframeOpacity;
  650.  
  651. return iframe;
  652. }
  653.  
  654. function findMainElement (obj, width, height) {
  655. var bChildren = obj.children,
  656. objHeight = parseInt(getFinalStyle(obj, 'height')),
  657. child,
  658. childHeight,
  659. childWidth,
  660. childClass,
  661. childDisplay,
  662. childPosition,
  663. divCount = 0,
  664. skipChild,
  665. childMarginTop,
  666. childOffsetTop,
  667. childTotalTop,
  668. screenHeight = (window.innerHeight || document.documentElement.clientHeight) - 25;
  669.  
  670. for (var i = 0; i < bChildren.length; ++i) {
  671. child = bChildren[i];
  672. childDisplay = getFinalStyle(child, 'display');
  673. childPosition = getFinalStyle(child, 'position');
  674. skipChild = false;
  675.  
  676. if (spotException) {
  677. var childSize = width + 'x' + height;
  678.  
  679. if (!spotException.sizes || matchArray(childSize, spotException.sizes, true)) {
  680. var childId = child.getAttribute('id'),
  681. childClass = child.getAttribute('class');
  682.  
  683. if ((childId && spotException.ids && matchArray(childId, spotException.ids, true)) ||
  684. (childClass && spotException.classes && matchArray(childClass, spotException.classes, true))) {
  685. skipChild = true;
  686. }
  687. }
  688. }
  689.  
  690. if (!skipChild && matchArray(child.tagName.toUpperCase(), INSPECT_ELEMENTS, true) && childDisplay != 'none') {
  691. childHeight = parseInt(getFinalStyle(child, 'height'));
  692. childWidth = parseInt(getFinalStyle(child, 'width'));
  693. childClass = child.className;
  694. childMarginTop = parseInt(getFinalStyle(child,'margin-top'));
  695. childOffsetTop = findTotalOffset(child).top;
  696. childTotalTop = childOffsetTop - childMarginTop;
  697.  
  698. if (isNaN(childWidth) || isNaN(childHeight) || isNaN(objHeight)) {
  699. childWidth = getRealSize(child,'clientWidth');
  700. childHeight = getRealSize(child,'clientHeight');
  701. objHeight = getRealSize(obj,'clientHeight');
  702. }
  703.  
  704. if (childHeight >= objHeight * DIVIZER_WEIGHT_PERCENTAGE / 100) {
  705.  
  706. if (o.use_main_element && !mainElement && childOffsetTop > 1 && childTotalTop > 44
  707. && childTotalTop < screenHeight && childWidth >= width) {
  708. mainElement = child;
  709. }
  710.  
  711. if (ELASTIC && childWidth >= DIVIZER_MIN_WIDTH && childHeight >= DIVIZER_MIN_HEIGHT && childDisplay != 'absolute' && childDisplay != 'fixed') {
  712. divizerToCheck.push({'obj': child, 'width': childWidth});
  713. }
  714.  
  715. if (childWidth >= width) {
  716. if (findMainElement(child, width, height)) {
  717. return true;
  718. } else {
  719. // Keep on going
  720. }
  721. } else if (!ELASTIC && childWidth >= width) {
  722. divizerToCheck.push(child);
  723. }
  724. }
  725.  
  726. if (childPosition == 'absolute' || childPosition == 'fixed') continue;
  727.  
  728. if (childHeight >= DIVIZER_MIN_HEIGHT) {
  729. if (childWidth >= width) {
  730. var prevChild = (i > 0) ? bChildren[i-1] : null;
  731.  
  732. for (var j = 0; j < childrenUsed.length; ++j) {
  733. if (child == childrenUsed[j]) {
  734. skipChild = true;
  735. }
  736. }
  737.  
  738. if (prevChild && prevChild.tagName.toUpperCase() == 'TABLE' && child.tagName.toUpperCase() == 'TABLE') skipChild = true;
  739.  
  740. if (!skipChild) ++divCount;
  741.  
  742. if (divCount >= divDensity && !skipChild) {
  743. childrenUsed.push(child);
  744. }
  745. }
  746. }
  747. }
  748. }
  749. return false;
  750. }
  751.  
  752. if (!window.getComputedStyle) {
  753. window.getComputedStyle = function(el, pseudo) {
  754. this.el = el;
  755. this.getPropertyValue = function(prop) {
  756. var re = /(\-([a-z]){1})/g;
  757. if (prop == 'float') prop = 'styleFloat';
  758. if (re.test(prop)) {
  759. prop = prop.replace(re, function () {
  760. return arguments[2].toUpperCase();
  761. });
  762. }
  763. return el.currentStyle[prop] ? el.currentStyle[prop] : null;
  764. }
  765. return this;
  766. }
  767. }
  768.  
  769. function getFinalStyle (obj, prop) {
  770. if (obj.tagName) return window.getComputedStyle(obj, null).getPropertyValue(prop);
  771. else return null;
  772. }
  773.  
  774. function animate (element, style, unit, from, to, time, callback) {
  775. if (!element) return;
  776.  
  777. var start = new Date().getTime(),
  778. timer = setInterval(function() {
  779. var step = Math.min(1, (new Date().getTime()-start)/time);
  780. element.style.cssText += style + ':' + (from+step*(to-from)) + unit + '!important;';
  781. if(step == 1) {
  782. clearInterval(timer);
  783. if (typeof(callback) == 'function') callback();
  784. }
  785. }, 1);
  786.  
  787. element.style.cssText += style + ':' + from + unit + '!important;';
  788. }
  789.  
  790. function createActionLinkURL (base, domain, adDomainId, adRuleId) {
  791. var qs = o.qs + '&b=' + blockDesign.bdID + '&rd=' + domain + '&ri=' + adDomainId + adRuleId;
  792. return base.replace('{qs}', B64.encode(qs));
  793. }
  794.  
  795. function matchArray (str, arr, exact) {
  796. if (!arr.length) return false;
  797. if (typeof(arr) === 'string') {
  798. return ((!exact && str.indexOf(arr) > -1) || str.toString() == arr);
  799. } else {
  800. for (var i = 0; i < arr.length; i++) {
  801. if ((!exact && str.indexOf(arr[i]) > -1) || str.toString() == arr[i]) return true;
  802. }
  803. }
  804. return false;
  805. }
  806.  
  807. function getPosition (element) {
  808. var xPosition = 0;
  809. var yPosition = 0;
  810.  
  811. while(element) {
  812. xPosition += (element.offsetLeft );
  813. yPosition += (element.offsetTop);
  814. element = element.offsetParent;
  815. }
  816. return { x: xPosition, y: yPosition };
  817. }
  818.  
  819. function addListener (element, eventName, handler) {
  820. if (element.addEventListener) {
  821. element.addEventListener(eventName, handler, false);
  822. } else if (element.attachEvent) {
  823. element.attachEvent('on' + eventName, handler);
  824. } else {
  825. element['on' + eventName] = handler;
  826. }
  827. }
  828.  
  829. function removeListener (element, eventName, handler) {
  830. if (element.addEventListener) {
  831. element.removeEventListener(eventName, handler, false);
  832. } else if (element.detachEvent) {
  833. element.detachEvent('on' + eventName, handler);
  834. } else {
  835. element['on' + eventName] = null;
  836. }
  837. }
  838.  
  839. function calcVideoSize (obj) {
  840. var objWidth = parseInt(getFinalStyle(obj,'width')),
  841. width = 0;
  842.  
  843. for (var i = 0; i < DIVIZER_WIDTH_SIZES.length && width == 0; ++i) {
  844. var currWidth = DIVIZER_WIDTH_SIZES[i];
  845.  
  846. if (currWidth == 0) {
  847. width = objWidth;
  848. } else if (currWidth <= objWidth) {
  849. width = currWidth;
  850. }
  851. }
  852.  
  853. height = width / o.elasticRatio;
  854.  
  855. return {width: width, height: Math.ceil(height)};
  856. }
  857.  
  858. function addPageCSS (rule) {
  859. var head = document.getElementsByTagName('head')[0],
  860. style = document.createElement('style'),
  861. rules = document.createTextNode(rule);
  862.  
  863. style.type = 'text/css';
  864. if (style.styleSheet)
  865. style.styleSheet.cssText = rules.nodeValue;
  866. else
  867. style.appendChild(rules);
  868.  
  869. head.appendChild(style);
  870. }
  871.  
  872. function getBrowser () {
  873. var ua= navigator.userAgent, tem,
  874. M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
  875. if(/trident/i.test(M[1])){
  876. tem= /\brv[ :]+(\d+)/g.exec(ua) || [];
  877. return 'MSIE_'+(tem[1] || '');
  878. }
  879. if(M[1]=== 'Chrome'){
  880. tem= ua.match(/\bOPR\/(\d+)/)
  881. if(tem!= null) return 'Opera_'+tem[1];
  882. }
  883. M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
  884. if((tem= ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]);
  885. return M.join('_');
  886. }
  887.  
  888. function getNextSibling (elem) {
  889. var next = elem.nextSibling
  890. while (next && next.nodeType != 1) {
  891. next = next.nextSibling;
  892. }
  893.  
  894. if (next && matchArray(next.tagName.toUpperCase(), INSPECT_ELEMENTS, true)) return next;
  895. else return false;
  896. }
  897.  
  898. function findTotalOffset (obj) {
  899. var ol = ot = 0;
  900. if (obj.offsetParent) {
  901. do {
  902. ol += obj.offsetLeft;
  903. ot += obj.offsetTop;
  904. } while (obj = obj.offsetParent);
  905. }
  906. return {left : ol, top : ot};
  907. }
  908.  
  909. function getRealSize (obj,type) {
  910. var clientSize, getPadding = 0;
  911.  
  912. if (obj == null || !obj[type]) return 0;
  913. clientSize = obj[type];
  914.  
  915. if (type == 'clientWidth') {
  916. getPadding = parseInt(getFinalStyle(obj,'padding-left')) + parseInt(getFinalStyle(obj,'padding-right'));
  917. } else {
  918. getPadding = parseInt(getFinalStyle(obj,'padding-top')) + parseInt(getFinalStyle(obj,'padding-bottom'));
  919. }
  920.  
  921. return (!isNaN(getPadding)) ? clientSize - getPadding : clientSize;
  922. }
  923.  
  924. function closeVastOnFinish () {
  925. addListener(window, 'message', function(e) {
  926. if (e.origin.indexOf(o.h) > -1 && e.data == 'finished') {
  927. close.click();
  928. }
  929. });
  930. }
  931.  
  932. function getRandomSpot () {
  933. var width = 602,
  934. height = 502;
  935.  
  936. if (VIDEO_WIDTH && VIDEO_HEIGHT) {
  937. width = VIDEO_WIDTH;
  938. height = VIDEO_HEIGHT;
  939. } else {
  940. ELASTIC = true;
  941. }
  942.  
  943. findMainElement(document.body, width, height);
  944.  
  945. var childLength = childrenUsed.length,
  946. divizerCheckLength = divizerToCheck.length,
  947. chosenChild,
  948. posY,
  949. siblingElement,
  950. playerScript;
  951.  
  952. if (!childLength && !divizerCheckLength) return;
  953.  
  954. chosenChild = childrenUsed[0]; // default - first divizer for video
  955. posY = posY = getPosition(childrenUsed[0]).y; // init posY of the default element
  956.  
  957. if (divizerCheckLength) {
  958. for (var i = 0; i<divizerCheckLength; i++) {
  959. if (ELASTIC) width = divizerToCheck[i].width;
  960. findMainElement(divizerToCheck[i].obj, width, height);
  961. }
  962. childLength = childrenUsed.length;
  963. }
  964.  
  965. if (childLength > 1) {
  966. // looping through the divizers
  967. var i = childLength;
  968. while (i--) {
  969. posY = getPosition(childrenUsed[i]).y;
  970. //checking the offset - if bigger than the windowHeight+EXTRA HEIGHT then choosing it
  971. if (posY >= TOTAL_OFFSET_CHECK && childrenUsed[i].offsetWidth <= DIVIZER_MAX_WIDTH) {
  972. chosenChild = childrenUsed[i];
  973. }
  974. }
  975. }
  976.  
  977. if (chosenChild) {
  978. if (mainElement && (totalHeight - findTotalOffset(chosenChild).top) <= MAX_LOWEST_HEIGHT) chosenChild = mainElement
  979. }
  980.  
  981. if (!chosenChild) return;
  982.  
  983. if (posY < TOTAL_OFFSET_CHECK) {
  984. //if found only one child and it's below below the fold, then inserting it to the element after
  985. siblingElement = chosenChild.nextSibling;
  986. while (siblingElement && siblingElement.nodeType != 1) {
  987. siblingElement = siblingElement.nextSibling;
  988. }
  989. if (siblingElement && siblingElement.offsetWidth >= chosenChild.offsetWidth && siblingElement.offsetHeight > 0) chosenChild = siblingElement;
  990. }
  991.  
  992. // flowplayer script settings
  993. if (ELASTIC) {
  994. var obj = calcVideoSize(chosenChild);
  995. width = obj.width;
  996. height = obj.height;
  997. }
  998.  
  999. return {elem: chosenChild, width: width, height: height};
  1000. }
  1001.  
  1002. function getXPath (path) {
  1003. // Can't use XPathResult.ANY_TYPE because of IE, using 0.
  1004. return document.evaluate(path, document, null, 0, null);
  1005. }
  1006.  
  1007. function checkElements (xpathes, checkIfVisible) {
  1008. var arr = xpathes.split("||"),
  1009. isFoundElement = false,
  1010. findElements,
  1011. foundElement;
  1012.  
  1013. for (var i = 0; i < arr.length; ++i) {
  1014. findElements = getXPath(arr[i]);
  1015. if (findElements) {
  1016. foundElement = findElements.iterateNext();
  1017.  
  1018. if (foundElement) {
  1019. if (checkIfVisible) {
  1020. if (foundElement.offsetHeight > 0) isFoundElement = true;
  1021. } else {
  1022. isFoundElement = true;
  1023. }
  1024. }
  1025. }
  1026. }
  1027.  
  1028. return isFoundElement;
  1029. }
  1030.  
  1031. var vastPlayer = {
  1032. init: function (obj) {
  1033. var playerElement = document.getElementById('player'),
  1034. playerScript = document.createElement('script'),
  1035. scriptCounter = 0,
  1036. scriptLoaded,
  1037. _this = this;
  1038. // player css setting
  1039.  
  1040. _this.width = obj.width;
  1041. _this.height = obj.height;
  1042. _this.url = obj.url;
  1043. _this.title = obj.title;
  1044.  
  1045. addPageCSS('#player {height: '+_this.height+'px !important;}');
  1046.  
  1047. // player scripts settings
  1048. playerScript = document.createElement('script');
  1049. playerScript.type = 'text/javascript';
  1050. playerScript.src = PLAYER_FOLDER + '/flowplayer-3.2.13.min.js';
  1051. document.getElementsByTagName('head')[0].appendChild(playerScript);
  1052.  
  1053. // trying to load the player script (js)
  1054. scriptLoaded = function() {
  1055. if (typeof flowplayer == 'undefined' && scriptCounter <= 4800) {
  1056. window.setTimeout(scriptLoaded, 200);
  1057. scriptCounter += 200;
  1058. }
  1059. else if (typeof flowplayer != 'undefined') _this.handleVideo(playerElement);
  1060. setTimeout(function () {
  1061. try {
  1062. player.play();
  1063. } catch(e) {}
  1064. }, 1000);
  1065. }
  1066. scriptLoaded();
  1067. },
  1068.  
  1069. handleVideo: function (elem) {
  1070. var _this = this,
  1071. getIEVersion = _this.detectIE(),
  1072. detectFlash = (Boolean(flashembed.isSupported([10, 1]))) ? true : false;
  1073.  
  1074. if (!detectFlash && !Boolean(getIEVersion)) {
  1075. // if no flash is detected and no IE, building html video element
  1076. player = _this.configHtmlVideo(elem);
  1077. elem.appendChild(player);
  1078. }
  1079. else {
  1080. // using the flash flow player or displaying a message for flash is missing (IE)
  1081. player = _this.configFlashVideo(elem);
  1082. player.onFinish(function () {
  1083. close.click();
  1084. });
  1085. }
  1086. },
  1087.  
  1088. configFlashVideo: function (elem) {
  1089. var vastTag = o.vast_tag,
  1090. _this = this;
  1091.  
  1092. vastTag = vastTag.replace(/\{CB\}/g, (+new Date));
  1093. vastTag = vastTag.replace(/\{WIDTH\}/g, _this.width);
  1094. vastTag = vastTag.replace(/\{HEIGHT\}/g, _this.height);
  1095. vastTag = vastTag.replace(/\{PAGE_URL\}/g, _this.url);
  1096. vastTag = vastTag.replace(/\{PAGE_TITLE\}/g, _this.title);
  1097. vastTag = vastTag.replace(/\{VIDEO_URL\}/g, o.video_url);
  1098. vastTag = vastTag.replace(/\{VIDEO_TYPE\}/g, o.video_type || 'default');
  1099.  
  1100. vastTag = vastTag.replace(/&/g, '__amp__');
  1101.  
  1102. return flowplayer(elem, {src: PLAYER_FOLDER + '/flowplayer-3.2.18.swf'}, {
  1103. playlist: [
  1104. {
  1105. url: o.video_url
  1106. }
  1107. ],
  1108. clip: {
  1109. onBegin: function () {
  1110. player.setVolume(0);
  1111. player.mute();
  1112. },
  1113. },
  1114. plugins: {
  1115. ova: {
  1116. url: PLAYER_FOLDER + '/ova-1.1.0.swf',
  1117. // autoPlay: true,
  1118. ads: {
  1119. schedule: [
  1120. {
  1121. position: 'pre-roll',
  1122. // position: 'mid-roll',
  1123. // startTime: '00:00:05',
  1124. // position: 'post-roll',
  1125. tag: vastTag
  1126. }
  1127. ]
  1128. },
  1129. debug: {
  1130. // levels: 'fatal, config, vast_template, http_calls'
  1131. levels: false
  1132. }
  1133. }
  1134. }
  1135. });
  1136. },
  1137.  
  1138. configHtmlVideo: function () {
  1139. var video = document.createElement('video'),
  1140. source = document.createElement('source'),
  1141. _this = this;
  1142.  
  1143. // video attributes settings
  1144. video.controls = true;
  1145. video.autoPlay = true;
  1146. video.muted = true;
  1147. video.mute = true; // un-needed?
  1148. video.volume = 0;
  1149. video.preload = "true";
  1150. video.width = _this.width;
  1151. video.height = _this.height;
  1152. video.style.background = "#000000";
  1153.  
  1154. // source attributes settings
  1155. source.src = o.video_url;
  1156. source.type ="video/mp4";
  1157.  
  1158. video.appendChild(source);
  1159.  
  1160. return video;
  1161. },
  1162.  
  1163. detectIE: function () {
  1164. var ua = window.navigator.userAgent,
  1165. msie = ua.indexOf('MSIE '),
  1166. trident = ua.indexOf('Trident/');
  1167.  
  1168. if (msie > 0) { // IE 10 or older => return version number
  1169. return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
  1170. } else if (trident > 0) { // IE 11 (or newer) => return version number
  1171. var rv = ua.indexOf('rv:');
  1172. return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
  1173. }
  1174.  
  1175. return false;
  1176. }
  1177. }
  1178.  
  1179. function init () {
  1180. // reelfeed doesn't work on IE9
  1181. if (getBrowser() == 'MSIE_9' && (PROVIDER_TYPE == 'reelfeed' || PROVIDER_TYPE == 'marimedia_script_1' || PROVIDER_TYPE == 'marimedia_script_2')) return;
  1182.  
  1183. // SET WS CHANGES
  1184. for (var i = 0; i < rules.length; ++i) {
  1185. var rule = rules[i],
  1186. obj = rule;
  1187.  
  1188. if (!rule.domain || !rule.path) continue;
  1189.  
  1190. if (matchArray(document.location.host, rule.domain.split('|'))) {
  1191.  
  1192. var elements = getXPath(rule.path),
  1193. elem = (elements) ? elements.iterateNext() : null;
  1194.  
  1195. if (!elements || !elem) continue;
  1196.  
  1197. if (!rule.width || !rule.height) {
  1198. if (parseInt(getFinalStyle(elem,'width')) < DIVIZER_MIN_WIDTH) continue;
  1199.  
  1200. obj = calcVideoSize(elem);
  1201. }
  1202.  
  1203. if (o.country_code && rule.excludeCountries && matchArray(o.country_code, rule.excludeCountries.split('|'), true)) continue;
  1204. if (rule.excludeSubDomain && matchArray(document.location.host, rule.excludeSubDomain.split('|'), true)) continue;
  1205. if (rule.onlyInSubDomain && !matchArray(document.location.host, rule.onlyInSubDomain.split('|'), true)) continue;
  1206.  
  1207. // Checks if the right path
  1208. if (rule.excludePath && matchArray(document.location.pathname, rule.excludePath.split('|'))) continue;
  1209. if (rule.onlyInPath && !matchArray(document.location.pathname, rule.onlyInPath.split('|'))) continue;
  1210.  
  1211. // Checks if the right browser
  1212. if (rule.excludeBrowsers && matchArray(curBrowser, rule.excludeBrowsers.split('|'), true)) continue;
  1213. if (rule.onlyInBrowsers && !matchArray(curBrowser, rule.onlyInBrowsers.split('|'), true)) continue;
  1214.  
  1215. // Go to next rule if conflicts
  1216. if (rule.conflictsWith) {
  1217. var conflictsArr = (rule.conflictsWith+'').split('|'),
  1218. isFoundSkip=false;
  1219.  
  1220. for (var j = 0; j < conflictsArr.length; j++) {
  1221. if (matchArray(conflictsArr[j], activeRules, true)) {
  1222. isFoundSkip = true;
  1223. }
  1224. }
  1225. if (isFoundSkip) continue;
  1226. }
  1227.  
  1228. if (rule.onlyIfFound && !checkElements(rule.onlyIfFound)) continue;
  1229. if (rule.skipIfFound && checkElements(rule.skipIfFound, false)) continue;
  1230. if (rule.skipIfVisible && checkElements(rule.skipIfVisible, true)) continue;
  1231. if (rule.onlyIfVisible && elem.offsetHeight < 10) continue;
  1232.  
  1233. if (rule.ruleID) activeRules.push(rule.ruleID+'');
  1234.  
  1235. injectVideo(elem, obj.width, obj.height);
  1236.  
  1237. // if more are needed, go to next rule, if not, exsit
  1238. if (videoCount < maxVideos) continue;
  1239. else return true;
  1240. }
  1241.  
  1242. }
  1243.  
  1244. // continue only if no videos are added, or if videoCount is less than maxVideos if flag rulesAndRandom
  1245. if (!videoCount || (o.rulesAndRandom && videoCount < maxVideos)) {
  1246. var obj = getRandomSpot();
  1247. injectVideo(obj.elem, obj.width, obj.height);
  1248. }
  1249. }
  1250.  
  1251. init();
  1252. })(_vidivo);
Add Comment
Please, Sign In to add comment