

var  ss =new Date().getTime() ;var kf_openurl_float="http://chat.5251.net/client.jsp?companyId=16638&style=36404&username=&locate=cn" +"&refer="+ encodeURIComponent(window.location.href);
var companyId = 16638;

var route = escape(window.location.href);

var kdocTitle = document.title;
if(kdocTitle == null){ 
    var t_titles = document.getElementByTagName("title") 
    if(t_titles && t_titles.length >0) 
    { 
       kdocTitle = t_titles[0]; 
    }else{ 
       kdocTitle = ""; 
    } 
} 

function setCookie(name, value, path, domain) {
  var oCookie = name + "=" + escape(value) +
      "; expires=Thu, 6 Jan 2100 12:01:01 UTC" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "");
  document.cookie = oCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return "";
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

var  now  =  new  Date();  
var  ss  =  now.getTime() 

var temp_d = parseInt(Math.random() *10000);
var user_str = "" + ss + "_" + temp_d;

var userid = getCookie("kf51_userid");
if(userid == "" || userid == null)
{
	
	setCookie("kf51_userid",user_str);
	userid = user_str ;	
}

var ref = document.referrer; 
var local_host = document.domain;
if(ref.indexOf(local_host) < 0)
{
	setCookie("kf51_referrer",ref);
}
kf_openurl_float += "&keyword="+escape(getCookie("kf51_referrer"))+ "&userid="+userid;


function open_chat()
{
	var chat_win= window.open(kf_openurl_float,'chat_16638','height=473,width=703,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no');
	chat_win.focus();
	try{sendAndRecieve("/js/recieve.jsp?state=3&companyId="+companyId+"&sessionId="+userid);}catch(e){}	
}

function open_chat_person(workerid)
{
	var chat_win = window.open(kf_openurl_float+'&workId='+workerid+'&flag=3','chat_16638','height=473,width=703,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no');

	chat_win.focus();
	try{sendAndRecieve("/js/recieve.jsp?state=4&companyId="+companyId+"&sessionId="+userid);}catch(e){}
}


var alignx_float = 1;
var alignH_float =10;
var alignVer = "top";
var alignStr = "left:0px;";
var topStr =  "top:" + alignH_float +"px;";
var screen_height = 0;
var alignVer = "top";
if(window.innerHeight) { 
		screen_height=window.innerHeight;
}else if (document.documentElement && document.documentElement.clientHeight) { 
	screen_height = document.documentElement.clientHeight; 
}else if (document.body) { 
	screen_height = document.body.clientHeight; 
}
var pressImg= 'http://img.5251.net/images/qq_1cn.jpg';

if(alignx_float == 2)
{
	 alignStr = "right:0px;";
}
else
{
	 
	pressImg = 'http://img.5251.net/images/qq_leftcn.jpg';
	
}

if(alignH_float < 0)
{
	topStr = "bottom:0px;";
	alignVer = "bottom";
}
document.writeln("<st"+"yle type=\"text/css\">");
document.writeln(".QQbox{ z-index:7998; width: 178px; "+ topStr +"; position: absolute;"+alignStr+"}");
document.writeln(".QQbox .press{ "+alignStr+" border: none; cursor: pointer;width: 33px; height: 158px;position: absolute;}");
document.writeln(".QQbox .Qlist{ left: 0; width: 145px; background: url(http://img.5251.net/images/qq_listbg.gif) repeat-y -155px 0;  position: absolute;}");
document.writeln(".QQbox .Qlist .b{ float: right; height: 6px; width: 145px; font-size: 1px; }");
document.writeln(".QQbox .Qlist .t{ background: url(http://img.5251.net/images/qq_listbg.gif) no-repeat left; }");
document.writeln(".QQbox .Qlist .b{ background: url(http://img.5251.net/images/qq_listbg.gif) no-repeat right; }");
document.writeln(".QQbox .Qlist .con{ background: #fff; width: 90%; margin: 0px;margin-left:10px;text-align: center; font-size: 12px;font-weight:100;color : #1F1F1F;vertical-align :center;padding-top:0;}");
document.writeln(".QQbox .Qlist .con h2{height: 22px;FLOAT: none;line-height:22px;font-weight:bold;font-size:14px; background: url(http://img.5251.net/images/qq_listbg.gif) repeat-y -163px 0; border: 1px solid #3a708d; text-align: center; color:#fff;margin:0;display:block !important;}");
document.writeln(".QQbox .Qlist .con span{ line-height:18px;}");
document.writeln(".QQbox .Qlist .con ul li{  padding: 5px 0 0 8px;height: 20px; background: #e8e8e8;}");
document.writeln(".QQbox .Qlist .con ul li.odd{ background: #fff; }");
document.writeln(".QQbox img{ display:block; }");
document.writeln("</s"+"tyle>");
document.write("<div class='QQbox' id='divQQbox' >");
document.write("	<div class='Qlist' id='divOnline' onmouseout='hideMsgBox(event);' style='display : none;'>");
document.write("		<div class='t'></div>");
document.write("		<div class='con'>");


						document.write("<h2>&#x5ba2;&#x670d;&#x90e8;</h2>");
			
						document.write("<span style=\"cursor: pointer; color:#747474\" onclick=\"open_chat_person(16638);return false;\" ><b>mlty</b>(&#x70b9;&#x51fb;&#x7559;&#x8a00;)</span>");
						document.write("<br>");
					
						document.write("<span style=\"cursor: pointer; color:#747474\" onclick=\"open_chat_person(23037);return false;\" ><b>&#x5ba2;&#x670d;1</b>(&#x70b9;&#x51fb;&#x7559;&#x8a00;)</span>");
						document.write("<br>");
					
						document.write("<span style=\"cursor: pointer; color:#747474\" onclick=\"open_chat_person(23038);return false;\" ><b>&#x5ba2;&#x670d;2</b>(&#x70b9;&#x51fb;&#x7559;&#x8a00;)</span>");
						document.write("<br>");
					
document.write("</div>");
document.write("<div class='b'></div>");
document.write("</div>");
document.write("<div id='divMenu' onmouseover='OnlineOver();'>");

document.write("<img id='press_img' src='"+pressImg+"' class='press' alt='&#x5728;&#x7ebf;&#x5ba2;&#x670d;'/>");

document.write("</div></div>");

var tips; var theTop = 40;

var old=0;
var tops = 0;
var baseFlag = "none";
function initFloatTips() {
	theTop = document.getElementById('press_img').offsetHeight;
	tips = document.getElementById('divQQbox');
	moveTips();
}
function moveTips() {
	var tt= 5;
	var xFlag = document.getElementById('divOnline').style.display;
	if(alignVer == "bottom" && xFlag != baseFlag )
	{
		tops = (xFlag == "block")?(document.getElementById('divOnline').offsetHeight - theTop):( -tops );
		alignH_float = -1;
	}
	if (window.innerHeight)  diffy = window.pageYOffset;
	else if (document.documentElement && document.documentElement.scrollTop) diffy = document.documentElement.scrollTop;
	else if (document.body)  diffy = document.body.scrollTop;
	var pos =0.1*(diffy - old);
	if(pos>0)pos=Math.ceil(pos); 
	else pos=Math.floor(pos); 
	old = old + pos;
	try{
		if(alignVer == "bottom" && alignH_float < 0)
		{
			alignH_float =0;
			if(baseFlag == xFlag && xFlag== "none")
			{
				tips.style.top = parseInt(screen_height - theTop) + "px";
			}
			else
			{
				tips.style.top = parseInt(tips.offsetTop - tops) +"px";baseFlag = xFlag;
			}
		}
		else 	tips.style.top =  parseInt(pos + tips.offsetTop) + "px" ;
		
		 setTimeout(moveTips,tt);
	}catch(e){}
}
initFloatTips();

function OnlineOver(){
	document.getElementById("divMenu").style.display = "none";
	document.getElementById("divOnline").style.display = "block";
	document.getElementById("divQQbox").style.width = "145px";
}
function OnlineOut(){
	document.getElementById("divMenu").style.display = "block";
	document.getElementById("divOnline").style.display = "none";
}
	function hideMsgBox(theEvent){
		if (theEvent){
			var browser=navigator.userAgent;
			if(browser.indexOf("Firefox")> -1 || browser.indexOf("Opera")> -1){
					if(document.getElementById('divOnline').compareDocumentPosition(theEvent.relatedTarget) == 20) {
						return;
					}
			}
			 if (browser.indexOf("MSIE")>-1){
					 if (document.getElementById('divOnline').contains(event.toElement)) {
						return;
					  }
			  }
	}
	document.getElementById("divMenu").style.display = "block";
	document.getElementById("divOnline").style.display = "none";
 }

 
function y_gVal(iz)
{var endstr=document.cookie.indexOf(";",iz);if(endstr==-1) endstr=document.cookie.length;return document.cookie.substring(iz,endstr);}
function y_g(name)
{var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;var j;while(i<clen) {j=i+alen;if(document.cookie.substring(i,j)==arg) return y_gVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0) break;}return null;}
function cc_k()
{var y_e=new Date();var y_t=31104000000;var yesvisitor=1000*36000;var yesctime=y_e.getTime();y_e.setTime(y_e.getTime()+y_t);var yesiz=document.cookie.indexOf("cck_lasttime");if(yesiz==-1){document.cookie="cck_lasttime="+yesctime+"; expires=" + y_e.toGMTString() +  "; path=/";document.cookie="cck_count=0; expires=" + y_e.toGMTString() +  "; path=/";return 0;}else{var y_c1=y_g("cck_lasttime");var y_c2=y_g("cck_count");y_c1=parseInt(y_c1);y_c2=parseInt(y_c2);y_c3=yesctime-y_c1;if(y_c3>yesvisitor){y_c2=y_c2+1;document.cookie="cck_lasttime="+yesctime+"; expires="+y_e.toGMTString()+"; path=/";document.cookie="cck_count="+y_c2+"; expires="+y_e.toGMTString()+"; path=/";}return y_c2;}}
var yesdata;
yesdata='companyId=16638&userid='+userid+'&refe='+escape(document.referrer)+'&location='+escape(document.location)+'&color='+screen.colorDepth+'x&resolution='+screen.width+'x'+screen.height+'&returning='+cc_k()+'&language='+navigator.systemLanguage+'&ua='+escape(navigator.userAgent)+'&ip=';
var host_stat = document.domain;
var refe_stat = document.referrer;
if(refe_stat == null)refe_stat= "";
var pos = refe_stat.indexOf(host_stat);
if( refe_stat == "" || pos == -1 )
{
	js_src = "http://etel.5251.net/stat.jsp?" +yesdata;
	
	var script=document.createElement("script");
	script.type='text/javascript';
	script.language='javascript';
	script.src=js_src;
	document.getElementsByTagName("head")[0].appendChild(script);
}




