Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* statvoo.com - v1.7.0 */ ! function(t) {
- function e(t, e) {
- this.scriptObj = !1, this.src = t, this.async = e, this.hook = !1
- }
- function o() {
- this.start_time = new Date, this.last_activity = new Date, this.ltid = 0, this.sid = 0, this.record = new Array, this.cursorX = 0, this.cursorY = 0, this.scrollX = 0, this.scrollY = 0, this.hasTyped = !1, this.hasClicked = !1
- }
- function a() {}
- function i() {}
- function n() {}
- function s() {}
- e.prototype.clear = function() {
- this.scriptObj.parentNode.removeChild(this.scriptObj)
- }, e.prototype.load = function(t) {
- this.scriptObj = document.createElement("script"), this.scriptObj.src = this.src, this.scriptObj.async = this.async, this.hook = document.getElementsByTagName("script")[0], this.hook.parentNode.insertBefore(this.scriptObj, this.hook);
- var e = this;
- this.hook && ("undefined" != typeof this.scriptObj.onreadystatechange ? this.scriptObj.onreadystatechange = function() {
- ("complete" == this.readyState || "loaded" == this.readyState) && (void 0 != t && t(), e.clear())
- } : this.scriptObj.onload = function() {
- setTimeout(function() {}, 400), void 0 != t && t(), e.clear()
- })
- }, o.prototype.checkCursor = function() {
- var e = t.statvoo.tracker,
- o = document.documentElement,
- a = document.body;
- e.scrollX = o && o.scrollLeft || a && a.scrollLeft || 0, e.scrollY = o && o.scrollTop || a && a.scrollTop || 0;
- var i = e.hasTyped ? 1 : 0,
- n = e.hasClicked ? 1 : 0;
- e.hasTyped = !1, e.hasClicked = !1, e.record.push(e.cursorX + "|" + e.cursorY + "|" + e.scrollX + "|" + e.scrollY + "|" + i + "|" + n + "|" + screen.width)
- }, o.prototype.randomstring = function() {
- for (var t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", e = "", o = 0; 12 > o; o++) {
- var a = Math.floor(Math.random() * t.length);
- e += t.substring(a, a + 1)
- }
- return e
- }, o.prototype.trackPath = function(e, o) {
- t.statvoo.helper;
- return "https://analytics-api.statvoo.com/v3/wst/" + e + "/" + o
- }, o.prototype.pinger = function() {
- var o = t.statvoo.tracker;
- t.statvoo.debug && console.log("ping:" + o.ltid);
- var a = new Date,
- i = a.getTime(),
- n = o.last_activity.getTime(),
- s = new Date,
- r = s - o.start_time;
- o.start_time = new Date;
- var c = o.record,
- d = "?_=" + this.randomstring() + "&s=" + this.site + "<id=" + o.ltid + "&g=" + this.guid + "&t=" + this.title + "&ts=" + encodeURIComponent(r) + "&record=" + encodeURIComponent(c);
- o.record = new Array, 3e5 > i - n ? o.source = o.trackPath("ping", d) : this.source = o.trackPath("ping", d + "&idle=1"), t.statvoo.script = new e(this.source, "async"), t.statvoo.script.load()
- }, o.prototype.postHTML = function() {
- if (document.getElementsByTagName("html").length) {
- var t = document.createElement("iframe"),
- e = (0 | 9e6 * Math.random()).toString(36);
- document.body.appendChild(t), t.style.display = "none", t.contentWindow.name = e;
- var o = document.createElement("form");
- o.target = e, o.action = "https://analytics-api.statvoo.com/v3/wst/html/", o.method = "POST";
- var a = document.createElement("input");
- a.type = "hidden", a.name = "s", a.value = this.site, o.appendChild(a);
- var a = document.createElement("input");
- a.type = "hidden", a.name = "ltid", a.value = this.ltid, o.appendChild(a);
- var a = document.createElement("input");
- a.type = "hidden", a.name = "g", a.value = this.guid, o.appendChild(a);
- var a = document.createElement("input");
- a.type = "hidden", a.name = "html", a.value = document.getElementsByTagName("html")[0].innerHTML, o.appendChild(a), document.body.appendChild(o), o.submit(), t.onload = function() {
- t.parentNode.removeChild(t)
- }
- }
- }, o.prototype.moved = function(e) {
- var o = t.statvoo.tracker;
- o.last_activity = new Date, e = e || window.event, o.cursorX = e.pageX || e.clientX, o.cursorY = e.pageY || e.clientY
- }, o.prototype.typed = function(t) {
- var e = v.tracker;
- e.moved(t), e.hasTyped = !0
- }, o.prototype.clicked = function(o) {
- t.statvoo.debug && console.log("clicked");
- var a = t.statvoo.tracker;
- a.moved(o), a.hasClicked = !0, o = o || window.event;
- var i = o.target || o.srcElement,
- n = i.href;
- return void 0 == n || n.startsWith("javascript") ? !0 : n.startsWith(location.protocol + "//" + location.hostname) ? void 0 : (a.source = a.trackPath("click", "?_=" + a.randomstring() + "&s=" + a.site + "&r=" + a.referrer + "&l=" + a.language + "&p=" + a.platform + "&d=" + a.screenres + "&g=" + a.guid + "&t=" + a.title + "&lk=" + encodeURIComponent(n)), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load(), a.sleep(400), !0)
- }, o.prototype.sleep = function(t) {
- for (t += (new Date).getTime(); new Date < t;);
- }, o.prototype.kill = function() {
- var e = t.statvoo.tracker;
- clearInterval(e.intPing), clearInterval(e.intCursor), clearInterval(e.intHref)
- }, o.prototype.initialize = function() {
- t.statvoo.debug && console.log("initialized");
- var o = t.statvoo.tracker;
- clearInterval(o.intPing), o.intPing = 0, clearInterval(o.intCursor), o.intCursor = 0, clearInterval(o.intHref), o.intHref = 0, o.location = location.href, o.site = encodeURIComponent(location.hostname), o.referrer = encodeURIComponent(document.referrer), o.language = encodeURIComponent(navigator.browserLanguage || navigator.language || ""), o.platform = encodeURIComponent(navigator.platform), o.screenres = encodeURIComponent(screen.width + "x" + screen.height), o.title = encodeURIComponent(document.title), document.cookie.indexOf("statvoo_tracker") >= 0 ? o.guid = t.statvoo.cookie.view() : (o.today = new Date, o.expire = new Date, o.nDays = 5e4, o.expire.setTime(o.today.getTime() + 864e5 * o.nDays), o.guid = t.statvoo.cookie.save(), document.cookie = "statvoo_tracker=" + escape(o.guid) + ";path=/;domain=" + location.hostname + ";expires=" + o.expire.toGMTString()), o.source = o.trackPath("track", "?_=" + o.randomstring() + "&s=" + o.site + "&r=" + o.referrer + "&l=" + o.language + "&p=" + o.platform + "&d=" + o.screenres + "&g=" + o.guid + "&t=" + o.title), t.statvoo.script = new e(o.source, "async"), t.statvoo.script.load(), o.intPing = setInterval(function() {
- o.pinger()
- }, 15e3), "undefined" != typeof document.attachEvent ? (document.attachEvent("onmousedown", o.clicked), document.attachEvent("onmousemove", o.moved), document.attachEvent("onkeydown", o.typed)) : (document.addEventListener("mousedown", o.clicked, !1), document.addEventListener("mousemove", o.moved, !1), document.addEventListener("keydown", o.typed, !1)), o.intCursor = setInterval(function() {
- o.checkCursor()
- }, 1e3), o.intHref = setInterval(function() {
- o.location != location.href && o.initialize()
- }, 100)
- }, o.prototype.monitorXHR = function() {
- ! function() {
- var t = window.XMLHttpRequest.prototype.send;
- window.XMLHttpRequest.prototype.send = function() {
- var e = {};
- e.arguments = arguments, e.ms = 0;
- var o = this,
- a = window.setInterval(function() {
- return 4 != o.readyState ? void e.ms++ : (e.responseText = o.responseText, e.responseURL = o.responseURL, e.status = o.status, e.pointer = o, clearInterval(a), void console.log(e))
- }, 1);
- return t.apply(this, [].slice.call(arguments))
- }
- }()
- };
- var r = function(o, a) {
- var i = t.statvoo.tracker;
- i.source = i.trackPath("event", "?_=" + i.randomstring() + "&s=" + i.site + "<id=" + i.ltid + "&g=" + i.guid + "&v_key=" + encodeURIComponent(o) + "&v_value=" + encodeURIComponent(a) + "&r=" + i.referrer + "&l=" + i.language + "&p=" + i.platform + "&d=" + i.screenres + "&t=" + i.title), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load()
- },
- c = function(o, a) {
- var i = t.statvoo.tracker;
- void 0 == o && (o = ""), void 0 == a && (a = ""), i.source = i.trackPath("tag", "?_=" + i.randomstring() + "&s=" + i.site + "<id=" + i.ltid + "&g=" + i.guid + "&t_key=" + encodeURIComponent(o) + "&t_value=" + encodeURIComponent(a) + "&r=" + i.referrer + "&l=" + i.language + "&p=" + i.platform + "&d=" + i.screenres + "&t=" + i.title), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load()
- },
- d = function(o, a) {
- var i = t.statvoo.tracker;
- void 0 == o && (o = ""), void 0 == a && (a = ""), i.source = i.trackPath("goal", "?_=" + i.randomstring() + "&s=" + i.site + "<id=" + i.ltid + "&g=" + i.guid + "&g_key=" + encodeURIComponent(o) + "&g_value=" + encodeURIComponent(a) + "&r=" + i.referrer + "&l=" + i.language + "&p=" + i.platform + "&d=" + i.screenres + "&t=" + i.title), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load()
- },
- l = function(o, a) {
- var i = t.statvoo.tracker,
- n = t.statvoo.helper;
- i.source = i.trackPath("identify", "?_=" + i.randomstring() + "&s=" + i.site + "&g=" + i.guid + "&i_obj=" + encodeURIComponent(n.serialize(o))), t.statvoo.script = new e(i.source, "async"), t.statvoo.script.load(a)
- },
- m = function(o) {
- var a = t.statvoo.tracker,
- i = t.statvoo.helper;
- a.source = a.trackPath("error", "?_=" + a.randomstring() + "&s=" + a.site + "<id=" + a.ltid + "&g=" + a.guid + "&e_obj=" + encodeURIComponent(i.serialize(o))), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load()
- };
- a.prototype.view = function() {
- var t = new RegExp("statvoo_tracker=([^;]+)"),
- e = t.exec(document.cookie);
- return null != e ? unescape(e[1]) : null
- }, a.prototype.save = function() {
- var t = function() {
- return Math.floor(65536 * Math.random()).toString(16)
- };
- return t() + t() + "-" + t() + "-" + t() + "-" + t() + "-" + t() + t() + t()
- }, i.prototype.acline = function(o, a, i, n) {
- var s = t.statvoo.tracker;
- if (1 == a) {
- if (s.source = s.trackPath("chat", "?_=" + s.randomstring() + "&s=" + s.site + "&r=" + s.referrer + "&l=" + s.language + "&p=" + s.platform + "&d=" + s.screenres + "&g=" + s.guid + "&t=" + s.title + "&cad=" + a + "&ses=" + o), t.statvoo.script = new e(s.source, "async"), t.statvoo.script.load(), document.getElementById("statvoo_tracker_diag_chat_wnd").parentNode.removeChild(document.getElementById("statvoo_tracker_diag_chat_wnd")), document.getElementById("statvoo_chat_widget")) {
- var r = document.getElementById("statvoo_chat_widget");
- r.parentElement.removeChild(r)
- }
- var c = document.getElementsByName("statvoo_styles")[0];
- "undefined" != typeof c && null != c || (c = document.createElement("link"), c.setAttribute("rel", "stylesheet"), c.setAttribute("type", "text/css"), c.setAttribute("id", "statvoo_styles"), c.setAttribute("name", "statvoo_styles"), c.setAttribute("href", "https://static.statvoo.com/css/chat.css"), document.head.appendChild(c)), t.statvoo.chatWidget.initialiseWidgetExistingSession(o, i, n)
- } else s.source = s.trackPath("chat", "?_=" + s.randomstring() + "&s=" + s.site + "&r=" + s.referrer + "&l=" + s.language + "&p=" + s.platform + "&d=" + s.screenres + "&g=" + s.guid + "&t=" + s.title + "&cad=" + a + "&ses=" + o), t.statvoo.script = new e(s.source, "async"), t.statvoo.script.load(), document.getElementById("statvoo_tracker_diag_chat_wnd").parentNode.removeChild(document.getElementById("statvoo_tracker_diag_chat_wnd"))
- }, n.prototype.closeChat = function() {
- document.getElementById("statvoo_chat_widget") && document.getElementById("statvoo_chat_widget").parentNode.removeChild("statvoo_chat_widget")
- }, n.prototype.initialiseWidget = function() {
- var t = this,
- e = document.getElementsByName("statvoo_chat_widget")[0];
- "undefined" != typeof element && null != e || (1 == t.adminOnline ? (e = document.createElement("div"), e.setAttribute("id", "statvoo_chat_widget"), e.setAttribute("name", "statvoo_chat_widget"), e.innerHTML = "<div id='statvoo_chat_widget_header' name='statvoo_chat_widget_header' onclick='window.statvoo.chatWidget.minmax()'><span id='statvoo_chat_widget_titletext'>We're online, let's chat</span><span id='statvoo_chat_widget_minmax' name='statvoo_chat_widget_minmax'></span></div>", e.innerHTML += "<div id='statvoo_chat_widget_inner' name='statvoo_chat_widget_inner'><div style='margin-bottom:5px'><label for='statvoo_chatwidget__yourname' style='display:block'>Your name:</label><input id='statvoo_chatwidget__yourname' name='statvoo_chatwidget__yourname' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__youremail' style='display:block'>Your email:</label><input id='statvoo_chatwidget__youremail' name='statvoo_chatwidget__youremail' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__subject' title='Required' style='display:block'>Subject: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__subject' name='statvoo_chatwidget__subject' type='text' style='width:275px' /></div><div><input type='submit' value='Start Chat!' onclick='window.statvoo.chatWidget.startChat();' /></div><div style='position:absolute;bottom:5px;right:5px;'><a style='color:#017c34' href='https://statvoo.com' target='_blank'>statvoo.com</a></div></div>", document.body.appendChild(e), this.iHeight = document.getElementById("statvoo_chat_widget").clientHeight + 75, this.widgetEl = document.getElementsByName("statvoo_chat_widget")[0], this.widgetEl.style.height = this.iHeight + "px", this.minimise()) : (e = document.createElement("div"), e.setAttribute("id", "statvoo_chat_widget"), e.setAttribute("name", "statvoo_chat_widget"), e.innerHTML = "<div id='statvoo_chat_widget_header' name='statvoo_chat_widget_header' onclick='window.statvoo.chatWidget.minmax()'><span id='statvoo_chat_widget_titletext'>Leave a message..</span><span id='statvoo_chat_widget_minmax' name='statvoo_chat_widget_minmax'></span></div>", e.innerHTML += "<div id='statvoo_chat_widget_inner' name='statvoo_chat_widget_inner'><div style='margin-bottom:5px'><label for='statvoo_chatwidget__yourname' title='Required' style='display:block'>Your name: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__yourname' name='statvoo_chatwidget__yourname' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__youremail' title='Required' style='display:block'>Your email: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__youremail' name='statvoo_chatwidget__youremail' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__subject' title='Required' style='display:block'>Subject: <span style='color:red'>*</span></label><input id='statvoo_chatwidget__subject' name='statvoo_chatwidget__subject' type='text' style='width:275px' /></div><div style='margin-bottom:5px'><label for='statvoo_chatwidget__message' title='Required' style='display:block'>Message: <span style='color:red'>*</span></label><textarea id='statvoo_chatwidget__message' name='statvoo_chatwidget__message' style='width:275px;min-height:50px;'></textarea></div><div><input type='submit' value='Send Message!' onclick='window.statvoo.chatWidget.startChat();' /></div><div style='position:absolute;bottom:5px;right:5px;'><a style='color:#017c34' href='https://statvoo.com' target='_blank'>statvoo.com</a></div></div>", document.body.appendChild(e), this.iHeight = document.getElementById("statvoo_chat_widget").clientHeight + 50, this.widgetEl = document.getElementsByName("statvoo_chat_widget")[0], this.widgetEl.style.height = this.iHeight + "px", this.minimise()))
- }, n.prototype.initialiseWidgetExistingSession = function(t, e, o) {
- var a = document.getElementsByName("statvoo_chat_widget")[0];
- a = document.createElement("div"), a.setAttribute("id", "statvoo_chat_widget"), a.setAttribute("name", "statvoo_chat_widget"), a.innerHTML = "<div id='statvoo_chat_widget_header' name='statvoo_chat_widget_header' onclick='window.statvoo.chatWidget.minmax()'><span id='statvoo_chat_widget_titletext'>Connected to Live chat..</span><span id='statvoo_chat_widget_minmax' name='statvoo_chat_widget_minmax'></span></div>", a.innerHTML += "<div id='statvoo_chat_widget_inner' name='statvoo_chat_widget_inner'><div id='statvoo_chatwidget__actions'><a href='javascript:;' onclick='window.statvoo.chatWidget.terminate(" + t + ", " + e + ", " + o + ")'>End chat</a></div><div id='statvoo_chatwidget__message'></div><div><input placeholder='Type message here..' type='text' value='' id='txtStatvooLiveChatNewMessage' onkeyup='window.statvoo.chatWidget.sendChatMessage(event, " + t + ", " + e + ", " + o + ");' /></div><div style='position:absolute;bottom:5px;right:5px;'><a style='color:#017c34' href='https://statvoo.com' target='_blank'>statvoo.com</a></div></div>", document.body.appendChild(a), this.iHeight = document.getElementById("statvoo_chat_widget").clientHeight + 75, this.widgetEl = document.getElementsByName("statvoo_chat_widget")[0], this.widgetEl.style.height = this.iHeight + "px", this.maximise(), window.statvoo.chatWidget.getAllChats(t, e, o), window.statvoo.chatWidget.refresher = setInterval(function() {
- window.statvoo.chatWidget.getAllChats(t, e, o)
- }, 5e3)
- }, n.prototype.terminate = function(o, a, i) {
- if (confirm("Are you sure?")) {
- var n = t.statvoo.tracker,
- s = t.statvoo.helper,
- r = {
- session_id: o,
- userid: a,
- siteid: i
- };
- n.source = n.trackPath("chat", "?_=" + n.randomstring() + "&s=" + n.site + "<id=" + n.ltid + "&g=" + n.guid + "&lc=end&_obj=" + encodeURIComponent(s.serialize(r))), t.statvoo.script = new e(n.source, "async"), t.statvoo.script.load(), clearInterval(window.statvoo.chatWidget.refresher), window.statvoo.chatWidget.refresher = 0, document.getElementById("statvoo_chat_widget").parentNode.removeChild(document.getElementById("statvoo_chat_widget"))
- }
- }, n.prototype.sendChatMessage = function(o, a, i, n) {
- var s = t.statvoo.tracker,
- r = t.statvoo.helper;
- if (o = o || window.event, 13 == o.keyCode) {
- var c = document.getElementById("txtStatvooLiveChatNewMessage").value,
- d = encodeURIComponent(c),
- l = {
- session_id: a,
- userid: i,
- siteid: n,
- message: d
- };
- s.source = s.trackPath("chat", "?_=" + s.randomstring() + "&s=" + s.site + "<id=" + s.ltid + "&g=" + s.guid + "&lc=send&_obj=" + encodeURIComponent(r.serialize(l))), t.statvoo.script = new e(s.source, "async"), t.statvoo.script.load(), document.getElementById("txtStatvooLiveChatNewMessage").value = "";
- var m = document.getElementById("statvoo_chatwidget__message");
- m.innerHTML += "<div class='_statvoo-lc-messageItem'><div><span class='_statvoo-lc-messageItemWHO'>user</span><span class='_statvoo-lc-messageItemTIMESTAMP'>now</span></div><span class='_statvoo-lc-messageItemMESSAGE'>" + c + "</span></div>"
- }
- }, n.prototype.loadGetAllChats = function(t) {
- for (var e = document.getElementById("statvoo_chatwidget__message"), o = "", a = 0; a < t.length; a++) o += "<div class='_statvoo-lc-messageItem'><div><span class='_statvoo-lc-messageItemWHO'>" + t[a].who + "</span><span class='_statvoo-lc-messageItemTIMESTAMP'>" + t[a].timestamp + "</span></div><span class='_statvoo-lc-messageItemMESSAGE'>" + t[a].message + "</span></div>";
- e.innerHTML = o
- }, n.prototype.getAllChats = function(o, a, i) {
- var n = t.statvoo.tracker,
- s = t.statvoo.helper,
- r = {
- session_id: o,
- userid: a,
- siteid: i
- };
- n.source = n.trackPath("chat", "?_=" + n.randomstring() + "&s=" + n.site + "<id=" + n.ltid + "&g=" + n.guid + "&lc=get&_obj=" + encodeURIComponent(s.serialize(r))), t.statvoo.script = new e(n.source, "async"), t.statvoo.script.load()
- }, n.prototype.minmax = function() {
- "0px" == this.widgetEl.style.bottom ? this.minimise() : this.maximise()
- }, n.prototype.minimise = function() {
- this.widgetEl.style.bottom = "-" + (this.iHeight - 32) + "px", this.widgetEl.style.height = "" + this.iHeight + "px", document.getElementsByName("statvoo_chat_widget_minmax")[0].innerHTML = "^"
- }, n.prototype.maximise = function() {
- this.widgetEl.style.bottom = "0px", this.widgetEl.style.height = "auto", document.getElementsByName("statvoo_chat_widget_minmax")[0].innerHTML = "-"
- }, n.prototype.startChat = function() {
- var o = this,
- a = t.statvoo.tracker,
- i = t.statvoo.helper,
- n = document.getElementsByName("statvoo_styles")[0];
- if ("undefined" != typeof n && null != n || (n = document.createElement("link"), n.setAttribute("rel", "stylesheet"), n.setAttribute("type", "text/css"), n.setAttribute("id", "statvoo_styles"), n.setAttribute("name", "statvoo_styles"), n.setAttribute("href", "https://static.statvoo.com/css/chat.css"), document.head.appendChild(n)), o.adminOnline) {
- var s = document.getElementsByName("statvoo_chatwidget__yourname")[0].value,
- r = document.getElementsByName("statvoo_chatwidget__youremail")[0].value,
- c = document.getElementsByName("statvoo_chatwidget__subject")[0].value;
- if ("" == c) return document.getElementsByName("statvoo_chatwidget__subject")[0].style.border = "1px solid red", void document.getElementsByName("statvoo_chatwidget__subject")[0].focus();
- var d = window.statvoo.tracker.guid,
- l = window.statvoo.tracker.sid;
- if (v && v.tracker && v.identify({
- name: s,
- email: r
- }), document.getElementById("statvoo_chat_widget")) {
- var m = document.getElementById("statvoo_chat_widget");
- m.parentElement.removeChild(m)
- }
- var u = {
- name: s,
- email: r,
- subject: c,
- siteid: l,
- userid: d
- };
- a.source = a.trackPath("chat", "?_=" + a.randomstring() + "&s=" + a.site + "<id=" + a.ltid + "&g=" + a.guid + "&lc=userstart&_obj=" + encodeURIComponent(i.serialize(u))), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load()
- } else {
- var s = document.getElementsByName("statvoo_chatwidget__yourname")[0].value,
- r = document.getElementsByName("statvoo_chatwidget__youremail")[0].value,
- c = document.getElementsByName("statvoo_chatwidget__subject")[0].value,
- p = document.getElementsByName("statvoo_chatwidget__message")[0].value;
- if ("" == s || "" == r || "" == c || "" == p) return void alert("Please fill in all the fields");
- var d = window.statvoo.tracker.guid,
- l = window.statvoo.tracker.sid;
- v && v.tracker && v.identify({
- name: s,
- email: r
- });
- var u = {
- name: s,
- email: r,
- subject: c,
- message: p,
- siteid: l,
- userid: d
- };
- a.source = a.trackPath("chat", "?_=" + a.randomstring() + "&s=" + a.site + "<id=" + a.ltid + "&g=" + a.guid + "&lc=usermessage&_obj=" + encodeURIComponent(i.serialize(u))), t.statvoo.script = new e(a.source, "async"), t.statvoo.script.load()
- }
- }, n.prototype.messageSent = function(t) {
- if (alert(t), document.getElementById("statvoo_chat_widget")) {
- var e = document.getElementById("statvoo_chat_widget");
- e.parentElement.removeChild(e)
- }
- }, "function" != typeof String.prototype.startsWith && (String.prototype.startsWith = function(t) {
- return 0 == this.indexOf(t)
- }), s.prototype.strUgly = function(t) {
- for (var e, o = "", a = 0, i = t.length; i > a; a += 1) e = t.charCodeAt(a), o += e.toString(16) + " ";
- return o = o.replace(/ /g, ""), o.split("").reverse().join("")
- }, s.prototype.strUnUgly = function(t) {
- t = t.split("").reverse().join("").replace(/(.{2})/g, "$1 ");
- for (var e, o = t.split(" "), a = "", i = 0, n = o.length; n > i; i += 1) e = String.fromCharCode(parseInt(o[i], 16)), a += e;
- return a
- }, s.prototype.postRequest = function(t, e) {
- var o = this,
- a = o.createXMLHTTPObject();
- a && (a.open("POST", t, !0), a.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), a.onreadystatechange = function() {
- 4 == a.readyState && 200 != a.status && 304 != a.status
- }, 4 != a.readyState && a.send(e))
- }, s.prototype.createCORSRequest = function(t, e) {
- var o = new XMLHttpRequest;
- return "withCredentials" in o ? o.open(t, e, !0) : "undefined" != typeof XDomainRequest ? (o = new XDomainRequest, o.open(t, e)) : o = null, o
- }, s.prototype.createXMLHTTPObject = function() {
- for (var t = [function() {
- return new XMLHttpRequest
- }, function() {
- return new ActiveXObject("Msxml2.XMLHTTP")
- }, function() {
- return new ActiveXObject("Msxml3.XMLHTTP")
- }, function() {
- return new ActiveXObject("Microsoft.XMLHTTP")
- }], e = !1, o = 0; o < t.length; o++) {
- try {
- e = t[o]()
- } catch (a) {
- continue
- }
- break
- }
- return e
- }, s.prototype.serialize = function(t) {
- var e, o, a, i = "",
- n = "",
- s = 0,
- r = function(t) {
- var e = 0,
- o = 0,
- a = t.length,
- i = "";
- for (o = 0; a > o; o++) i = t.charCodeAt(o), e += 128 > i ? 1 : 2048 > i ? 2 : 3;
- return e
- },
- c = function(t) {
- var e, o, a, i, n = typeof t;
- if ("object" === n && !t) return "null";
- if ("object" === n) {
- if (!t.constructor) return "object";
- a = t.constructor.toString(), e = a.match(/(\w+)\(/), e && (a = e[1].toLowerCase()), i = ["boolean", "number", "string", "array"];
- for (o in i)
- if (a == i[o]) {
- n = i[o];
- break
- }
- }
- return n
- },
- d = c(t);
- switch (d) {
- case "function":
- e = "";
- break;
- case "boolean":
- e = "b:" + (t ? "1" : "0");
- break;
- case "number":
- e = (Math.round(t) == t ? "i" : "d") + ":" + t;
- break;
- case "string":
- e = "s:" + r(t) + ':"' + t + '"';
- break;
- case "array":
- case "object":
- e = "a";
- for (o in t)
- if (t.hasOwnProperty(o)) {
- if (i = c(t[o]), "function" === i) continue;
- a = o.match(/^[0-9]+$/) ? parseInt(o, 10) : o, n += this.serialize(a) + this.serialize(t[o]), s++
- }
- e += ":" + s + ":{" + n + "}";
- break;
- case "undefined":
- default:
- e = "N"
- }
- return "object" !== d && "array" !== d && (e += ";"), e
- };
- var v = {};
- v.cookie = new a, v.script = !1, v.tracker = new o, v.chat = new i, v.chatWidget = new n, v.helper = new s, v.event = r, v.goal = d, v.tag = c, v.identify = l, v.errors = m, v.debug = !1, t.statvoo = v, t.onerror = function(e, o, a, i, n) {
- t.statvoo.errors({
- m: e,
- f: o,
- l: a,
- c: i,
- s: n && n.stack ? n.stack : "",
- e: n
- })
- }, t.statvoo.tracker.initialize()
- }(window);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement