_jyt = { push: function(category,action,lable,value) { addEvent(category,action,lable,value); } } function jyt_siteid(){ return ; } function jyt_lenovo_id(){ var lenoid = ""; return lenoid; } function jyt_page_type(){ return ""; } function jyt_ref(){ //来源 return document.referrer; } function jyt_language(){ //页面的语种 return window.navigator.systemLanguage || window.navigator.language; } function jyt_rand(){ //随机数 return Math.floor(2147483648 * Math.random()); } function jyt_href(){ //当前地址 return window.location.href; } function jyt_agent(){ //浏览器信息 return window.navigator.userAgent; } function jyt_iscookie(){ //是否支持cookie return window.navigator.cookieEnabled; } function jyt_cookie_len(){ //cookie的长度 return document.cookie.length; } function jyt_host(){ //地址端口号 return window.location.host; } function setCookie(cookieName,cookieValue,cookieExpires,cookiePath) { cookieValue = escape(cookieValue);//编码latin-1 if(cookieExpires=="") { var nowDate = new Date(); nowDate.setMonth(nowDate.getMonth()+6); cookieExpires = nowDate.toGMTString(); } if(cookiePath!="") { cookiePath = ";Path="+cookiePath; } document.cookie= cookieName+"="+cookieValue+";expires="+cookieExpires+cookiePath; } //获取cookie function getCookieValue(cookieName) { var cookieValue = document.cookie; var cookieStartAt = cookieValue.indexOf(""+cookieName+"="); if(cookieStartAt==-1) { cookieStartAt = cookieValue.indexOf(cookieName+"="); } if(cookieStartAt==-1) { cookieValue = null; } else { cookieStartAt = cookieValue.indexOf("=",cookieStartAt)+1; cookieEndAt = cookieValue.indexOf(";",cookieStartAt); if(cookieEndAt==-1) { cookieEndAt = cookieValue.length; } cookieValue = unescape(cookieValue.substring(cookieStartAt,cookieEndAt));//解码latin-1 } return cookieValue; } function deleteCookie(name, path) { if(getCookieValue(name)) { document.cookie = name + "=" + ((path) ? ";path=" + path : "") + ";expires=Thu,01-Jan-1970 00:00:01 GMT"; } } //生成当前时间 var now = (new Date).getTime(); //1.获取ltime,如果存在则用ltime - 当前时间; //把时间存储在cookie当中,命名为ltime; var ltime = getCookieValue("ltime"); var lenid = getCookieValue("lenovo_id"); //if(lenid == null && null != jyt_lenovo_id()){ //在客户端种cookie // setCookie("lenovo_id",,"","/"); //} if(ltime != null){ //得到前一个页面的停留时间 var rtime = now - ltime; if(rtime > (3600 * 1000)){ rtime = 60 * 1000; } //清空ltime deleteCookie("ltime","/"); } setCookie("ltime",now,"","/"); var c = []; c.push("siteid=" + jyt_siteid()); c.push("leno=" + jyt_lenovo_id()); c.push("page_type=" + jyt_page_type()); c.push("r=" + encodeURIComponent(jyt_ref())); c.push("page=" + encodeURIComponent(jyt_href())); c.push("agent=" + encodeURIComponent(jyt_agent())); c.push("rnd=" + jyt_rand()); c.push("rtime=" + rtime); c.push("event=" + jyt_page_type()); function addEvent(category,action,lable,value){ // alert("http://202.85.219.247:82/ad/monitorEvent.php?" + c.join("&") + "&ev=click&ei=" + encodeURIComponent( category + '|' + action + '|' + lable + '|' + value)); (new Image()).src="http://118.178.182.12/monitor/ad/monitorEvent.php?" + c.join("&") + "&ev=click&ei=" + encodeURIComponent(encodeURIComponent( category + '|' + action + '|' + lable + '|' + value)) + "&ra=" + jyt_rand(); } function init(){ heavyImage = new Image(); heavyImage.src = "http://118.178.182.12/monitor/ad/monitorStayTime.php?" + c.join("&"); heavyImage.onload = function(){ }; } init();