/**********************
单坐席浮动图标
调用例子:
<script>
var host="192.168.1.23:10054";
var position='left';//浮动位置(左/右)
var callno='9001001001';//号码
var adurl='ad.adcall.com.cn';//网址
var imgselect=0;//是否自定义图标
var img="1.jpg";//图标
var imgtxt='admin';//图标提示
var top=120;//图标距离顶部位置
</script>
<script src='http://code.adcall.com.cn/service/float_1.js' charset='gb2312'></script>
********************/
var host;
var callno;
var imgtxt;
var position;
var adurl;
var img;
var imgurl;
var imgselect;
var top;
var isnum;
if(typeof(host)== "undefined")
	host="218.104.166.243";
host="http://"+host;

if(typeof(position)== "undefined")	
	position="left";
if(typeof(adurl)== "undefined")
	adurl="www.adcall.cn";
if(typeof(callno)== "undefined")	
	callno="";
if(typeof(imgtxt)== "undefined")	
	imgtxt="点击呼叫,免费通话.";
else
	imgtxt=decodeURI(imgtxt);
if(typeof(top)== "undefined")	
	top=120;
if(typeof(img)== "undefined")	
	imgurl="http://www.0538.cn/images/download.jpg";
else
	imgurl="http://www.0538.cn/images/download.jpg";
if(typeof(isnum)== "undefined")	
	isnum=1;
function setCookie(name,value){ 
	var Days = 60; //cookie 将被保存两个月 
	var exp = new Date(); //获得当前时间 
	exp.setTime(exp.getTime() + Days*24*60*60*1000); //换成毫秒 
	document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString(); 
} 

function getCookie(name){ 
	var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)")); 
	if(arr != null) 
	return unescape(arr[2]); 
	return null; 

} 

function delCookie(name){ 
	var exp = new Date(); //当前时间 
	exp.setTime(exp.getTime() - 1); 
	var cval=getCookie(name); 
	if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString(); 
}
var msg="请输入您的电话号码";
if(getCookie("cbnum")!=null)
{
	msg=getCookie("cbnum");
}
function clear_num(i)
{
	if(i.value=="请输入您的电话号码")
		i.value="";
	i.style.color="#cb3c2d";
}

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;}suspendcode="<DIV id=\"master_call\" style='";if(position=="right")suspendcode +="right:10px;";else suspendcode +="left:10px;";suspendcode +="cursor:hand;height:100px;width:190px;'><div style='height:100px;width:190px;padding-top:6px;background-image:url("+imgurl+");font-weight:800;  font-size: 12px; color: #f6ea67; filter: DropShadow(Color=#213C63, OffX=1, OffY=1); padding-top:6px; padding-left:15px; letter-spacing:3px;'  onClick=\"window.open('"+host+"/WebCall/WebCall.jsp?wid="+callno+"&surl="+adurl+"','','width=480,height=420')\">"+imgtxt+"</div>";if(isnum==1)suspendcode +="";suspendcode +="</div>";document.write(suspendcode);window.setInterval("heartBeat()",1);heartBeat();function adcall_checkCB(){	if (document.cb.cb_num.value==""){alert("请输入您的电话号码");return false;}if (isNaN(document.cb.cb_num.value) && document.cb.cb_num.value.indexOf("-")==-1){alert("电话号码只能输入数字");return false;}setTimeout("document.cb.cb_sub.disabled=false;",8000);	setTimeout("document.cb.cb_num.disabled=false;",8000);}
