function getPageCharset(){
    var charSet = "";
    if(typeof document.charset == "undefined") {
    	charSet=document.characterSet;
    } else {
    	charSet=document.charset;
    }
    return charSet;
};
function getBrowser(){
    var oType = "";
    if(navigator.userAgent.indexOf("MSIE")!=-1){
        oType="IE";
    }else if(navigator.userAgent.indexOf("Firefox")!=-1){
        oType="FIREFOX";
    }
    return oType;
};
function getUA() {
	return escape(navigator.userAgent);
};
function getLanguage() {
	var lan = "";
	if(typeof navigator.userLanguage == "undefined") {
		lan = navigator.language;
	} else {
		lan = navigator.userLanguage;
	}
	return lan;
};
function getTitle() {
	return escape(document.title);
};
function getWinSize() {
	return screen.width+"x"+screen.height;
};

function getQuDao() {
	var Url=top.window.location.href;
	var u,g,ca='';
	u=Url.split("?");
	if (u.length==1) g='';
	else g=u[1];
	if(g!=''){ 
	 	gg=g.split("&"); 
	 	var MaxI=gg.length; 
	 	var str = "ca="; 
	 	for(i=0;i<MaxI;i++){ 
	 		if(gg[i].indexOf(str)==0) { 
	 			ca=gg[i].replace(str,""); 
	 			break; 
			}
		}
	}
	return ca;
};
function getLTime() {
	var d = new Date();
	return d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate()+"|"+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
};
function getSessionID() {
	var jsid = document.cookie.match(new RegExp("(^| )JSESSIONID=([^;]*)(;|$)"));
	if(jsid != null && jsid.length>=1) {
		return unescape(jsid[2]);
	}
}
function getScreenColor() {
	v = navigator.appName;
	if(v != "Netscape")//颜色深度
	{
	c = screen.colorDepth;
	} else {
	c = screen.pixelDepth;
	}
	return c;
};
function getHerf() {
	return window.location;
};
function getSourceHref() {
	var f = "";//来源页面
	if (typeof(pp_frames) != "undefined")
	if (pp_frames)
	  f = top.document.referrer;
	if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	if (document["parent"] != null) 
	  if (parent["document"] != null) // ACCESS ERROR HERE!
	  if (parent.document["referrer"] != null) 
	    if (typeof(parent.document) == "object")
	      f = parent.document.referrer; 
	if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	if (document["referrer"] != null) 
	  f = document.referrer;
	if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	f = "";
	return unescape(f);
};
function mousePosition(ev){
	ev = ev || window.event;
	if(ev.pageX || ev.pageY){
		return {x:ev.pageX, y:ev.pageY};
	}
	return {
		x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
		y:ev.clientY + document.body.scrollTop - document.body.clientTop
	};
};
function anch(ev) {
	var s = mousePosition(ev);
	alert("x:"+s.x);
};
(function(){
	var pc=getPageCharset,
		bt=getBrowser,
		lan=getLanguage,
		tit=getTitle,
		ws=getWinSize,
		sc=getScreenColor,
		lh=getHerf,
		sh=getSourceHref,
		ua=getUA,
		qd=getQuDao,
		time=getLTime;
	var p=new Array();
	p.push("?pc=");
	p.push(pc());
	p.push("&bt=");
	p.push(bt());
	p.push("&vuid=");
	p.push("");
	p.push("&lan=");
	p.push(lan());
	p.push("&ws=");                                                      
	p.push(ws());
	p.push("&sc=");
	p.push(sc());
	p.push("&lh=");
	p.push(lh());                                                                       
	p.push("&sh=");
	p.push(sh());
	p.push("&ua=");
	p.push(ua());
	p.push("&qd=");
	p.push(qd());                                                                                                  
	p.push("&time=");
	p.push(time());                                                                                              
	//var img=document.createElement("img");
	//img.setAttribute("src", "http://dc.ctmus.cn/1.gif"+p.join(""));
	//document.documentElement.firstChild.appendChild(img);
})();
