function $2(z){return document.getElementById(z);}
/*  在线客服图片滚动功能开始*/
function initKefu()
{
	//  窗口调整事件
	window.onresize=function(){resizeKefu();}
	//  滚动条事件
	window.onscroll=function(){resizeKefu();}
}
function resizeKefu()
{
	var d = new Date();
	var s = (d+"").match(/\d{2}:\d{2}:\d{2}/g);
	if(("06".indexOf(d.getDay()+"")!=-1)||s<"09:00:00"||s>"18:00:00"){
		var nod = $2("kf").childNodes;
		for(var i=0;i<nod.length;i++){
			if(nod[i].nodeName.toLowerCase()=="img"){
				setTimeout(function(){nod[i].src="http://home.baihui.com/home/app/aboutimages/k5.gif";},10);
				if(navigator.appName=="Microsoft Internet Explorer"){nod[i].onclick=function(){window.open('http://service.baihui.com/chat1.html');}}
				else{try{nod[i].onclick=function(){window.open('http://service.baihui.com/chat1.html');}}catch(e){};}
				break;
			}
		}
	}
	var h = _getScrollXY().y;
	$2("kf").style.top=(136+h)+"px";
    $2("kf").style.display="block";
	var l = _getScrollWH().w;
	if(l>990)$2("kf").style.left=(990+(l-990)/2-20)+"px";
}
function _getScrollXY(){
	var x,y;
	if(document.body.scrollTop){
	  x=document.body.scrollLeft;
	  y=document.body.scrollTop;
	}
	else{
	  x=document.documentElement.scrollLeft;
	  y=document.documentElement.scrollTop;
	}
	return {x:x,y:y};
}
function _getScrollWH(){
	var w,h;
	if(document.body.scrollTop){
	  w=document.body.clientWidth;
	  h=document.body.clientHeight;
	}
	else{
	  w=document.documentElement.clientWidth;
	  h=document.documentElement.clientHeight;
	}
	return {w:w,h:h};
}
initKefu();
resizeKefu();