· 9 years ago · Jan 20, 2017, 08:20 PM
1var _io_init_async = function() {
2 try {
3 encodeURIComponent(location.pathname);
4 window.ioqimj7 = +Date.now();
5 Array.isArray || (Array.isArray = function(a) {
6 return "[object Array]" === Object.prototype.toString.call(a)
7 });
8 _io_get_random_int = function(a, b) {
9 return Math.floor(Math.random() * (b - a + 1)) + a
10 };
11 _io_track_exception_new = function(a, b) {
12 if (a) {
13 var c = "https://tt.onthe.io/?k[]=34966:" + a + "&s=495dfe71901eeeea8fc384f56fe02d5e" + ("undefined" != typeof b ? "&v=" + b : "") + "&" + +Date.now(),
14 d = document.createElement("script"),
15 e = "_io" + 1E5 *
16 Math.random() + "." + +Date.now();
17 d.setAttribute("src", c);
18 d.setAttribute("async", !0);
19 d.setAttribute("id", e);
20 try {
21 d.addEventListener("load", function() {
22 var a = document.getElementById(e);
23 a && (a.remove ? a.remove() : a.parentNode && a.parentNode.removeChild(a))
24 })
25 } catch (l) {}(document.head || document.getElementsByTagName("head")[0]).appendChild(d)
26 }
27 };
28 _io_track_exception = function(a, b) {
29 if (a) {
30 var c = "https://tapi.onthe.io/?k=11768:" + a + "&s=495dfe71901eeeea8fc384f56fe02d5e" + ("undefined" != typeof b ? "&v=" + b : "") + "&" + +Date.now(),
31 d = document.createElement("script"),
32 e = "_io" + 1E5 * Math.random() + "." + +Date.now();
33 d.setAttribute("src", c);
34 d.setAttribute("async", !0);
35 d.setAttribute("id", e);
36 try {
37 d.addEventListener("load", function() {
38 var a = document.getElementById(e);
39 a && (a.remove ? a.remove() : a.parentNode && a.parentNode.removeChild(a))
40 })
41 } catch (l) {}(document.head || document.getElementsByTagName("head")[0]).appendChild(d)
42 }
43 };
44 _io_track_uniques = function() {
45 var a = document.cookie.match(/_io_un=([^;]+)/);
46 if (-1 == document.cookie.indexOf("_io_un=") || a &&
47 a[1] && a[1] != (new Date).getDate()) {
48 a = new Date;
49 a.setYear(a.getFullYear() + 1);
50 document.cookie = "_io_un=; expires=" + a.toUTCString() + "; path=/; domain=." + location.hostname;
51 if (location.hostname) {
52 var b = location.hostname.replace("www.", "");
53 document.cookie = "_io_un=; expires=" + a.toUTCString() + "; path=/; domain=." + b
54 }
55 document.cookie = "_io_un=" + (new Date).getDate() + "; expires=" + a.toUTCString() + "; path=/";
56 _io_track_batch("uniques_instantly[" + _io_slices.join(",") + "]")
57 }
58 };
59 _io_push_previous_page = function() {
60 try {
61 var a =
62 null;
63 if ("undefined" != typeof localStorage) {
64 var b = Math.floor(+Date.now() / 1E3) + 900,
65 c = Math.floor(+Date.now() / 1E3);
66 _io_previous_page_exp = localStorage._io_previous_page_exp;
67 c < _io_previous_page_exp && localStorage._io_previous_page !== _io_page() && (a = localStorage._io_previous_page, _io_slices.push("previous_page:" + a));
68 var d = location.search,
69 d = _io_url_utm_replace(d);
70 localStorage._io_previous_page = "/" != location.pathname || d ? _io_page() : "Main Page";
71 localStorage._io_previous_page_exp = b
72 }
73 } catch (e) {}
74 };
75 var q = 0;
76 _io_track_time =
77 function() {
78 var a = setInterval(function() {
79 user_status ? _io_track_batch("time[page:" + _io_page() + ",user_status:" + user_status + "]", 10) : _io_track_batch("time[page:" + _io_page() + "]", 10);
80 30 <= ++q && clearInterval(a)
81 }, 1E4);
82 window.onblur = function() {
83 window.blurred = 1
84 }
85 };
86 _io_cookie_end_day = function(a, b) {
87 var c = new Date,
88 d = new Date;
89 d.setFullYear(c.getFullYear());
90 d.setMonth(c.getMonth());
91 d.setDate(c.getDate() + 1);
92 d.setHours(0);
93 d.setMinutes(0);
94 d.setSeconds(0);
95 document.cookie = a + "=" + b + "; " + ("expires=" + d.toString()) + "; path=/"
96 };
97 _io_getCookie = function(a) {
98 return (a = document.cookie.match(new RegExp("(?:^|; )" + a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") + "=([^;]*)"))) ? decodeURIComponent(unescape(a[1])) : void 0
99 };
100 _io_setCookie = function(a, b, c, d, e) {
101 date = new Date;
102 date.setTime(date.getTime() + 864E5);
103 c = c || date.toGMTString();
104 e = e || location.host.indexOf("www.") && location.host || location.host.replace("www.", "");
105 d = d || "/";
106 document.cookie = a + "=" + escape(b) + (c ? "; expires=" + c : "") + (d ? "; path=" + d : "") + "; domain=." + e
107 };
108 _io_get_properties = function(a,
109 b, c) {
110 return null !== a && b in a ? a[b] : ""
111 };
112 _io_push_utm_data = function(a) {
113 var b = [],
114 c = [],
115 d = [];
116 location.search && (b = location.search.substr(1).split(/&/));
117 for (var e = 0; e < b.length; e++) {
118 var l = b[e].split("=");
119 if (0 == l[0].indexOf("utm_") && l[0].substr(4).match(/^[a-z]+$/)) {
120 c.push(b[e]);
121 var f = l[1];
122 if ("source" === l[0].substr(4))
123 if (-1 == document.cookie.indexOf("__io_fs=")) {
124 a.push("first_source:" + f);
125 var g = new Date;
126 g.setYear(g.getFullYear() + 1);
127 document.cookie = "__io_fs=" + f + "; expires=" + g.toUTCString() + "; path=/"
128 } else fs =
129 document.cookie.match(/__io_fs=([^;]+)/)[1], a.push("first_source:" + fs);
130 "referrer" === l[0].substr(4) && (f = _io_referrer_group(decodeURIComponent(f)));
131 "campaig" != l[0].substr(4) && (d.push(l[0].substr(4) + ":" + f), a.push(l[0].substr(4) + ":" + f))
132 }
133 }
134 if (0 < d.length) d = d.join("|||"), g = new Date, g.setYear(g.getFullYear() + 1), document.cookie = "__io_utm=" + d + "; expires=" + g.toUTCString() + "; path=/";
135 else if (!_io_same_host()) document.cookie = "__io_utm=;expires=Thu, 01 Jan 1970 00:00:01 GMT;";
136 else if (-1 !== document.cookie.indexOf("__io_utm=")) {
137 d =
138 document.cookie.match(/__io_utm=([^;]+)/);
139 d = d[1].split("|||");
140 for (e = 0; e < d.length; e++) a.push(d[e]); - 1 !== document.cookie.indexOf("__io_fs=") && (fs = document.cookie.match(/__io_fs=([^;]+)/)[1], a.push("first_source:" + fs))
141 }
142 };
143 _io_same_host = function() {
144 var a = "undefined" == typeof _io_referrer_value ? document.referrer : _io_referrer_value;
145 return 0 < a.indexOf(location.hostname) && 10 > a.indexOf(location.hostname) ? !0 : !1
146 };
147 _io_page = function() {
148 var a = document.title || "none",
149 a = _io_replace_to_html(a).replace(/\xA0/g, " ").trim();
150 return encodeURIComponent(a)
151 };
152 _io_author = function() {
153 var a = !1,
154 b = document.querySelector(".meta-author a, .details-heading .user");
155 b && "" != b.textContent.replace("Lê Ãi - Ảnh: ", "") ? a = b.textContent.replace("Lê Ãi - Ảnh: ", "") : "game.thanhnien.vn" == location.hostname ? (b = document.querySelector("a.author")) ? a = b.textContent : (b = document.querySelector(".detail-post-block > .dt-main-post")) && (a = decodeURIComponent("%d0%91%d0%b5%d0%b7 %d0%b0%d0%b2%d1%82%d0%be%d1%80%d0%b0")) : (b = document.querySelector("#abody, #main_detail")) &&
156 (a = decodeURIComponent("%d0%91%d0%b5%d0%b7 %d0%b0%d0%b2%d1%82%d0%be%d1%80%d0%b0"));
157 if (a && (a = a.replace(/(<([^>]+)>)/ig, "").trim(), a = a.replace(/[:,']/g, "_"), 0 <= a.indexOf(",") && (a = a.substring(0, a.indexOf(","))), !(0 <= a.indexOf(":")) && a)) return encodeURIComponent(a)
158 };
159 _io_device = function() {
160 navigator.userAgent || (navigator.userAgent = "undefined");
161 var a = "desktop",
162 b = /Android|webOS|iPhone|PlayBook|iPad|iPod|IEMobile|BlackBerry|Mobile|Opera Mini/i.test(navigator.userAgent),
163 c = /Tablet|PlayBook|iPad/i.test(navigator.userAgent) ||
164 /Android/i.test(navigator.userAgent) && !/Mobile/i.test(navigator.userAgent),
165 d = /Android/i.test(navigator.userAgent),
166 e = /iPhone|iPad|iPod/i.test(navigator.userAgent);
167 b && (a = c ? "tablet" : "smart", a = d ? a + "%20(Android)" : e ? a + "%20(iOS)" : a + "%20(Other)");
168 return a
169 };
170 _io_start_page = function() {
171 if (-1 !== document.cookie.indexOf("__io_p=")) {
172 var a = document.cookie.match(/__io_p=([^;]+)/),
173 a = a[0].split("|||");
174 a[0] = a[0].substr(7, a[0].length);
175 a[0] = a[0].replace(/[:,]/g, "_");
176 return a[0]
177 }
178 a = new Date;
179 a.setYear(a.getFullYear() + 1);
180 document.cookie =
181 "__io_p=" + _io_page() + "|||" + _io_referrer() + "; expires=" + a.toUTCString() + "; path=/";
182 return _io_page()
183 };
184 _io_referrer_group = function(a) {
185 a = a.replace("www.", ""); - 1 !== a.indexOf("/") && (a = a.split("/")[2]);
186 a = a.replace(/\.$/, "");
187 a.indexOf("plus.google.");
188 a = a.replace(/google\.[a-z]+(\.[a-z]+)?/, "google"); - 1 !== a.indexOf("plus.url.google") && (a = "google.plus");
189 a = a.replace(/([m|mobile|web|mbasic|touch]\.)?facebook\.com/, "facebook");
190 a = a.replace(/fb\.me/, "facebook");
191 a = a.replace(/^fb$/, "facebook");
192 a = a.replace(/(m\.)?vk\.com/,
193 "vk.com");
194 a = a.replace(/vkontakte\.ru/, "vk.com");
195 a = a.replace(/^vk$/, "vk.com");
196 a = a.replace(/^t\.co/, "twitter");
197 a = a.replace(/clck\.yandex\.ru/, "yandex.ru");
198 a = a.replace(/yandex\.[a-z]+(\.[a-z]+)?/, "yandex.ru");
199 a = a.replace(/m\.ok\.ru/, "ok.ru");
200 a = a.replace(/l\.facebook/, "facebook");
201 a = a.replace(/lfacebook/, "facebook");
202 a = a.replace(/mobifacebook/, "facebook");
203 a = a.replace(/wefacebook/, "facebook");
204 a = a.replace(/twitter.com/, "twitter");
205 a = a.replace(/com.google/, "google");
206 a = a.replace(/r.search.yahoo.com/, "yahoo.com");
207 a = a.replace(/m\.news\.yandex/, "news.yandex");
208 a = a.replace(/googleads\.g\.doubleclick\.net/, "doubleclick.net");
209 a = a.replace(/ua\.korrespondent\.net/, "korrespondent.net");
210 a = a.replace(/(.*)\.directadvert\.ru/, "directadvert.ru"); - 1 !== a.indexOf("news") && -1 !== a.indexOf("yandex") && (a = "news.yandex.ru");
211 return encodeURIComponent(a.replace(/[:,]/g, "_"))
212 };
213 _io_source_for_referrer = function(a) {
214 var b = [];
215 location.search && (b = location.search.substr(1).split(/&/));
216 for (var c = 0; c < b.length; c++) {
217 var d = b[c].split("=");
218 0 ==
219 d[0].indexOf("utm_") && d[0].substr(4).match(/^[a-z]+$/) && d[0].substr(4)
220 }
221 if (-1 !== document.cookie.indexOf("__io_utm="))
222 for (utm = document.cookie.match(/__io_utm=([^;]+)/), utm = utm[1].split("|||"), c = 0; c < utm.length; c++) utm[c].split(":");
223 return a
224 };
225 _io_referrer = function() {
226 var a = "undefined" == typeof _io_referrer_value ? document.referrer : _io_referrer_value,
227 b = _io_search_get_parameter("utm_source");
228 "mail" == b ? a = "mail" : b && "" == a && (a = b);
229 if ("" === a && "YaBrowser" == _io_browser() && _io_author() && !_io_search_get_parameter("utm_source") &&
230 !_io_search_get_parameter("utm_campaign")) return "yandex_zen";
231 if ("" === a) return document.cookie = "__io_r=; expires=Thu, 01 Jan 1970 00:00:01 GMT;", _io_source_for_referrer("direct");
232 b = 0 < a.indexOf(location.hostname) && 10 > a.indexOf(location.hostname) ? !0 : !1;
233 if (!b) {
234 var c = new Date;
235 c.setYear(c.getFullYear() + 1);
236 document.cookie = "__io_r=" + a + "; expires=" + c.toUTCString() + "; path=/"
237 }
238 if (b)
239 if (a = document.cookie.match(/__io_r=([^;]+)/), -1 !== document.cookie.indexOf("__io_r=") && a && a.length && 1 < a.length) a = a[1];
240 else return _io_source_for_referrer("direct");
241 return a = _io_referrer_group(a)
242 };
243 _io_lifetime = function() {
244 var a = document.cookie.match(/__io=([^;]+)/);
245 if (a) a = a[1].split("_")[1];
246 else return "0";
247 a = Math.round((+Date.now() - a) / 864E5);
248 0 > a && (a = 0);
249 return a = 0 == a ? "0" : 7 > a ? a + "d" : 30 > a ? Math.round(a / 7) + "w" : Math.round(a / 30) + "m"
250 };
251 _io_track_queue = function(a, b) {
252 if ("undefined" != typeof localStorage) {
253 var c = localStorage._io_queue,
254 c = c ? JSON.parse(c) : [];
255 c.push({
256 key: a,
257 value: b
258 });
259 localStorage._io_queue = JSON.stringify(c)
260 }
261 };
262 _io_browser = function() {
263 navigator.userAgent || (navigator.userAgent =
264 "undefined");
265 var a = navigator.userAgent,
266 b, c = a.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
267 if (/trident/i.test(c[1])) return /\brv[ :]+(\d+)/g.exec(a), "IE";
268 if ("Chrome" === c[1] && (b = a.match(/\b(Edge)\/(\d+)/), null != b)) return "Edge";
269 if ("Chrome" === c[1] && (b = a.match(/\b(OPR)\/(\d+)/), null != b)) return "Opera";
270 if ("Chrome" === c[1] && (b = a.match(/\b(YaBrowser)\/(\d+)/), null != b)) return "YaBrowser";
271 c = c[2] ? [c[1], c[2]] : [navigator.appName, navigator.appVersion, "-?"];
272 null != (b = a.match(/version\/(\d+)/i)) &&
273 c.splice(1, 1, b[1]);
274 c[0] = c[0].replace(/[0-9\s]+$/g, "");
275 "MSIE" == c[0] && (c[0] = "IE");
276 return c[0]
277 };
278 _io_last_visit = function() {
279 var a = document.cookie.match(/__io_lv=([^;]+)/);
280 if (a) a = a[1];
281 else return "0";
282 return a = Math.round((+Date.now() - a) / 864E5)
283 };
284 _io_user_type = function() {
285 var a = "";
286 if (-1 == document.cookie.indexOf("__io_lv=")) {
287 var a = "new",
288 b = new Date;
289 b.setYear(b.getFullYear() + 1);
290 document.cookie = "__io_lv=" + +Date.now() + "; expires=" + b.toUTCString() + "; path=/"
291 } else 0 == _io_lifetime() ? a = "new" : (a = 1 * _io_last_visit(), a =
292 30 < a ? "new" : 7 < a ? "returned" : "constant", b = new Date, b.setYear(b.getFullYear() + 1), document.cookie = "__io_lv=" + +Date.now() + "; expires=" + b.toUTCString() + "; path=/");
293 return a
294 };
295 _io_track_readability_on_scroll = function(a, b) {
296 _io_slices_read = [];
297 _io_slices_read.push("device:" + _io_device());
298 _io_slices_read.push("page:" + _io_page());
299 encodeURIComponent(location.pathname);
300 for (var c = 0; c < _io_slices.length; c++)
301 if (-1 < _io_slices[c].indexOf("url:")) {
302 _io_slices_read.push(_io_slices[c]);
303 break
304 }
305 "finished" == a[b] ? _io_track_once("read_" +
306 a[b] + "[" + _io_slices.join(",") + "]", 1) : _io_track_once("read_" + a[b] + "[" + _io_slices_read.join(",") + "]", 1)
307 };
308 _io_foot_object = [".tags, #comment-block"];
309 _io_track_read = function() {
310 function a(a) {
311 a = "undefined" !== typeof a ? a : "scroll";
312 for (var b = document.body, e = document.documentElement, b = 10 * Math.round(10 * (document.body.scrollTop + window.innerHeight) / ("undefined" == typeof _io_time_read_height ? Math.max(b.scrollHeight, b.offsetHeight, e.clientHeight, e.scrollHeight, e.offsetHeight) : _io_time_read_height)), e = [".tags, #comment-block"],
313 l = 0; l < e.length; l++) {
314 var f = document.querySelector(e[l]);
315 if (f) {
316 b = f.getBoundingClientRect().top - window.innerHeight;
317 if (0 > b && "start" == a) {
318 a = "finished";
319 b = ["top", "middle", "bottom", "finished"];
320 for (e = 0; e <= b.indexOf(a); e++) _io_track_readability_on_scroll(b, e);
321 return "finished"
322 }
323 e = b - document.body.getBoundingClientRect().top;
324 b = 10 * Math.round(10 - b / e * 10);
325 break
326 }
327 }
328 if ("start" != a)
329 for (100 < b && (b = 100), 0 > b && (b = 0), a = 25 >= b ? "top" : 50 >= b ? "middle" : 75 >= b ? "bottom" : "finished", b = ["top", "middle", "bottom", "finished"], e = 0; e <= b.indexOf(a); e++) _io_track_readability_on_scroll(b,
330 e)
331 }
332 if ("finished" != a("start")) {
333 var b = "";
334 ("undefined" == typeof _io_tr_element ? document : _io_tr_element).addEventListener("scroll", function() {
335 clearInterval(b);
336 b = setTimeout(a, 200)
337 })
338 }
339 };
340 _io_decode_escape_sequence = function(a) {
341 return a.replace(/\\x([0-9A-Fa-f]{2})/g, function(a, c) {
342 return String.fromCharCode(parseInt(c, 16))
343 })
344 };
345 _io_track = function(a, b) {
346 if (a) {
347 Array.isArray(a) && (a = a.join("&/?k[]=26526:"));
348 a = _io_decode_escape_sequence(a);
349 var c = 0 <= a.indexOf("visits_instantly") ? "&__io=" + ("undefined" != typeof _io_getCookie("__io") ?
350 _io_getCookie("__io") : "") : "",
351 c = "https://tt.onthe.io/?k[]=26526:" + a + "&s=f005c4a14eaf1b923b8df2d935767308" + ("undefined" != typeof b ? "&_v=" + b : "") + c + "&" + +Date.now(),
352 d = document.createElement("script"),
353 e = "_io" + 1E5 * Math.random() + "." + +Date.now();
354 d.setAttribute("src", c);
355 d.setAttribute("async", !0);
356 d.setAttribute("id", e);
357 try {
358 d.addEventListener("load", function() {
359 var a = document.getElementById(e);
360 a && (a.remove ? a.remove() : a.parentNode && a.parentNode.removeChild(a))
361 })
362 } catch (f) {
363 _io_track_exception("error_script[error:" +
364 f.message + ",app:26526]"), _io_track_exception("error_script_dich[error:" + f.message.replace(/[:,]/g, "_") + ",app:26526,url:" + location.pathname + "]"), _io_track_exception("error_script_new[error:" + f.message.replace(/[:,]/g, "_") + ",app:26526,url:" + location.pathname + "]")
365 }(document.head || document.getElementsByTagName("head")[0]).appendChild(d);
366 _io_test_track = !0; - 1 < a.indexOf("pageviews_info") && (_io_finished = !0)
367 }
368 };
369 var p = [];
370 _io_track_once = function(a, b) {
371 var c = a.split("[")[0];
372 0 > p.indexOf(c) && ("read_finished" == c &&
373 (b = parseInt((+Date.now() - window.ioqimj7) / 1E3), 300 < b && (b = 300), a = a.replace(",device", ",time_int:" + b + ",device")), _io_track_batch(a, b), p.push(c))
374 };
375 var n = [];
376 _io_track_once_k = function(a, b) {
377 0 > n.indexOf(a) && (_io_track_batch(a, b), n.push(a))
378 };
379 var f = [],
380 t = function() {
381 var a = 0;
382 return function(b, c) {
383 clearTimeout(a);
384 a = setTimeout(b, c)
385 }
386 }();
387 _io_track_batch = function(a, b) {
388 if (Array.isArray(a))
389 for (var c = 0; c < a.length; c++) 0 > f.indexOf(a[c]) && f.push(a[c]);
390 else 0 > f.indexOf(a) && f.push(a);
391 t(function() {
392 for (var a = [], b = 0; b < f.length; b++) 6E3 <
393 a.join("&/?k[]=26526:").length && (_io_track(a), a = []), a.push(f[b]);
394 0 < a.length && _io_track(a);
395 f = []
396 }, 1E3)
397 };
398 _io_slice_delete = function(a) {
399 if (_io_slices)
400 for (var b in _io_slices) "function" != typeof _io_slices[b] && 0 == _io_slices[b].indexOf(a) && _io_slices.splice(b, 1)
401 };
402 _io_slice_push = function(a, b) {
403 var c = !0,
404 d = 0;
405 "string" === typeof b && (b = _io_replace_to_html(b));
406 if (_io_slices) {
407 for (var e = 0; e < _io_slices.length; e++)
408 if (0 == _io_slices[e].indexOf(a)) {
409 c = !1;
410 d = e;
411 break
412 }
413 c ? _io_slices.push(a + ":" + b) : _io_slices[d] = a + ":" + b
414 }
415 };
416 _io_search_get_parameter =
417 function(a, b) {
418 try {
419 b = b || location.search;
420 var c = decodeURIComponent(b).substr(1).split(/&/),
421 d = "";
422 if (c) {
423 for (var e = 0; e <= c.length - 1; e++) c[e].split("=")[0] == a && (d = c[e].split("=")[1]);
424 if (d) return d
425 }
426 } catch (f) {}
427 };
428 _io_query_to_array = function(a) {
429 a = a || location.search;
430 var b = decodeURIComponent(a);
431 if (b && "?" != b && "?null" != b) {
432 a = {};
433 b = b.substr(1).split("&");
434 for (param in b)
435 if ("string" === typeof b[param]) {
436 var c = b[param].split("=");
437 a[c[0]] = c[1]
438 }
439 return a
440 }
441 };
442 _io_slice_get = function(a) {
443 if (_io_slices && a)
444 for (var b = 0; b <= _io_slices.length -
445 1; b++)
446 if (0 == _io_slices[b].indexOf(a)) {
447 a = decodeURIComponent(_io_slices[b]);
448 if (a.indexOf(":")) return a.split(":")[1];
449 break
450 }
451 };
452 _io_url_utm_replace = function(a) {
453 if (/utm_/.test(a)) {
454 var b = a.replace(/\?([^#]*)/, function(a, b) {
455 return (b = b.split("&").map(function(a) {
456 return !/^utm_/.test(a) && a
457 }).filter(Boolean).join("&")) ? "?" + b : ""
458 });
459 return b != a ? b : a
460 }
461 return a
462 };
463 _io_unique_action = function(a, b) {
464 try {
465 if ("undefined" != typeof localStorage) {
466 var c = new Date;
467 now_time = c.getDate() + "-" + (c.getMonth() + 1) + "-" + c.getFullYear();
468 a && (c = [], localStorage._io_unique ? (c = JSON.parse(localStorage._io_unique), now_time.toString() in c ? -1 == c[now_time].indexOf(a) && (_io_track("unique_" + b + "[" + _io_slices.join(",") + "]"), c[now_time].push(a), localStorage._io_unique = JSON.stringify(c)) : (_io_track("unique_" + b + "[" + _io_slices.join(",") + "]"), c = {}, c[now_time] = [], c[now_time].push(a), localStorage._io_unique = JSON.stringify(c))) : (_io_track("unique_" + b + "[" + _io_slices.join(",") + "]"), c = {}, c[now_time] = [], c[now_time].push(a), localStorage._io_unique = JSON.stringify(c)))
469 }
470 } catch (d) {}
471 };
472 _io_slice_value_prepare = function(a, b) {
473 if (a && "undefined" === typeof b) return encodeURIComponent(a.toString().replace(/[:,]/g, "_"));
474 if (a && "price" == b) return a = a.toString().replace(/[^0-9]/gim, ""), 100 * a
475 };
476 _io_element_traverse = function(a, b) {
477 if (a && b === parseInt(b)) {
478 for (var c = 0; c < b; ++c) {
479 if (!a.parentNode) return;
480 a = a.parentNode
481 }
482 return a
483 }
484 };
485 _io_slice_language = function() {
486 var a = document.querySelector("html");
487 return a && (lang = a.getAttribute("lang")) ? _io_slice_value_prepare(lang) : !1
488 };
489 _io_galery_pageviews = function() {
490 window.addEventListener("hashchange",
491 function(a) {
492 _io_track("pageviews_instant[" + _io_slices.join(",") + "]");
493 _io_track("pageviews_info[" + _io_slices.join(",") + "]");
494 localStorage.setItem("_io_previous_url", location.href)
495 })
496 };
497 _io_pv_ajax_detect = function() {
498 var a = [location.href],
499 b = [_io_page()];
500 _io_slices_ajax = [];
501 var c = 0;
502 setInterval(function() {
503 -1 == a.indexOf(location.href) && -1 == b.indexOf(_io_page()) && (c++, a.push(location.href), b.push(_io_page()), _io_slices_ajax.push("author:" + decodeURIComponent("%d0%91%d0%b5%d0%b7 %d0%b0%d0%b2%d1%82%d0%be%d1%80%d0%b0")),
504 _io_slices_ajax.push("page:" + _io_page()), _io_slices_ajax.push("url:" + encodeURIComponent(location.pathname)), _io_slices_ajax.push("previous_page:" + b[c - 1]), _io_track("pageviews_instant[" + _io_slices_ajax.join(",") + "]"), _io_track("pageviews_info[" + _io_slices_ajax.join(",") + "]"), _io_slices_ajax = [])
505 }, 500)
506 };
507 _io_user = function() {
508 if (-1 == document.cookie.indexOf("__io=")) {
509 var a = new Date;
510 a.setYear(a.getFullYear() + 1);
511 var b = Math.floor(68719476736 * (1 + Math.random())).toString(16).substring(1) + "." + Math.floor(68719476736 *
512 (1 + Math.random())).toString(16).substring(1);
513 document.cookie = "__io=" + b + "_" + +Date.now() + "; expires=" + a.toUTCString() + "; path=/"
514 } else a = new Date, a.setYear(a.getFullYear() + 1), document.cookie = "__io=" + ("undefined" != typeof _io_getCookie("__io") ? _io_getCookie("__io") + "; expires=" + a.toUTCString() + "; path=/" : "");
515 return _io_getCookie("__io")
516 };
517 _io_init_ajax = function(a) {
518 function b() {
519 _category = document.querySelectorAll(g);
520 if (!_category) return null;
521 _category = _category[_category.length - 1];
522 _category = _io_get_properties(_category,
523 "textContent");
524 _category = _category.toUpperCase().trim();
525 return _category = encodeURIComponent(_category.replace(/[:,]/gi, "_"))
526 }
527
528 function c(a, b, c) {
529 for (var d = 0; d < c.length; d++)
530 if (-1 < c[d].indexOf(a + ":")) return c[d] = a + ":" + b, c;
531 c.push(a + ":" + b);
532 return c
533 }
534 var d = a.request_identifier,
535 e = a.articles,
536 f = a.titles,
537 k = a.authors,
538 g = a.categories,
539 h = [{
540 article: null,
541 slices: null,
542 url: location.pathname
543 }],
544 m = [location.pathname],
545 v = [location.pathname];
546 (function(a) {
547 XMLHttpRequest.prototype.send = function(m) {
548 this.addEventListener("readystatechange",
549 function() {
550 if (4 == this.readyState && (!d || 0 <= this.responseURL.indexOf(d) || d instanceof RegExp && d.test(this.responseURL))) {
551 _io_slices_new = _io_slices;
552 _io_slices_new = c("url", document.location.pathname, _io_slices_new);
553 f && ((_titles = document.querySelectorAll(f)) && _titles.length && (_title = _titles[_titles.length - 1], _title = (_title = _title.textContent.trim()) ? _title : document.title.trim(), _title = encodeURIComponent(_io_replace_to_html(_title))), _title = document.title, _io_slices_new = c("page", _title, _io_slices_new));
554 g && b() && (_io_slices_new = c("category", b(), _io_slices_new));
555 if (k) {
556 var a;
557 authors_list = document.querySelectorAll(k);
558 console.log(authors_list);
559 authors_list ? (author = authors_list[authors_list.length - 1], console.log(author), a = author = _io_get_properties(author, "textContent").trim()) : a = decodeURIComponent("%d0%91%d0%b5%d0%b7 %d0%b0%d0%b2%d1%82%d0%be%d1%80%d0%b0");
560 _io_slices_new = c("author", a, _io_slices_new)
561 }
562 if (e) {
563 if (a = document.querySelector(e)) text = a.textContent.trim().replace(/[,:;()\/&+]|\-\-/g, " ").replace(/[\.!?]/g,
564 ".").replace(/^\s+/, "").replace(/[\.]?(\w+)[\.]?(\w+)@(\w+)[\.](\w+)[\.]?/g, "$1$2@$3$4").replace(/[ ]*(\n|\r\n|\r)[ ]*/g, ".").replace(/([\.])[\.]+/g, ".").replace(/[ ]*([\.])/g, ". ").replace(/\s+/g, " ").replace(/\s+$/, "").replace(/\n /, "\n"), a = text.split(" ").length || 1, _io_slices_new = c("reference_time", Math.round(a / (190 / 60)), _io_slices_new);
565 a = document.querySelectorAll(e);
566 a = a[a.length - 1];
567 h.push({
568 article: a,
569 url: document.location.pathname,
570 slices: _io_slices_new
571 })
572 }
573 }
574 }, !1);
575 a.apply(this, arguments)
576 }
577 })(XMLHttpRequest.prototype.send);
578 (function() {
579 for (var a in window)
580 if (0 == a.indexOf("io")) return a;
581 return null
582 })();
583 document.addEventListener("scroll", function() {
584 for (var a = 0; a < h.length; a++) {
585 var b;
586 if (b = h[a].article) b = h[a].article, _top = b.getBoundingClientRect().top, b = _top <= document.documentElement.getBoundingClientRect().height && 0 <= _top + b.getBoundingClientRect().height;
587 b && -1 == m.indexOf(h[a].url) && (_io_track("pageviews_instant[depth:" + ++_io_depth + "," + h[a].slices.join(",") + "]"), _io_track("pageviews_info[depth:" + ++_io_depth + "," + h[a].slices.join(",") +
588 "]"), m.push(h[a].url));
589 h[a].article && -1 == v.indexOf(h[a].url) && h[a].article.getBoundingClientRect().bottom < window.innerHeight + 150 && (_io_track("read_finished[" + h[a].slices.join(",") + "]", 1), v.push(h[a].url))
590 }
591 })
592 };
593 _io_get_browser_version = function() {
594 try {
595 var a = navigator.userAgent,
596 b, c = a.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
597 if (/trident/i.test(c[1])) return b = /\brv[ :]+(\d+)/g.exec(a) || [], "IE " + (b[1] || "");
598 if ("Chrome" === c[1] && (b = a.match(/\b(OPR|Edge)\/(\d+)/), null != b)) return b.slice(1).join(" ").replace("OPR",
599 "Opera");
600 c = c[2] ? [c[1], c[2]] : [navigator.appName, navigator.appVersion, "-?"];
601 null != (b = a.match(/version\/(\d+)/i)) && c.splice(1, 1, b[1]);
602 return c.join(" ")
603 } catch (d) {
604 return a = "", "object" === typeof navigator && "string" === typeof navigator.userAgent && (a = navigator.userAgent, a.replace(/[:,]/g, "_")), "undefined"
605 }
606 };
607 _io_debug = function() {
608 if (_io_getCookie("__io_debug") && console && "function" == typeof console.log && arguments.length)
609 for (var a = 0; a < arguments.length; ++a) console.log(arguments[a])
610 };
611 _io_slice_set = function(a, b, c) {
612 b =
613 a + ":" + _io_slice_value_prepare(b);
614 if ("undefined" === typeof c) _io_slice_delete(a), _io_slices.push(b);
615 else if (c) {
616 for (var d = !1, e = 0; e < c.length; e++)
617 if (c[e].split(":")[0] == a) {
618 d = !0;
619 delete c[e];
620 c[e] = b;
621 break
622 }
623 d || c.push(b);
624 return c
625 }
626 };
627 _io_replace_to_html = function(a) {
628 return a.replace(/[:,]/g, function(a) {
629 return "#" + a.charCodeAt(0) + ";"
630 })
631 };
632 _io_slices = "undefined" != typeof _io_slices ? _io_slices : [];
633 _io_url_track_slice = location.pathname.replace(/[:,]/g, "___");
634 _io_slices.push("url:" + encodeURIComponent(_io_url_track_slice));
635 encodeURIComponent(_io_url_track_slice);
636 _io_slices.push("browser:" + _io_browser());
637 _io_slices.push("referrer:" + _io_referrer());
638 _io_slices.push("device:" + _io_device());
639 _io_slices.push("lifetime:" + _io_lifetime());
640 _io_slices.push("browser_version:" + _io_get_browser_version().replace(/[:,]/g, "_"));
641 _io_slice_push("user_type", _io_user_type());
642 "0" === _io_lifetime() ? _io_slices.push("returned:new") : _io_slices.push("returned:returned");
643 _io_push_utm_data(_io_slices);
644 _io_push_previous_page();
645 _io_depth = 1; - 1 !== document.cookie.indexOf("_io_s=") &&
646 (_io_depth = document.cookie.match(/_io_s=([^;]+)/)[1], _io_depth = (parseInt(_io_depth) || 0) + 1);
647 _io_slices.push("domain:" + location.hostname);
648 _io_user_id = 0;
649 if (-1 == document.cookie.indexOf("_io_s=")) {
650 _io_user_id = _io_get_random_int(1, 20);
651 var k = new Date;
652 k.setYear(k.getFullYear() + 1);
653 document.cookie = "__io_uid_test=" + _io_user_id + "; expires=" + k.toUTCString() + "; path=/"
654 } - 1 !== document.cookie.indexOf("__io_uid_test=") && (_io_user_id = document.cookie.match(/__io_uid_test=([^;]+)/)[1]);
655 user_status = "";
656 _io_start_page_url =
657 function() {
658 if (-1 !== document.cookie.indexOf("__io_sp=")) {
659 var a = document.cookie.match(/__io_sp=([^;]+)/);
660 return a && a.length && 1 < a.length ? (a = a[1], encodeURIComponent(a)) : ""
661 }
662 a = new Date;
663 a.setYear(a.getFullYear() + 1);
664 var b = location.pathname;
665 document.cookie = "__io_sp=" + b + "; expires=" + a.toUTCString() + "; path=/";
666 return encodeURIComponent(b)
667 };
668 _io_slices.push("sp:" + _io_start_page_url());
669 _io_slices.push("cdn_version:27");
670 _io_track_batch("pageviews_instant[depth:" + _io_depth + "," + _io_slices.join(",") + "]");
671 if (-1 == document.cookie.indexOf("__io=")) {
672 k =
673 new Date;
674 k.setYear(k.getFullYear() + 1);
675 var u = Math.floor(68719476736 * (1 + Math.random())).toString(16).substring(1) + "." + Math.floor(68719476736 * (1 + Math.random())).toString(16).substring(1);
676 document.cookie = "__io=" + u + "_" + +Date.now() + "; expires=" + k.toUTCString() + "; path=/"
677 } else k = new Date, k = new Date, k.setYear(k.getFullYear() + 1), document.cookie = "__io=" + ("undefined" != typeof _io_getCookie("__io") ? _io_getCookie("__io") + "; expires=" + k.toUTCString() + "; path=/" : ""); - 1 == document.cookie.indexOf("_io_s=") && _io_track_batch("visits_instantly[depth:" +
678 _io_depth + "," + _io_slices.join(",") + "]");
679 _io_track_uniques();
680 _io_widget_hash = function() {
681 var a = /^#client-widget-([a-z0-9_]{32})$/i;
682 if (a.test(location.hash)) {
683 var a = a.exec(location.hash)[1],
684 b = new Date;
685 b.setYear(b.getFullYear() + 1);
686 var c = location.host.indexOf("www.") && location.host || location.host.replace("www.", "");
687 if ("" == document.referrer || -1 != document.referrer.indexOf("nt.onthe.io")) document.cookie = "_io_widget=" + a + "; expires=" + b.toUTCString() + "; domain=." + c + "; path=/";
688 history.pushState("", document.title,
689 window.location.protocol + "//" + window.location.hostname + window.location.pathname + window.location.search);
690 return a
691 }
692 a = /_io_widget=([a-z0-9_]{32})/i;
693 return a.test(document.cookie) ? a.exec(document.cookie)[1] : !1
694 }();
695 _io_init()
696 } catch (a) {
697 _io_track_exception("error_script_dicaprio[app:26526,error:" + a.message.replace(/[:,'()]/g, "_") + "]"), _io_track_exception_new("error_script[app:26526,title:" + a.message.replace(/[:,'()]/g, "_") + ",url:" + location.pathname + ",browser:" + _io_browser() + ",browser_version:" + _io_get_browser_version() +
698 ",device:" + _io_device() + ",page:" + _io_page() + ",domain:" + location.hostname + ",writer:" + navigator.userAgent.replace(/[:,]/g, "_") + ",cdn_version:27,user_id:" + _io_user() + "]"), _io_track("error_script[title:" + a.message.replace(/[:,]/g, "_") + ",url:" + location.pathname + ",browser_version:" + _io_get_browser_version() + ",browser:" + _io_browser() + ",device:" + _io_device() + ",page:" + _io_page() + ",writer:" + navigator.userAgent.replace(/[:,]/g, "_") + ",cdn_version:27,user_id:" + _io_user() + "]")
699 }
700 },
701 _io_init = function() {
702 try {
703 var q = function(a) {
704 a =
705 a || void 0;
706 for (var b = document.body, c = document.documentElement, d = 10 * Math.round(10 * (document.body.scrollTop + window.innerHeight) / Math.max(b.scrollHeight, b.offsetHeight, c.clientHeight, c.scrollHeight, c.offsetHeight)), b = ['iframe[src*="youtube.com"],.jwvideo video,.video-effect.clearfix a'], c = 0; c < b.length; c++) {
707 var e = document.querySelector(b[c]);
708 e && (e = e.getBoundingClientRect().top - window.innerHeight, d = e - document.body.getBoundingClientRect().top, d = 10 * Math.round(10 - e / d * 10), 0 > e || 90 < d) && (void 0 !== a && (_io_track_once("url_play_video[title:" +
709 encodeURIComponent(video_title.replace("http://video.thanhnien.com.vn/", "").replace(/[:,]/g, "_")) + "," + _io_slices.join(",") + "]"), l = !1), l && setTimeout(function() {
710 q(!0)
711 }, 1E4))
712 }
713 },
714 p = function(a) {
715 if (n(a) && -1 == c.indexOf(a)) {
716 var b = a.src ? ",video:" + encodeURIComponent(a.src) : "";
717 _io_track("url_play_video[" + _io_slices.join(",") + ",title:" + _io_page() + b + "]");
718 c.push(a)
719 }
720 },
721 n = function(a) {
722 _top = a.getBoundingClientRect().top;
723 return _top <= 1 * document.documentElement.getBoundingClientRect().height / 3 && 0 <= _top + 1 * a.getBoundingClientRect().height /
724 3
725 };
726 if ("undefined" != typeof window.google && "undefined" != typeof window.google.translate && document.querySelector("html") && 0 <= document.querySelector("html").className.indexOf("translated-ltr")) _io_track_exception("pageviews_translate[" + _io_slices.join(",") + "]"), _io_track("pageviews_translate[" + _io_slices.join(",") + "]");
727 else if ("#io_debug" == location.hash) {
728 location.hash = "";
729 var f = document.createElement("script");
730 f.src = "https://cdn.onthe.io/io.js?Et5BLNwqiW2L";
731 document.body.appendChild(f)
732 } else {
733 if (!document ||
734 "complete" != document.readyState) return setTimeout(_io_init, 25);
735 var t = _io_slice_language();
736 t && _io_slices.push("language:" + t);
737 _io_slices.push("page:" + _io_page());
738 f = !1;
739 f = document.querySelector(".tags, #comment-block,#allrecords > div:last-child");
740 _io_author() && f && (_io_slices.push("author:" + _io_author()), _io_track_read());
741 _io_widget = {
742 init: function(a, b) {
743 _io_widget.id = a;
744 _io_widget.hash = b;
745 var c = new XMLHttpRequest,
746 d = _io_widget.get_callback(),
747 e = {
748 id: _io_widget.id,
749 hash: _io_widget.hash,
750 title: _io_page(),
751 force_type: "main_new",
752 path: location.pathname + location.search
753 };
754 c.open("POST", d, !0);
755 c.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
756 c.onreadystatechange = function() {
757 if (4 == c.readyState && 200 == c.status) {
758 var a = JSON.parse(c.responseText);
759 if (a) {
760 var b = document.createElement("div"),
761 d = document.createElement("script");
762 d.type = "text/javascript";
763 d.text = a.widget.js;
764 b.innerHTML = a.widget.html;
765 document.body.appendChild(b);
766 document.body.appendChild(d);
767 _io_widget.start(a.widget.type, a.widget.overall)
768 }
769 }
770 };
771 var d = "",
772 f;
773 for (f in e) d +=
774 f + "=" + encodeURIComponent(e[f]) + "&";
775 c.send(d)
776 },
777 get_callback: function() {
778 return "https://widget.onthe.io"
779 }
780 };
781 _io_widget_hash && _io_widget.init(26526, _io_widget_hash);
782 f = null;
783 if (f = "video.thanhnien.vn" == location.hostname ? document.querySelector(".media-breadcrumb li:nth-child(2) span") : document.querySelector('meta[property="article:section"]')) f = f.content || f.textContent, f = f.toUpperCase().trim(), f = encodeURIComponent(f.replace(/[:,]/g, "_")), _io_slices.push("category:" + f);
784 var k = document.querySelector("#abody, #main_detail");
785 if (k) {
786 text = k.textContent.trim().replace(/[,:;()\/&+]|\-\-/g, " ").replace(/[\.!?]/g, ".").replace(/^\s+/, "").replace(/[\.]?(\w+)[\.]?(\w+)@(\w+)[\.](\w+)[\.]?/g, "$1$2@$3$4").replace(/[ ]*(\n|\r\n|\r)[ ]*/g, ".").replace(/([\.])[\.]+/g, ".").replace(/[ ]*([\.])/g, ". ").replace(/\s+/g, " ").replace(/\s+$/, "").replace(/\n /, "\n");
787 var u = text.split(" ").length || 1;
788 _io_slice_push("reference_time", Math.round(u / (190 / 60)).toString())
789 }
790 var a = document.querySelectorAll("iframe[src*='youtube'], #mainplayer_display,#videoavatar"),
791 b = Array(a.length),
792 c = [];
793 a && a.length && document.addEventListener("scroll", function(c) {
794 for (c = 0; c < a.length; c++) n(a[c]) ? b[c] || (b[c] = setTimeout(p, 1E4, a[c])) : b[c] && (clearTimeout(b[c]), delete b[c])
795 });
796 if ("video.thanhnien.vn" == location.hostname) {
797 var d = location.pathname;
798 setInterval(function() {
799 if (location.pathname != d) {
800 var a = document.querySelectorAll("#mainplayer_display"),
801 b = Array(a.length);
802 a && a.length && document.addEventListener("scroll", function(c) {
803 _io_slice_push("url", location.pathname);
804 _io_slice_push("page",
805 document.title.replace(/[,:]/gi, "_"));
806 for (c = 0; c < a.length; c++) n(a[c]) ? b[c] || (b[c] = setTimeout(p, 1E4, a[c])) : b[c] && (clearTimeout(b[c]), delete b[c])
807 });
808 d = location.pathname
809 }
810 }, 3E3)
811 }
812 if (document.querySelector('iframe[src*="youtube.com"],.jwvideo video,.video-effect.clearfix a')) {
813 var e = "";
814 document.addEventListener("scroll", function() {
815 clearInterval(e);
816 e = setTimeout(q, 200)
817 })
818 }
819 var l = !0;
820 _io_depth = 1;
821 var r = new Date;
822 r.setTime(r.getTime() + 9E5); - 1 == document.cookie.indexOf("_io_s=") ? document.cookie = "_io_s=1; expires=" +
823 r.toUTCString() + "; path=/" : (_io_depth = document.cookie.match(/_io_s=([^;]+)/)[1], _io_depth = (parseInt(_io_depth) || 0) + 1, document.cookie = "_io_s=" + _io_depth + "; expires=" + r.toUTCString() + "; path=/");
824 try {
825 if ("undefined" != typeof localStorage) {
826 var g = localStorage._io_queue;
827 if (g) {
828 var g = JSON.parse(g),
829 h;
830 for (h in g) g[h].key && _io_track_batch(g[h].key, g[h].value);
831 localStorage.removeItem("_io_queue")
832 }
833 }
834 } catch (m) {}
835 _io_track_batch("pageviews_info[" + _io_slices.join(",") + "]");
836 try {
837 -1 === document.cookie.indexOf("test_track") &&
838 "#test_track" != location.hash && "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.io" != window.navigator.userAgent || _io_track("pageviews_test[" + _io_slices.join(",") + "]")
839 } catch (m) {}
840 _io_track_time()
841 }
842 } catch (m) {
843 _io_track_exception("error_script_dicaprio[app:26526,error:" + m.message.replace(/[:,'()]/g, "_") + "]"), _io_track_exception_new("error_script[app:26526,title:" + m.message.replace(/[:,'()]/g, "_") + ",url:" + location.pathname + ",browser:" +
844 _io_browser() + ",browser_version:" + _io_get_browser_version() + ",device:" + _io_device() + ",page:" + _io_page() + ",domain:" + location.hostname + ",writer:" + navigator.userAgent.replace(/[:,]/g, "_") + ",cdn_version:27,user_id:" + _io_user() + "]"), _io_track("error_script[title:" + m.message.replace(/[:,]/g, "_") + ",url:" + location.pathname + ",browser:" + _io_browser() + ",browser_version:" + _io_get_browser_version() + ",device:" + _io_device() + ",page:" + _io_page() + ",writer:" + navigator.userAgent.replace(/[:,]/g, "_") + ",cdn_version:27,user_id:" +
845 _io_user() + "]")
846 }
847 };
848_io_init_async();