﻿function XDTracker() { this.version = '1.0'; this.postUrl = 'http://tracker.21edu.com/tracker_v1.1.ashx'; this.domain = '.21edu.com'; this.domainPath = '/' } XDTracker.prototype = { GetCK: function(n) { var a, r = new RegExp('(^| )' + n + '=([^;]*)(;|$)'); if (a = document.cookie.match(r)) return unescape(a[2]); else return '' }, SetCK: function(n, v, ef) { var c = n + '=' + escape(v); ef = false || ef; if (!ef) { var e = new Date(); e.setTime(e.getTime() + 365 * 24 * 60 * 60 * 1000); c += '; expires=' + e.toGMTString() } c += '; path=' + this.domainPath; if (this.domain != '') c += '; domain=' + this.domain; if (c.length < 4096) document.cookie = c }, GB: function() { var g = ''; for (var i = 1; i <= 32; i++) { var n = Math.floor(Math.random() * 16.0).toString(16); g += n; if ((i == 8) || (i == 12) || (i == 16) || (i == 20)) g += '-' } return g }, GT: function(d, ms) { var t = ''; d = new Date() || d; t += d.getFullYear() + '-'; t += (d.getMonth() + 1) + '-'; t += d.getDate() + ' '; t += d.getHours() + ':'; t += d.getMinutes() + ':'; t += d.getSeconds() + '.'; t += (ms || d.getMilliseconds()); return t }, CS: function(o) { this.SetCK('clu', o.href, true); this.SetCK('clt', o.innerHTML, true) }, IL: function() { var ls = document.links; var me = this; for (var i = 0; i < ls.length; i++) { if ('function' == typeof ls[i].onclick) { ls[i]._tc = ls[i].onclick; ls[i].onclick = function(e) { eval('this._tc()'); return me.CS(this) } } else { ls[i].onclick = function() { return me.CS(this) } } } }, Start: function() { var u = this.postUrl; u += '?tid=' + this.GB(); u += '&cct=' + this.GT(); u += '&ref=' + encodeURI(document.referrer); u += '&scr=' + screen.width + 'x' + screen.height; var clu = ''; if (this.GetCK('clu') != '') { clu = this.GetCK('clu'); this.SetCK('clu', '', true) } u += '&clu=' + encodeURI(clu); var clt = ''; if (this.GetCK('clt') != '') { clt = this.GetCK('clt'); this.SetCK('clt', '', true) } u += '&clt=' + encodeURI(clt); var sid = ''; if (this.GetCK('sid') != '') { sid = this.GetCK('sid') } else { sid = this.GB(); this.SetCK('sid', sid, true) } u += '&sid=' + sid; var pid = ''; if (this.GetCK('pid') != '') { pid = this.GetCK('pid') } else { pid = 0; this.SetCK('pid', pid, true) } u += '&pid=' + pid; var uid = ''; if (this.GetCK('uid') != '') { uid = this.GetCK('uid') } else { uid = 0; this.SetCK('uid', uid, true) } u += '&uid=' + uid; u += '&rid=' + Math.random(); var img = document.createElement('img'); img.src = u; img.border = 0; img.width = 1; img.height = 1; document.body.appendChild(img); this.IL() } }; new XDTracker().Start();