-function(){
		var w = window,ws = window.screen,d = document,dc = d.cookie,dr = d.referrer,dm=d.domain,na = navigator,ua = na.userAgent.toLowerCase(),url = location.href.split('?')[0],c,
			en = encodeURIComponent,ids=[],id,
			browerObj = {
				'360se':'360se',
				'TT':'tencenttraveler',
				'Maxthon':'maxthon',
				'GreenBrowser':'greenbrowser',
				'Sogou':'se 1.x / se 2.x',
				'TheWorld':'theworld'

			},
			// which brower
			isB = function(){
				var r;
				for(var p in browerObj){
					if(ua.indexOf(browerObj[p])>-1)
						return p;
				}
				r = ua.match(/(msie|chrome|safari|firefox)/)[0];
				if(r=='msie'){
					r = ua.match(/msie[^;]+/)
				}
				return r;
			},
			hash = function (s) {
		        var h = 0,
		        g = 0;
		        for (var i = s.length - 1; i >= 0; i--) {
		            var c = parseInt(s.charCodeAt(i));
		            h = ((h << 6) & 0xfffffff) + c + (c << 14);
		            if ((g = h & 0xfe00000) != 0) h = (h ^ (g >> 21))
		        }
		        return h
		    },
		    getGuid = function () {
		        var s = [na.appName, na.version, na.language || na.browserLanguage, na.platform, na.userAgent, ws.width, 'x', ws.height, ws.colorDepth, d.referrer].join(""),
		        k = s.length,
		        o = history.length;
		        while (o > 0) s += o--^k++;
		        return (Math.round(Math.random() * 2147483647) ^ hash(s)) * 2147483647
		    },
		    getC = function (){
		    	var c = dc.match(/count=(\d+)/);
		    	return (c&&c[1]?c[1]:0)*1+1;
		    }
		c = getC();
		d.cookie = "count="+c+";path=/;expires=" + new Date(+new Date + 3600*1000*24).toGMTString();
		id = dc.match(/sessionID=([^;]+)/);
		if(!id||!id[1]){
			id = [hash(dm),getGuid(),+new Date+ Math.random()+Math.random()].join('.');
			d.cookie = "sessionID="+id+";path=/;expires=" + new Date(+new Date + 3600*1000*24).toGMTString();
		}else{
			id = id[1];
		}
		url = /\.(s?htm|php)/.test(url)?url:(url.replace(/\/$/,'')+'/index.html');
		function clk(e){
			e = e || event;
			var t = e.target||e.srcElement,contId,img
			for(var i=0,ci;ci=ids[i++];){
				if(ci.contains?ci.contains(t):!!(ci.compareDocumentPosition(t) & 16)){
					contId = ci.id;break;
				}
			}
			var a = new Image(1,1);
			if(/^(A|IMG)$/.test(t.tagName)){
				if(t.tagName=='IMG'){
					img = t;
					t = t.parentNode;
					if(t.tagName!='A')return;
					
				}
				a.src = 'http://haostat.qihoo.com/haoclk.gif?t='+ +new Date +'&u='+en(url)+"&f="+en(t.href)+"&c="+en(img?img.src.match(/[^\/]+$/):t.innerHTML)+'&cId='+contId;
			};
			if(t.tagName=='INPUT'&&t.type=='submit'){
				while(t=t.parentNode){
					if(t.tagName=='FORM'){
						a.src = 'http://haostat.qihoo.com/haoclk.gif?t='+ +new Date +'&u='+en(url)+"&f="+en(t.action)+"&c=form:"+(t.name||t.id)+'&cId='+contId;
						break;
					}
				}
				
			};
		}
		d.attachEvent?d.attachEvent('onclick',clk):d.addEventListener('click',clk,false);
		moniter = {
			getTrack:function(a){
				d.write('<img src="http://haostat.qihoo.com/haopv.gif?b='+isB()+'&a='+(a===undefined?1:a)+'&u='+en(url)+'&id='+id+'&c='+ c+'&r='+en(dr)+'&t='+ +new Date+'" style="display:none;width:1px;height:1px;" />' )
				return this;
			},
			setId:function(a){
				for(var i=0,ci;ci=a[i++];){
					ci = document.getElementById(ci);
					ci&&ids.push(ci);
				}
			}
		}   
	}()
