var __rq_id;
if(!__rq_id)__rq_id=Math.random().toString().substr(3);
_ebay={srcs:[],page_id:'',id:1}
_adurl_="http://dfp.eachnet.com/display.php";
send_url='http://http.eachnet.com';

//function _out_(s){
//	var c='';try{c=unescape(_tomok.getc(_tomok.getc('GLOBAL_COOKIE_NAME_USRONLYID')+'PRD_CLS_LASTUSE'));}catch(e){};
//	document.write('<script src="'+_adurl_+'?request_id='+__rq_id+'&_user='+_tomok.getc('GLOBAL_COOKIE_NAME_USRLOGINID')+'&'+s+'&_class='+c+'"><\/script>');
//}

//function _out2_(s){
//	var c='';try{c=unescape(_tomok.getc(_tomok.getc('GLOBAL_COOKIE_NAME_USRONLYID')+'PRD_CLS_LASTUSE'));}catch(e){};
//	return '<script src="'+_adurl_+'?request_id='+__rq_id+'&_user='+_tomok.getc('GLOBAL_COOKIE_NAME_USRLOGINID')+'&'+s+'&_class='+c+'"><\/script>';
//}

function _out_(s){
	var c='';try{c=unescape(_tomok.getc(_tomok.getc('loginname')+'PRD_CLS_LASTUSE'));}catch(e){};
	var d='';try{d=unescape(_tomok.getc(_tomok.getc('usgd')+'PRD_CLS_LASTUSE'));}catch(e){};
	document.write('<script src="'+_adurl_+'?request_id='+__rq_id+'&_user='+_tomok.getc('loginname')+'&'+s+'&_gender='+_tomok.getc('usgd')+'&_class='+c+'"><\/script>');
}

function _out2_(s){
	var c='';try{c=unescape(_tomok.getc(_tomok.getc('loginname')+'PRD_CLS_LASTUSE'));}catch(e){};
	var d='';try{d=unescape(_tomok.getc(_tomok.getc('usgd')+'PRD_CLS_LASTUSE'));}catch(e){};
	
	return '<script src="'+_adurl_+'?request_id='+__rq_id+'&_user='+_tomok.getc('loginname')+'&'+s+'&_gender='+_tomok.getc('usgd')+'&_class='+c+'"><\/script>';
}

var __t_ver='1800';
_tomok.getc=function(nc){
	var s=document.cookie.split('; ');
	for(var i=0;i<s.length;i++){
		var n=s[i].split('=');
		if(n[0]==nc){
			return n[1];
		}
	}
	return '';
}
function _tomok (id,obj){
	var info=obj;
	var sp='!';
	var codecrc=1156672103;
	var max_time=1800;
	var bad_data=0;
	var _a={};
	var log_='';
	var is_load=0;
	var run=function(){
		if(bad_data){return false;}
		if(is_load==1)return;
		is_load=1;
		var s;
		try{
			s=mkurl();
		}catch(e){
			s=send_url+'?&error='+escape(e);
		}
		document.write("<img style='display:none;' src='"+s+"'>");
	}
	CRC32.VERSION = 1.0;
	CRC32.table = new Array(256);
	for (var n = 0; n < 256; n++) {
		var c = n;
		for (var k = 0; k < 8; k++) {
			if (c & 1)
			c = -306674912 ^ ((c >> 1) & 0x7fffffff);
			else
			c = (c >> 1) & 0x7fffffff;
		}
		CRC32.table[n] = c;
	}
	function CRC32() { }
	CRC32.getCRC = function (str){
		var crc = 0xFFFFFFFF;
		var k,i,c;
		for(i=0;i<str.length;i++){
			c=str.charCodeAt(i);
			k = (crc ^ c) & 0xFF;
			crc = ( (crc >> 8) & 0x00FFFFFF ) ^ CRC32.table[k];
		}
		return ~crc;
	}
	function mkurl(){
		var s=url=t=crc='';
		for(t in _a){if(_a[t]=='')continue;s+=(t+'='+encodeURIComponent(_a[t])+'&');}
		if(send_url.indexOf('?')!=-1)url=send_url+'&'+s;else url=send_url+'?'+s;
		url=url.replace('\?','?crc='+CRC32.getCRC (url.substr(url.indexOf('?')+1))+'&');
		return url;
	}
	function CookieInfo(nc){
		var sp='!';
		var cookies=['client_key','all_pv','users','start_time','user_stay_time','last_time','current_pv','user_fouse_time','user_fouse_count','last_close_page','ad','adt','src','srct'];
		var mapinfo={};
		var data=[];
		for(i=0;i<cookies.length;i++){mapinfo[cookies[i]]=i;data[i]='';}
		function setStr(str){
			var i=str.lastIndexOf(sp);
			var crc=str.substr(i+1);
			var ta=str.substr(0,i);
			data=ta.split(sp);
			if(CRC32.getCRC(ta)!=crc){
				return 0;
			}
			return 1;
		}
		function getStr(){
			var s='';
			for(i=0;i<cookies.length;i++){
				if(undefined==data[i] || 'undefined'==data[i])data[i]='';
				s=s+data[i]+sp;
			}
			s=s+CRC32.getCRC(s.substr(0,s.length-1));
			return s;
		}
		function setValue(name,value){
			if(isNaN(mapinfo[name])){
				return;
			}
			data[mapinfo[name]]=value;
			savec();
			return value;
		}
		function clear(name){
			setValue(name,0);
		}
		function getValue(name){
			if(isNaN(mapinfo[name])){
				return '';
			}
			return data[mapinfo[name]];
		}
		function savec(){
			document.cookie=nc+'='+getStr()+';expires='+(new Date((new Date()).valueOf()+86400000000)).toGMTString()+";path=/;domain="+function(){var a = document.domain.split('.');if(a.length>=2) {return a[a.length-2]+'.'+a[a.length-1];}else {return document.domain;}}();
		}
		if(nc && nc.length>0){
			setStr(_tomok.getc(nc));
		}
		function len(){return cookies.length};
		function k(i){return cookies[i]};
		this.len=len;
		this.k=k;
		this.clear=clear;
		this.getValue=getValue;
		this.setValue=setValue;
		this.getStr=getStr;
	}
	function getTime(){
		return parseInt((new Date()).getTime()/1000);
	}
	function toint(v){
		v=parseInt(v);
		if(isNaN(v))return 0;return v;
	}
	function newid(){
		var t=i='',s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
		for(;i<9;i++)t+=s.charAt(parseInt(Math.random()*62));
		return t;
	}
	function getCookieInfo(pKey) {
		var raw_cookie = document.cookie;
		var raw_cookie_array = raw_cookie.split(';');
		var cookie_array = new Array();
		for(var i = 0;i < raw_cookie_array.length;i++) {
			var tmp = raw_cookie_array[i].split('=');
			cookie_array[tmp[0]] = tmp[1];
		}
		return (pKey!='')?cookie_array[' '+pKey]:cookie_array;
	}
	if(id=='' || !parseInt(id)){
		bad_data=1;
		return false;
	}
	else{
		_a['id']=id;
	}
	var c=_tomok.c=new CookieInfo('each_'+_a['id']);
	if(!c.getValue('client_key'))c.setValue('client_key',newid());

	if(info['send']){send_url=info['send'];delete info['send'] }
	var ext='';
	_a['v']=__t_ver;
	_a['url']=CRC32.getCRC(location.toString());
	_a['z']=0-(new Date()).getTimezoneOffset()/60;
	_a['rf']=document.referrer;
	var l='!';
	_a['sc']=(window.screenLeft!==undefined ?window.screenLeft: window.screenX)+l+(window.screenTop!==undefined ? window.screenTop: window.screenY)+l+screen.width+l+screen.height+l+screen.colorDepth+l+screen.availWidth+l+screen.availHeight;
	_a['ct']=getTime();

	all_pv=	toint(c.getValue('all_pv'));
	if(isNaN(all_pv))all_pv=0;
	c.setValue('all_pv',1+all_pv);
	if(getTime()-toint(c.getValue('last_time'))-toint(c.getValue('start_time'))>max_time){
		c.setValue('users',toint(c.getValue('users'))+1);
		info['exit_page']=c.getValue('last_close_page');
		var k=['user_stay_time','last_time','current_pv','user_fouse_time','user_fouse_count','last_close_page'];
		for(var t in k){
			c.setValue(k[t],'');
		}
	}
	function ec(s){
		var rs = s;
		if(window.navigator.userAgent.indexOf("MSIE")>-1 && rs.indexOf('%')==-1) {
			rs = encodeURIComponent(rs);
		}
		return rs;
	}
	function upc(ad){
		info['isenter']=1;
		if(c.getValue('ad') != ad) {
			c.setValue('srct',getTime());
			c.setValue('ad',ad);
		}
	}
	if(toint(c.getValue('start_time'))==0){
		c.setValue('start_time',getTime());
	}
	if(location.toString().match(new RegExp('srcid=([^!:|&]+)','img'))){
		info['lastsrc']= ec(RegExp.$1);
		c.setValue('src',info['lastsrc']);
	}
	var s1=location.toString(),s2=document.referrer;
	if(s1.match(new RegExp('adid=([^!:|&]+)','img'))){
		ad=ec(RegExp.$1);
		info['lastad']=ad;
		upc(ad);
	}else {
		if(s2.match(new RegExp('http://www.google.cn/search')) || s2.match(new RegExp('http://www.google.com/search'))) {
			if(s2.match(new RegExp('ie=([^&]*)','img'))){
				  var google_encode = RegExp.$1;
				  
			  }//end if

            else{
		   
		          var google_encode = "utf-8";   		   
				}			
			s2.match(new RegExp('q=([^&]*)','img'));
			var google_key = RegExp.$1;
			ad = 'nsgoogle_ns_00_0_'+ google_encode +'_'+google_key;
			upc(ad);
		}else if(s2.match(new RegExp('http://search.yahoo.com/search'))) {
			s2.match(new RegExp('p=([^&]*)','img'));
			var yahoo_key = RegExp.$1;
			ad = 'nsyahoo_ns_00_0_0_'+yahoo_key;
			upc(ad);
		}else if(s2.match(new RegExp('http://www.baidu.com/s')) || s2.match(new RegExp('http://www.baidu.com.cn/s')) || s2.match(new RegExp('http://www.baidu.cn/s'))) {			
			
			if(s2.match(new RegExp('ie=([^&]*)','img'))){
				  var baidu_encode = RegExp.$1;
				  
			  }//end if

            else{
		   
		          var baidu_encode = "gb2312";   		   
				}
						
			var key_list = new Array("wd","word","w"); 
			for(var   key   in   key_list){   
			  var key_type=key_list[key];
			  if(s2.match(new RegExp(key_type+'=([^&]*)','img')))
			  {
				  var baidu_key = RegExp.$1;				 
				  ad = 'nsbaidu_ns_00_0_'+ baidu_encode +'_'+baidu_key;
				  upc(ad);
				  break;
			  }//end if
		   }// end for			
		}
	}
	if(location.toString().match(new RegExp('_gid=([^!:|&]+)','img'))){
		var _gid=ec(RegExp.$1);
		if(_gid != '') {
			var gmvpath = getCookieInfo('gmvpath');
			if(typeof gmvpath != 'undefined' && gmvpath != '') {
				var tmp_arr = gmvpath.split(',');
				if(tmp_arr[tmp_arr.length - 1] != _gid) {
					gmvpath += ','+_gid;
				}
			}else {
				gmvpath = _gid;
			}
			document.cookie = 'gmvpath='+gmvpath+';'+";path=/;domain="+function(){var a = document.domain.split('.');if(a.length>=2) {return a[a.length-2]+'.'+a[a.length-1];}else {return document.domain;}}();
			info['gmvpath']=gmvpath;
		}
	}
	if(info.uid != '' && typeof info.uid != 'undefined') {
		document.cookie = 'gmvpath=;'+";path=/;domain="+function(){var a = document.domain.split('.');if(a.length>=2) {return a[a.length-2]+'.'+a[a.length-1];}else {return document.domain;}}();
	}
	if(undefined != info['srcs'] && info['srcs'].join ){
		info['srcs']=info['srcs'].join('.');
	}
	c.setValue('last_time',getTime()-toint(c.getValue('start_time')));
	c.setValue('current_pv',1+toint(c.getValue('current_pv')));
	var adt = getTime() - c.getValue('srct');
	c.setValue('adt', adt);
	_a['c']=c.getStr();
	if(document.cookie==''){
		_a['c']='';
	}
	var t=this.constructor.toString();
	info['u']=_tomok.getc('GLOBAL_COOKIE_NAME_USRLOGINID');
	for(var i in info){
		if('id'!=i && i!='send')ext=ext + i+':'+info[i]+sp;
	}
	_a['ext']=ext;
	_a['log']=log_;
	_a['uid']=info.uid?info.uid:'';
	_a['counter']=info.counter?info.counter:'';
	var win={lock:0,lock2:0,t:0,h:0,start:0,time:0};
	win.onblur=function(){
		if(win.lock2)return;
		win.lock2=1;
		win.t++;
		(window.clearInterval(win.h));
		win.h=0;
		win.lock2=0;
	}
	win.ti=function(){
		win.time=win.time+getTime()-win.start;
		win.start=getTime();
	}
	win.focus=function(){
		if(win.h>0)return ;
		if(win.lock==1)return;
		win.lock=1;
		win.start=getTime();
		win.h=window.setInterval(win.ti,1000);
		win.lock=0;
	}
	win.unload=function(){
		_tomok.c.setValue('last_close_page',escape(location.toString()));
		_tomok.c.setValue('user_fouse_time',win.time);
		_tomok.c.setValue('user_fouse_count',win.t);
		_tomok.c.setValue('user_stay_time',getTime()-_tomok.c.getValue('start_time')-_tomok.c.getValue('last_time'));
	}
	if(window.addEventListener){
		window.addEventListener('focus',win.focus,false);
		window.addEventListener('blur', win.onblur,false);
		window.addEventListener('unload', win.unload,false);
	}else{
		window.attachEvent('onfocus',win.focus,false);
		window.attachEvent('onblur',win.onblur,false);
		window.attachEvent('onunload',win.unload,false);
	}
	this.newid=newid;
	this.run=run;
}
var __si;
function _count(info){
	if(__si==1)return ;
	try{var t=new _tomok(info.id,(info));t.run();}catch(e){};
	__si=1;
	//if(_ebay.id == 2 || _ebay.id == 4)return;
	//var push_num = 10;
	//if(Math.ceil(Math.random()*push_num)==1){
		//try{
			//document.write('<script type="text/javascript" src="http://eachnet.wrating.com/a1.js"></script>');
			//document.write('<script type="text/javascript" src="http://image.eachnet.com/js/bm.js"></script>');
			//document.write('<noscript><img src="http://eachnet.wrating.com/a.gif?c=860010-2010010100" width="1" height="1"/></noscript>');
		//}catch(e){}
	//}
}
