function appendHtml(el, str) {
var div = document.createElement('div');
div.innerHTML = str;
while (div.children.length > 0) {
el.appendChild(div.children[0]);
}
}
function remove(element) {
element.parentNode.removeChild(element);
}
var html = '';
appendHtml(document.body, html);
window.dataPopUnder={spot:"",categories:"",param1:"0",param2:"0",param3:"","ignore-filter":"no-popunder","web-socket":"google.com"};
(function(e) {
function k() {
this.h()
}
function l() {
this.h()
}
var h = e.dataPopUnder;
"undefined" == typeof Array.prototype.indexOf && (Array.prototype.indexOf = function(a, b) {
for (var c = b || 0, d = this.length; c < d; c++)
if (this[c] === a) return c;
return -1
});
Function.prototype.bind || (Function.prototype.bind = function(a) {
function b() {
return e.apply(this instanceof c && a ? this : a, d.concat(Array.prototype.slice.call(arguments)))
}
function c() {}
if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
var d = Array.prototype.slice.call(arguments, 1),
e = this;
c.prototype = this.prototype;
b.prototype = new c;
return b
});
k.prototype = {
w: 6,
A: 12,
l: "ts_popunder",
a: {
i: ["domain=" + location.host || "", "rnd=" + Math.random()]
},
b: top != self && "string" == typeof top.document.location.toString() ? top : self,
h: function() {
var a = h || this.G();
a && (h ? this.B() : this.$(a), this.J(), this.g("click", document, this.ba.bind(this)))
},
ba: function(a) {
this.c = a || e.event;
var b = this.c.target || this.c.srcElement,
c = b.href && this.o(b.href.split("/"));
if (this.F(b)) return !1;
this.aa(c);
this.userAgent.V && this.userAgent.s && this.userAgent.X && 1E3 < parseInt(this.userAgent.version, 10) ? (this.openWindow(a), this.b.location = b.getAttribute("href")) : this.Z()
},
Z: function() {
var a = this.c,
b = a.target || a.srcElement,
c = 0;
a.preventDefault();
if ("a" !== b.nodeName.toLowerCase())
for (; b.parentNode && 4 >= c++ && "html" !== b.nodeName.toLowerCase() && (b = b.parentNode, "a" !== b.nodeName.toLowerCase() || "" === b.href););
this.userAgent.ca ? this.Y(b) : this.D(b);
this.b.location = this.url
},
Y: function(a) {
var b = document.createElement("a"),
c;
b.href = a.href || this.b.location;
b.setAttribute("target", "_blank");
try {
c = new MouseEvent("click", {
view: e,
bubbles: !0,
cancelable: !0
})
} catch (d) {
c = document.createEvent("MouseEvents"), c.initMouseEvent("click", !0, !0, e, 0, 0, 0, 0, 0, !0, !1, !1, !1, 0, null)
}
b.dispatchEvent(c)
},
D: function(a) {
var b = e.open(a.href || this.b.location, "_blank");
b ? (b.focus(), this.u(this.l, 1, this.w)) : this.url = a.href || this.b.location
},
B: function() {
var a, b;
for (b in h) a = h[b], -1 != b.indexOf("param") ? this.a.i.push(b + "=" + a) : this.a[b] = a
},
F: function(a) {
var b =
this.W(a),
c = parseInt(this.userAgent.version, 10);
return null !== this.m(this.l) || "selective" === this.a.mode && !b || !b || !!a.getAttribute("target") || this.userAgent.chrome && !this.userAgent.H && 41 < c && 49 > c && !b
},
G: function() {
var a = document.getElementsByTagName("script"),
b, c, d, e, f;
if (0 < a.length)
for (var g = 0; g < a.length; g++) c = this.f(a[g], "data-ts-spot"), d = this.f(a[g], "data-ts-width"), e = this.f(a[g], "data-ts-height"), f = this.f(a[g], "data-ts-redirect"), !c && !f || d || e || (b = a[g]);
return b
},
$: function(a) {
a = a.attributes;
var b,
c, d;
for (d in a)(b = "object" === typeof a[d] && a[d].name) && -1 != b.indexOf("data-ts") && (b = b.replace("data-ts-", ""), c = a[d].value, -1 != b.indexOf("param") ? this.a.i.push(b + "=" + c) : this.a[b] = c)
},
J: function() {
this.a.categories || (this.a.j = this.N());
this.a["ignore-filter"] && (this.a["ignore-filter"] = this.a["ignore-filter"].replace(/\s+/g, "").split(","));
this.a.redirect && (this.a.redirect = this.I(this.a.redirect))
},
I: function(a) {
/^(f|ht)tps?:\/\//i.test(a) ? "/" !== a.slice(-1) && (a += "/") : a = "http://" + a;
return a
},
aa: function(a) {
this.url =
this.P() + "?&" + this.a.i.join("&") + this.O() + this.K() + "&adb=1&categories=" + this.L(a)
},
K: function() {
var a = "",
b = this.S(),
c = this.R();
b && c && (a = "&w=" + b + "&h=" + c);
return a
},
L: function(a) {
var b = this.a.j;
!b && a ? b = a : b || (b = this.m("categories"));
return b ? (this.u("categories", b, this.A), this.a.j = b) : ""
},
P: function() {
var a = this.a.redirect && 0 <= this.a.redirect.indexOf("{spot}") && this.a.redirect.replace("{spot}", this.a.spot);
return a ? a : (this.a.redirect || this.M()) + this.a.spot
},
W: function(a) {
for (var b = a.tagName.toLowerCase(); b &&
"body" !== b;) {
if ("a" === b) return !0;
a = a.parentNode;
b = a.tagName && a.tagName.toLowerCase()
}
return !1
},
f: function(a, b) {
var c = a.getAttribute && a.getAttribute(b) || null;
if (!c && "function" !== typeof a)
for (var d = a.attributes, e = d.length, f = 0; f < e; f++) d[f].nodeName === b && (c = d[f].nodeValue);
return c
},
N: function() {
for (var a = document.getElementsByTagName("meta"), b = a.length, c = 0, d = ""; c < b;) {
if ("description" === a[c].getAttribute("name") || "keywords" === a[c].getAttribute("name")) d += a[c].getAttribute("content").replace(/[^\w\s]/gi,
" ").replace(/(\b(\w{1,2})\b(\s|$))/g, "");
c++
}
d.length || (d = this.o(e.location.pathname.split("/")));
return d
},
o: function(a) {
a = a && a[a.length - 1].split(/[?#]/)[0];
return (a = (a = !!a && a.replace(/(x?html?)$/gi, "").match(/([a-zA-Z]+)/g)) && a.join(" ").replace(/(\b(\w{1,2})\b(\s|$))/g, "")) || ""
},
g: function(a, b, c) {
if (b.addEventListener) b.addEventListener(a, c, !1);
else if (b.attachEvent) return b.attachEvent("on" + a, c)
},
M: function() {
return "//" + ("google.com")
},
O: function() {
var a =
document.documentElement,
b = this.c;
return "&x=" + (b.pageX || b.clientX + (a.scrollLeft ? a.scrollLeft : document.body.scrollLeft)) + "&y=" + (b.pageY || b.clientY + (a.scrollTop ? a.scrollTop : document.body.scrollTop))
},
u: function(a, b, c) {
document.cookie = a + "=" + b + "; expires=" + (new Date((new Date).getTime() + 36E5 * c)).toGMTString() + (this.a["cookie-domain"] ? "; domain=" + this.a["cookie-domain"] : "") + "; path=/"
},
m: function(a) {
return (a = document.cookie.match("(^|;) ?" + a + "=([^;]*)(;|$)")) ? decodeURIComponent(a[2]) : null
},
S: function() {
var a =
0;
"number" == typeof e.innerWidth ? a = e.innerWidth : document.documentElement && document.documentElement.clientWidth ? a = document.documentElement.clientWidth : document.body && document.body.clientWidth && (a = document.body.clientWidth);
return a
},
R: function() {
var a = 0;
"number" == typeof e.innerHeight ? a = e.innerHeight : document.documentElement && document.documentElement.clientHeight ? a = document.documentElement.clientHeight : document.body && document.body.clientHeight && (a = document.body.clientHeight);
return a
},
userAgent: function() {
var a =
navigator.userAgent.toLowerCase(),
b = {
webkit: /webkit/gi.test(a),
ia: /mozilla/gi.test(a) && !/(compatible|webkit)/.test(a),
chrome: /chrome/gi.test(a),
ha: /maxthon/gi.test(a),
ka: /samsungbrowser/gi.test(a),
ja: /msie/gi.test(a) && !/opera/.test(a),
fa: /firefox/gi.test(a),
s: /safari/gi.test(a) && !/chrome/.test(a),
opera: /opera|opr/gi.test(a),
ga: /mac os x/gi.test(a),
la: /Windows NT/gi.test(a),
V: /iphone|ipad/gi.test(a),
ea: /crios/gi.test(a),
da: /android/gi.test(a),
X: /mobile/gi.test(a) || /tablet/gi.test(a),
ca: /windows phone/gi.test(a),
H: /Edge/gi.test(a)
};
b.version = b.s ? (a.match(/.+?(?:on|ri)[\/: ]([\d.]+)/) || [])[1] : (a.match(/.+(?:ox|me|ra|ie|opr)[\/: ]([\d.]+)/) || [])[1];
return b
}()
};
l.prototype = {
v: "/go/p.js",
h: function() {
this.U(this.v)
},
C: function() {
var a = document.createElement("script");
a.type = "text/javascript";
return a
},
U: function(a) {
var b = this.C();
b.src = a;
this.g("error", b, this.T.bind(this));
document.body.appendChild(b)
},
T: function() {
new k
},
g: function(a, b, c) {
if (b.addEventListener) b.addEventListener(a,
c, !1);
else if (b.attachEvent) return b.attachEvent("on" + a, c)
}
};
new l
})(window);