var COM365_Analyser = { TI:{ sv:"1", //pid pid:"",rc:Math.round(Math.random()*2147483647), //location hs:"",ho:"",hn:"",hr:"",pn:"",pt:"",pc:"",s:"", //navigator an:"",av:"",bl:"",ce:"",os:"",ol:"",ua:"",je:"", //screen cd:"",h:"",w:"", //document cs:"",dm:"",r:"",url:"",pg:"",tt:"",rd:"", //need ks:"",se:"" }, //const doc:document,l:window.location,n:window.navigator,scr:window.screen, //search engines se:"ok365",qu:"k", //根据国内搜索引擎使用情况,将使用最多的放前面,待整理 //根据iwebchoice搜素排行进行编辑 seq:[{d:"baidu",q:"wd"},{d:"google",q:"q"},{d:"soso",q:"w"},{d:"sogou",q:"query"}, {d:"yahoo",q:"p"},{d:"ok365",q:"k"},{d:"msn",q:"q"},{d:"aol",q:"query"}, {d:"aol",q:"encquery"},{d:"lycos",q:"query"},{d:"ask",q:"q"},{d:"altavista",q:"q"}, {d:"netscape",q:"query"},{d:"cnn",q:"query"},{d:"looksmart",q:"qt"}, {d:"about",q:"terms"},{d:"mamma",q:"query"},{d:"alltheweb",q:"q"},{d:"gigablast",q:"q"}, {d:"voila",q:"rdata"},{d:"virgilio",q:"qs"},{d:"live",q:"q"}, {d:"alice",q:"qs"},{d:"yandex",q:"text"},{d:"najdi",q:"q"},{d:"aol",q:"q"}, {d:"club-internet",q:"query"},{d:"mama",q:"query"},{d:"seznam",q:"q"},{d:"search",q:"q"}, {d:"wp",q:"szukaj"},{d:"onet",q:"qt"},{d:"netsprint",q:"q"},{d:"google.interia",q:"q"}, {d:"szukacz",q:"q"},{d:"yam",q:"k"},{d:"pchome",q:"q"},{d:"kvasir",q:"searchExpr"}, {d:"sesam",q:"q"},{d:"ozu",q:"q"},{d:"terra",q:"query"},{d:"nostrum",q:"query"}, {d:"mynet",q:"q"},{d:"ekolay",q:"q"},{d:"search.ilse",q:"search_for"}], //function init:function(pid) { //if(this.l.protocol != "http" && this.l.protocol != "https") //return false; this.TI.pid = pid; this.TI.hs = this.l.hash; this.TI.ho = this.l.host; this.TI.hn = this.l.hostname; this.TI.hr = this.l.href; this.TI.pn = this.l.pathname; this.TI.pt = this.l.port; this.TI.pc = this.l.protocol; this.TI.s = this.l.search; this.TI.an = this.n.appName; this.TI.av = this.n.appVersion; this.TI.bl = this.n.language ? this.n.language : this.n.browserLanguage; this.TI.ce = this.n.cookieEnabled; this.TI.os = this.n.platform; this.TI.ol = this.n.systemLanguage ? this.n.systemLanguage : ""; this.TI.ua = this.n.userAgent; this.TI.je = this.n.javaEnabled(); this.TI.cd = this.scr.colorDepth; this.TI.h = this.scr.height; this.TI.w = this.scr.width; this.TI.cs = this.doc.characterSet ? this.doc.characterSet : this.doc.charset; this.TI.dm = this.doc.domain; this.TI.r = this.doc.referrer; //this.TI.rd;这个值在getSe()中赋值了 this.TI.url = this.doc.URL; this.TI.pg = this.getPg(this.TI.url); this.TI.tt = this.doc.title; this.getSe(); return true; }, track:function() { var sb = new StringBuilder(); //根据PID,链接不同的Server地址 var server = "http://tasweb.ok365.com/tas.aspx?"; sb.append(server); for (var p in this.TI) { sb.append(p); sb.append("="); sb.append(escape(this.TI[p])); sb.append("&"); } //document.write(sb.toString()); var img = new Image(); img.src = sb.toString(); }, getPg:function(url) { if(url) { var searchPos = url.indexOf("?"); if(searchPos >= 0) { return url.substr(0, searchPos); } else { return url; } } else { return ""; } }, t:function (d) { var a = 1, c = 0, g, o; a = 0; for (g = d.length - 1; g >= 0; g--) { o = d.charCodeAt(g); a = (a << 6 & 268435455) + o + (o << 14); c = a & 266338304; a = c != 0 ? a ^ c >> 21 : a; } return a; }, getSe:function() { //this.TI.r = "http://baidu.com/?q=fdsa&wd=fds&df"; if(this.TI.r && this.TI.r.indexOf("?") > 0) { var startPos = this.TI.r.indexOf("//") + 2; var endPos = this.TI.r.indexOf("/", startPos); var rDomain = "";//记录搜索引擎域名 if(endPos > startPos) rDomain = this.TI.r.substr(startPos, endPos - startPos); else rDomain = this.TI.r.substr(startPos, this.TI.r.length - startPos); var hn = rDomain.toLowerCase(); this.TI.rd = hn; //流量来源于自身,则直接返回 if(this.TI.hn.indexOf(hn.replace(/^www\./, "")) >= 0) { this.TI.ks = ""; this.TI.se = ""; return; } if(hn.indexOf("baidu.com") == 0 || hn.indexOf(".baidu.com") > 0 || hn.indexOf("baidu.cn") == 0 || hn.indexOf(".baidu.cn") > 0 || hn.indexOf("baidu.com.cn") == 0 || hn.indexOf(".baidu.com.cn") > 0) { this.TI.se = 1; } else if(hn.indexOf("baidu.") == 0 || hn.indexOf(".baidu.") > 0) { this.TI.se = 2; } else if(hn.indexOf("cn.yahoo.com") == 0 || hn.indexOf(".cn.yahoo.com") > 0) { this.TI.se = 3; } else if(hn.indexOf("yahoo.") == 0 || hn.indexOf(".yahoo.") > 0) { this.TI.se = 4; } else if(hn.indexOf("google.cn") == 0 || hn.indexOf(".google.cn") > 0) { this.TI.se = 5; } else if(hn.indexOf("google.") == 0 || hn.indexOf(".google.") > 0) { this.TI.se = 6; } else if(hn.indexOf("ok365.") == 0 || hn.indexOf(".ok365.") > 0) { this.TI.se = 7; } else { this.TI.se = 99; } for (var s in this.seq) { var seqi = this.seq[s]; if(hn.indexOf("." + seqi.d + ".") > 0 || hn.indexOf(seqi.d + ".") == 0) { var q_startPos = this.TI.r.indexOf(seqi.q + "="); var q_length = (seqi.q + "=").length; if(q_startPos > 0) { var q_endPos = this.TI.r.indexOf("&", q_startPos); if(q_endPos > q_startPos) { this.TI.ks = this.TI.r.substr(q_startPos + q_length, q_endPos - q_startPos - q_length); } else { this.TI.ks = this.TI.r.substr(q_startPos + q_length, this.TI.r.length - q_startPos - q_length); } break; } } } } else { this.TI.ks = ""; this.TI.se = ""; } } }; function StringBuilder() { this._arr = new Array(); if(typeof(StringBuilder._initialized == "undefined")) { StringBuilder.prototype.append = function(str) { this._arr.push(str); } StringBuilder.prototype.toString = function() { return this._arr.join(""); } StringBuilder._initialized = true; } }