function getCookie(name)
{
	var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
	if(arr=document.cookie.match(reg)) return unescape(arr[2]);
	else return null;
}
function getReseveKey(){
				if(typeof reseveKey != 'undefined' && reseveKey!=null) return reseveKey;
				var cKey = getCookie("reseveKey");
				if(cKey!=null&&cKey.length!=0) return cKey;
				return null;
}
function openDoyooCustomChat(t) {
	//alert('t');
	//下面url地址是接入地址,域名需要根据实际情况进行修改，其中c是公司ID
	var url = "http://chat.doyoo.net/WebModule/chat/p.do?c=26700&f=54012";
	
	//现在param中的参数n指客服ID，当指定这个参数后，Web CallCenter的系统会根据这个值接通到指定客服人员
	//这里的参数据可以修改为g，g指客服分组ID，当指定这个参数后，Web CallCenter的系统会根据这个值接通到指定客服分组


	//这里是分组模式接通代码。
	if(	t!= null &&  t.length != 0 )
		url +="&g=" + t;
	
	//下面是取乐语系统的一些标识信息
	var sid = getCookie("DOYOO_VISITOR_ID");
	var cid = getCookie("DOYOO_USER_ID");
	
	if(sid!=null)
		url +="&v=" + sid;
	if(cid !=null)
		url +="&u=" + cid;

	//取自定义传送的数据
	var reseKey = getReseveKey();
	
	if(reseKey!=null)
		url=url+"&r="+encodeURIComponent(reseKey);
	
	url=url+"&loc="+encodeURIComponent(document.location.href);
		
	var param = "height=460,width=690,directories=no," + "location=no,menubar=no," + "resizeable=no,status=no,toolbar=no,top=100,left=200";
	//弹出窗口
	var acceptWin = window.open(url,"", param);
	
}
