/**********************
客服通浮动图标
调用例子:
<script>

var host="http://192.168.1.23:10054";
var KF_ID='';//客服通分配的ID号
var KF_URL='';//网站地址
var KF_ADCALL='';//ADCALL号码
var KF_IS_QQ=0;//是否显示QQ,0不显示,1显示
var KF_QQ="";//QQ号码
var KF_CODE="";//客服登录号码
var KF_D="9001001011";//底部使用ADCALL号码
var LiveReceptionCode_ToRight=1;//说明：浮动图标的水平方向对齐方式，1为右对齐，0为左对齐；
var LiveReceptionCode_helpimgleft=0;//说明：浮动图标的水平方向的边距；
var LiveReceptionCode_ToBottom=0;//说明：浮动图标的垂直方向对齐方式，1为底部对齐，0为顶部对齐；
var LiveReceptionCode_helpimgtop=50;//说明：浮动图标的垂直方向的边距；
</script>
<script src='http://code.adcall.com.cn/service/float_7.js' charset='gb2312'></script>
********************/
<!--
if(typeof(host)== "undefined")
	host="http://code.adcall.com.cn";
var urlServer="http://manage.adcall.com.cn";

var KF_ID;
if(typeof(KF_ID)== "undefined")	
	KF_ID='';
var KF_URL;
if(typeof(KF_URL)== "undefined")	
	KF_URL='http://www.adcall.com.cn';
var KF_IS_QQ;
if(typeof(KF_IS_QQ)== "undefined")	
	KF_IS_QQ=0;
	
var KF_CODE;
if(typeof(KF_CODE)== "undefined")	
	KF_CODE='';
var KF_ADCALL;
if(typeof(KF_ADCALL)== "undefined")	
	KF_ADCALL='';
	
var KF_QQ;
if(typeof(KF_QQ)== "undefined")	
	KF_QQ='';
var KF_D;//底部使用ADCALL号码
if(typeof(KF_D)== "undefined")	
	KF_D='';
//客户通域名
var KF_URL;
if(typeof(KF_DOMAIN)== "undefined")	
	KF_DOMAIN='kft.zoosnet.net';

//请修改以下参数
var LiveReceptionCode_ToRight;
//说明：浮动图标的水平方向对齐方式，1为右对齐，0为左对齐；
if(typeof(LiveReceptionCode_ToRight)== "undefined")	
	LiveReceptionCode_ToRight=1;
	
var LiveReceptionCode_helpimgleft;
//说明：浮动图标的水平方向的边距；
if(typeof(LiveReceptionCode_helpimgleft)== "undefined")	
	LiveReceptionCode_helpimgleft=0;

var LiveReceptionCode_ToBottom;
//说明：浮动图标的垂直方向对齐方式，1为底部对齐，0为顶部对齐；
if(typeof(LiveReceptionCode_ToBottom)== "undefined")	
	LiveReceptionCode_ToBottom=0;

var LiveReceptionCode_helpimgtop;
//说明：浮动图标的垂直方向的边距；
if(typeof(LiveReceptionCode_helpimgtop)== "undefined")	
	LiveReceptionCode_helpimgtop=50;

var LR_List_w;  //列表框的宽度，需要和三张图片的宽度一至[像素]
if(typeof(LR_List_w)== "undefined")	
	LR_List_w=113;

var LR_List_left;  //列表框中部里面文字距离左边的距离[像素]
if(typeof(LR_List_left)== "undefined")	
	LR_List_left=10;

var LR_List_lineheight;  //列表框中部里面文字的行高[像素]
if(typeof(LR_List_lineheight)== "undefined")	
	LR_List_lineheight=19;
	
var LR_List_upimg= host + '/images/kft/bar_t1.gif';//列表框顶部的图片网址
var LR_List_downimg=host + '/images/kft/bar_t3.gif';//列表框底部的图片网址
var LR_List_bgimg=host + '/images/kft/bar_t2.gif';//列表框中部的平铺背景图片
var LR_List_qqimg=host + '/images/kft/qq_icon.gif';//列表框中部的平铺背景图片

function TheAdCall(kf,no ,qq)
{
    //客服
    this.kf = kf;
    //adcall
    this.no = no;
    //qq
    this.qq = qq; 
}

if(KF_ADCALL.indexOf(",")!=-1)
{
	KF_ADCALL=KF_ADCALL.split(",");
}
else
{
	KF_ADCALL=KF_ADCALL.split("/");
}

if(KF_QQ.indexOf(",")!=-1)
{
	KF_QQ=KF_QQ.split(",");
}
else
{
	KF_QQ=KF_QQ.split("/");
}
if(KF_CODE.indexOf(",")!=-1)
{
	KF_CODE=KF_CODE.split(",");
}
else
{
	KF_CODE=KF_CODE.split("/");
}


var KF_ADCALL_LIST=new Object();
if(KF_CODE.length>0)
{
	for(i=0;i<KF_CODE.length;i++)
	{
		var no="",qq="";
		if(KF_ADCALL.length>i)
			no=KF_ADCALL[i];
		if(KF_QQ.length>i)
			qq=KF_QQ[i];
		KF_ADCALL_LIST[KF_CODE[i]]=new TheAdCall(KF_CODE[i],no,qq);
	}
}

//请修改下面的代码里的文本内容，如 "在线" "繁忙" "发送给" "的留言" 等
function outputOperatorlist(name,friendname,state)
{
	var f_adcall_no = "";
	var f_adcall_qq = "";
	var f_var="";
	if(typeof(KF_ADCALL_LIST[name]) != 'undefined')
	{
			f_adcall_no =KF_ADCALL_LIST[name].no;
			f_adcall_qq =KF_ADCALL_LIST[name].qq;
	}
	else
		return "";

	if(state>=3)
	{
		f_var = '<tr><td height="'+LR_List_lineheight+'"></td><td style="font-size:12px;padding:5px 0;line-height:18px; border-bottom:1px solid #CCC;" align="center"><b><font style="FONT-SIZE: 12px;COLOR: #333333;">'+unescape(friendname.replace(/\+/g,'%20'))+'</font></b><br>[<a href="javascript:openZoosWindow_olist(\'chatwin\',\'&oname='+name+'\')" target="_self"><font style="FONT-SIZE: 12px;COLOR: red;">在线洽谈</font></a>]';
		if(KF_IS_QQ==1 && f_adcall_qq!='')
			f_var +=  '<br><a target=blank href=tencent://message/?uin='+f_adcall_qq+'&Site=www.adcall.com.cn&Menu=yes style=\"text-decoration:none; color:#1B6194\"><img border=\"0\" SRC=\"'+ LR_List_qqimg + '\" alt=\"点击这里QQ在线交谈\" align=\"absmiddle\">&nbsp;QQ交谈</a>';
		f_var +=  '</td></tr>';
	}
	else if(state==2)
	{
		var e=escape('发送给'+unescape(name.replace(/\+/g,'%20'))+'的留言');
		f_var = '<tr><td height="'+LR_List_lineheight+'"></td><td style="font-size:12px;COLOR:#333333" align="center">'+unescape(friendname.replace(/\+/g,'%20'))+'<br>[<a href="#"  onclick="return false;" target="_self"><font style="FONT-SIZE: 12px;COLOR: purple;" onclick=openZoosWindow_olist(\'sendnote\',\'&e='+name+'\')>繁忙</font></a>]</td></tr>';
	}
	else if(state==1)
	{
		var e=escape('发送给'+unescape(name.replace(/\+/g,'%20'))+'的留言');
		f_var = '<tr><td height="'+LR_List_lineheight+'"></td><td style="font-size:12px;" align="center">'+unescape(friendname.replace(/\+/g,'%20'))+'<br>[<a href="#"  onclick="return false;" target="_self"><font style="FONT-SIZE: 12px;COLOR: blue;" onclick=openZoosWindow_olist(\'sendnote\',\'&e='+name+'\')>离开</font></a>]</td></tr>';
	}
	else if(state==0)
	{
		var e=escape('与'+unescape(name.replace(/\+/g,'%20'))+'免费通话');
		f_var = '<tr><td height="'+LR_List_lineheight+'"></td><td style="font-size:12px;padding:5px 0;line-height:18px; border-bottom:1px solid #CCC;" align="center"><b><font style="FONT-SIZE: 12px;COLOR: #333333;">'+unescape(friendname.replace(/\+/g,'%20'))+'</font></b>';
		if(f_adcall_no!='')
			f_var +=  '<br>[<a href="javascript:void(0);" onClick="window.open(\'http://manage.adcall.com.cn/WebCall/WebCall.jsp?wid='+f_adcall_no+'&surl='+KF_URL+'\',\'\',\'width=480,height=420\')"><font style="FONT-SIZE: 12px;COLOR: red;">免费电话</font></a>]';
		else
			f_var +='<br>[<a href="javascript:openZoosWindow_olist(\'chatwin\',\'&oname='+name+'\')" target="_self"><font style="FONT-SIZE: 12px;COLOR: red;">在线洽谈</font></a>]';
		
		if(KF_IS_QQ==1 && f_adcall_qq!='')
			f_var += '<br><a target=blank href=tencent://message/?uin='+f_adcall_qq+'&Site=www.adcall.com.cn&Menu=yes style=\"text-decoration:none; color:#1B6194\"><img border=\"0\" SRC=\"'+ LR_List_qqimg + '\" alt=\"点击这里QQ在线交谈\" align=\"absmiddle\">&nbsp;QQ交谈</a>';
		f_var +=  '</td></tr>';
	}
	return 	f_var;
}

lastScrollY=0;
function heartBeat()
{
	var diffY;
	if (document.documentElement && document.documentElement.scrollTop)
		diffY = document.documentElement.scrollTop;
	else if (document.body)diffY = document.body.scrollTop;
	else{/*Netscape stuff*/}
	percent=.1*(diffY-lastScrollY); 
	if(percent>0)percent=Math.ceil(percent); 
	else percent=Math.floor(percent); 
	document.getElementById("master_call").style.top=parseInt(document.getElementById("master_call").style.top)+percent+"px";lastScrollY=lastScrollY+percent;
}

/*var suspendcode="<DIV id=\"master_call\" style='left:10px;POSITION:absolute;TOP:120px;cursor:hand;'>"*/

var suspendcode="<DIV id=\"master_call\" style='POSITION:absolute;z-index:9999;";
if(parseInt(LiveReceptionCode_ToRight)==1)
	suspendcode +="right:"+LiveReceptionCode_helpimgleft+"px;";
else 
	suspendcode +="left:"+LiveReceptionCode_helpimgleft+"px;";
suspendcode +="TOP:"+LiveReceptionCode_helpimgtop+"px;cursor:hand;'>";

//以下不要修改
 suspendcode+='<table width="'+LR_List_w+'" border="0" cellpadding="0" cellspacing="0" style="font-size:12px;" background="'+LR_List_upimg+'"><tr><td height="33" style="font-weight:bold;font-size:12px; color:#FFF;padding-left:10px;">在线客服&nbsp;&nbsp;&nbsp;<a  onclick=CloseAdCall() shape=circle coords=111,50,12 height="115" style="text-decoration:none"><font size=+2>&nbsp;</font></a></td><td></td></tr><tr><td background="'+LR_List_bgimg+'"><table width="100" border="0" cellspacing="0" cellpadding="0"><tr><td width="'+LR_List_left+'" height="0"></td><td></td></tr>';
 
if(typeof(OperatorArray) != 'undefined')
{
	for(i=0;i<OperatorArray.length;i++)
	{
		suspendcode+=outputOperatorlist(OperatorArray[i].name,OperatorArray[i].friendname,OperatorArray[i].state);
	}
}

suspendcode+='</table></td></tr><tr><td><a href="http://manage.adcall.com.cn/WebCall/WebCall.jsp?wid='+KF_D+'&amp;surl='+KF_URL+'" target=blank><img src="'+LR_List_downimg+'"  width="'+LR_List_w+'" border=\"0\" /></a></td></tr></table></div>';

suspendcode+='</div>';
document.write(suspendcode);
window.setInterval("heartBeat()",1);

function CloseAdCall()
{
	document.getElementById("master_call").style.display='none';
}
//heartBeat();

/*document.write('<scr'+'ipt language="javascript" src="http://'+KF_DOMAIN+'/JS/LsJS.aspx?siteid='+KF_ID+'&lng=cn"></scr'+'ipt>');*/

document.write('<scr'+'ipt language="javascript" src="http://'+KF_DOMAIN+'/JS/LsJS.aspx?siteid='+KF_ID+'&lng=cn"></scr'+'ipt>');



//-->
