function lp_stat(){ this.domain = "https://biz.www.sqrdapp.com/"; this.lp_ckpre = 'stat_'; this.lp_ckpat = '/'; this.xmlHttp = null; this.Try = { these: function() { var returnValue; for (var i = 0; i < arguments.length; i++) {var lambda = arguments[i]; try {returnValue = lambda(); break;} catch (e) {}} return returnValue; } } this.init = function(){ var today_time = this.today_endttime()-86400000; var today_endtime = this.today_endttime(); var s = '&fsv='+this.get_falsh_version()+';'+this.get_screen()+';'+this.get_site_url()+';'+this.get_ref(); s += '&sys=bWlkPTUmaXRlbWlkPTEzNTQxMCZ1c2VybmFtZT1qaWVrZWxhYnMmdG91c2VybmFtZT0='; var nuvtime = this.gck('nuvtime'); if(!nuvtime){ this.sck('nuvtime',new Date().getTime(),new Date().getTime()+365*60*60*24*1000); s += '&nuv=1'; } var uvtime = this.gck('uvtime'); if(!uvtime){ this.sck('uvtime',new Date().getTime(),today_endtime); s += '&uv=1'; } img_src = this.domain+'api/stat/stat.php?'+s setTimeout('_img = new Image;_img.src=img_src;', 0); } this.today_endttime = function(){ var o = new Date(); o.setHours(23); o.setMinutes(59); o.setSeconds(59); o.setMilliseconds(999); return o.getTime(); } this.get_falsh_version = function() { if (navigator.plugins && navigator.mimeTypes.length) { var b = navigator.plugins["Shockwave Flash"]; if (b && b.description) return b.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s)+r/, ".") } else if (_Zya_("msie") && !window.opera) { var c = null; try { c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7") } catch(e) { var a = 0; try { c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); a = 6; c.AllowScriptAccess = "always" } catch(e) { if (a == 6) return a.toString() } try { c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash") } catch(e) {} } if (c != null) { var a = c.GetVariable("$version").split(" ")[1]; return a.replace(/,/g, ".") } } return "0" } //分辨率 this.get_screen = function() { var s = window.screen; return s.width + "x" + s.height; } //中文替换 this.zh_replace = function (s) { if (!s) return ""; str = s.replace(/[\u4E00-\u9FA5]/ig, "x"); return str; } //当前网址 this.get_site_url = function () { var s; try { s = window.top.document.location.href; } catch(e) { s = document.location.href; }; if (s) { return escape(this.zh_replace(s)) } else { return ""; }; } //来源 this.get_ref = function () { var r; try { r = window.top.document.referrer; } catch(e) { r = document.referrer; }; if (r) { return escape(r) } else { return ""; }; } this.makeRequest = function (queryString, php, func, method) { this.xmlHttp = this.Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ); method = (typeof method == 'undefined') ? 'post' : 'get'; if(func) xmlHttp.onreadystatechange = eval(func); this.xmlHttp.open(method, method == 'post' ? php : php+'?'+queryString, true); this.xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); this.xmlHttp.send(method == 'post' ? queryString : null); } this.sck = function (n, v, s) { var e = ''; e = new Date(s); e = "; expires=" + e.toGMTString(); document.cookie = this.lp_ckpre + n + "=" + v + ((this.lp_ckpat == "") ? "" : ("; path=" + this.lp_ckpat)) + e; } this.gck = function (n) { var v = ''; var s = this.lp_ckpre + n + "="; if(document.cookie.length > 0) { o = document.cookie.indexOf(s); if(o != -1) { o += s.length; end = document.cookie.indexOf(";", o); if(end == -1) end = document.cookie.length; v = unescape(document.cookie.substring(o, end)); } } return v; } this.dck = function (n) {var e = new Date((new Date()).getTime() - 1 ); e = "; expires=" + e.toGMTString(); document.cookie = this.lp_ckpre + n + "=" + escape("") +";path=/"+ e;} } var lp = new lp_stat(); lp.init();