var hcvisitstatUrl = "http://log.b2b.hc360.com/logmanage/log";


var visitproviderid = readCookie("hcproviderid");
	

function createCookie(nm,val,y){
	var exp="";
	if(y){ 
		var dt=new Date(); 
		dt.setTime(dt.getTime()+(y*86400000)); 
		exp="; expires="+dt.toGMTString();
	} 
	document.cookie=nm+"="+escape(val)+exp+";path=/"; 
}

function readCookie(nm){ 
	var m=""; 
	if(window.RegExp){ 
		var re=new RegExp(";\\s*"+nm+"=([^;]*)","i"); 
		m=re.exec(';'+document.cookie); 
	} 
	return(m?unescape(m[1]):"");
}

//记录企业,名片访问记录
function hcVistStat(providerid,infotype,infoid,infoname){
	var urlStr = hcvisitstatUrl + "";
	var visitproviderid = readCookie("newhcproviderid") + "";
	if(visitproviderid==providerid){//过滤自己访问自己的情况
		return;
		}
	if(!visitproviderid==""){
		if(document.images) 
		{
	    (new Image()).src= urlStr +"?providerid="+providerid+"&infotype="+infotype+"&infoid="+infoid+"&infoname="+infoname+"&visitproviderid="+visitproviderid;
	  	}
	}else{
		if(document.images)
		{
	    (new Image()).src= urlStr +"?providerid="+providerid+"&infotype="+infotype+"&infoid="+infoid+"&infoname="+infoname;
	  	}
	}
}

//记录商机,产品访问记录
function hcVistStatInfo(providerid,infotype,infoid,infoname,l3supcatid,supcatid){
	var urlStr = hcvisitstatUrl;
	var visitproviderid = readCookie("newhcproviderid") + "";
	if(visitproviderid==providerid){//过滤自己访问自己的情况
		return;
	}
	
	if(document.images){
   		(new Image()).src= urlStr +"?providerid="+providerid+"&infotype="+infotype+"&infoid="+infoid+"&infoname="+infoname+"&visitproviderid="+visitproviderid+"&l3supcatid="+l3supcatid+"&supcatid="+supcatid;
  	}
}