


var  ss =new Date().getTime() ;
var kf_openurl_float="http://chat.5251.net/client.jsp?companyId=14494&style=31917&username=&locate=cn" +"&refer="+ escape(window.location.href);
var companyId = 14494;
//路径
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  kf_ss  =  now___.getTime() 

var temp_d = parseInt(Math.random() *10000);
var user_str = "" + kf_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;

var isIE8 = window.navigator.userAgent.indexOf("MSIE 8") > 0;
var showStr = "";

if( !isIE8 )
{//ie8
	showStr += "<iframe   style='position:absolute;z-index:8001;width:expression(this.nextSibling.offsetWidth);height:expression(this.nextSibling.offsetHeight);top:expression(this.nextSibling.offsetTop);left:expression(this.nextSibling.offsetLeft);' frameborder='0' ></iframe>";
}
showStr +="<div id=\"kf_5251\" style=\"z-index:8001;position:absolute;width:auto;height:auto;top:10px;left:10px;margin:0 0 0\" >";


	showStr += "<table  onmousedown='startDrag(this)' onmouseup='stopDrag(this)' onmousemove='drag(this)' width=\"auto\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"kf_5251_table\" style=\"background:transparent;\">";

  showStr += "<tr>";
    showStr += "<td height=\"17\">";
	showStr += "<div id=\"kf_5251_head\" style=\"width:auto;MARGIN:0px; height:15px; border:#006699 1px solid; border-bottom:none; background:url(http://img.5251.net/etel/image/bj04.jpg); line-height:16px;\">";
	   showStr += "<div style=\"width:17px; height:16px;MARGIN:0px; cursor:move; margin-left:5px; float:left;\">";
	   
			showStr += "<img src=\"http://img.5251.net/etel/image/image1.jpg\" width=\"17\" height=\"16\" />";
		
	   showStr += "</div><div style=\"width:auto; MARGIN:0px;height:14px; float:left; cursor:move; line-height:14px;margin-left:6px;\">";
	  
	    showStr += "<img src=\"http://img.5251.net/etel/image/image2.jpg\" width=\"64\" height=\"13\" />";
		 showStr +="</div>";
	
			showStr += "<div style=\"width:8px; height:8px; margin:3px; float:right;\"><img onclick='hidden_float_div()' style='cursor:hand;' width=\"8\" height=\"8\" src='http://img.5251.net/etel/image/icon06.png'/></div>";
			
	
	showStr +="</div>"
	showStr += "</td></tr></table>";

showStr += "<div  style=\"width:auto; height:auto; MARGIN:0px;border:#006699 1px solid; background:#B4DCEF;\" id=\"kf_5251_body_top\" >";
     showStr += "<div style=\"width:auto; height:auto;MARGIN:0px; border:#FFFFFF 2px solid; background:url(http://img.5251.net/etel/image/bj03.jpg) repeat-y; margin:1px;\">";
	    showStr += "<div style=\"width:auto;MARGIN:0px; height:auto;background:url(http://img.5251.net/etel/image/bj03.jpg) repeat-y; margin-top:4px;margin-bottom:4px;\" align=\"center\">";

		   showStr += "<table  id=\"kf_5251_body\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"background:transparent;\" >";
		   

		  showStr += "<tr><td height=\"16\" colspan=\"3\"align=\"center\" valign=\"middle\" background=\"http://img.5251.net/etel/image/bj02.jpg\"><span class=\"STYLE_51kf_12b\">&#x9500;&#x552e;&#x90e8;&#x95e8;</span></td></tr>";
		  
						  showStr += "<tr style=\"cursor: pointer;\" onclick=\"open_chat_person(14494)\"><td height=\"18\" align=\"left\" valign=\"middle\" noWrap=\"1\" style=\"background:transparent;\"><span class=\"STYLE_51kf_1O\"><span class=\"STYLE_51kf_12\">2828w </span></span></td><td noWrap=\"1\" style=\"background:transparent;\"><span class=\"STYLE_51kf_1O\"><img src=\"http://img.5251.net/etel/image/icon03.jpg\" width=\"14\" height=\"10\" /></span></td><td style=\"background:transparent;\" nowrap><span class=\"STYLE_51kf_12\">&#x7559;&#x8a00;</span> </td></tr>";
						

	showStr += "<tr><td height=\"26\" colspan=\"3\" style=\"cursor: pointer;\" onclick=\"open_chat()\" align=\"center\" valign=\"middle\"><img src=\"http://img.5251.net/etel/image/icon06.gif\" width=\"88\" height=\"24\" /></td> </tr>";
	
  
showStr += "</table>";
showStr += "</div></div></div></div>";

showStr += "<style type=\"text/css\">";
showStr += "<!--\n";
showStr += "#kf_5251 div{overflow:visible;}\n";
showStr += "#kf_5251 table {margin:0;}\n";
showStr += "#kf_5251 tr td{vertical-align:middle;}\n";
showStr += "#kf_5251 img {margin:0;border:0px;}\n";
showStr += "#kf_5251 span a {text-decoration:none}\n";

showStr += ".STYLE_51kf_1O {font-family: \"宋体\";font-size: 10px;vertical-align:center;}\n";
showStr += ".STYLE_51kf_11 {font-size: 11px;vertical-align:center;}\n";
showStr += ".STYLE_51kf_12 {font-size: 12px; color: #000066;vertical-align:center;}\n";
showStr += ".STYLE_51kf_offline {font-size: 12px; color: #6E6E6E;vertical-align:center;}\n";
showStr += ".STYLE_51kf_12 a:link {font-size: 12px; color: #000066; ;vertical-align:center;text-decoration:none;}\n";
showStr += ".STYLE_51kf_12 a:visited {font-size: 12px; vertical-align:center;color: #000066; text-decoration:none;}\n";
showStr += ".STYLE_51kf_12b {font-family: \"宋体\"; vertical-align:center;font-size: 12px; color: #000066; font-weight: bold; }\n";
showStr += "-->\n</style>";






var alignx_float = 1;
var alignW_float =10;
var alignH_float =10;
var old_alignW = alignW_float;

var screen_width =  window.screen.availWidth;
var screen_hight = window.screen.availHeight;

alignLeft = alignW_float;

var re = "top:"+ alignH_float +"px;left:"+alignLeft+"px;"
//top:10px;left:10px;
if(alignx_float == 2)
{
	re = "top:"+ alignH_float +"px;left:" + (screen_width - alignLeft - 110) +"px;"
}
showStr = showStr.replace("top:10px;left:10px;",re);
document.write(showStr);
//alert(document.getElementById("kf_5251").offsetWidth);
document.getElementById("kf_5251_head").style.width = document.getElementById("kf_5251").offsetWidth+"px";
if(document.getElementById("kf_5251_body_top") && (document.getElementById("kf_5251_body_top").offsetWidth > 500))
{
	document.getElementById("kf_5251_body_top").style.width = (document.getElementById("kf_5251_table")?document.getElementById("kf_5251_table").offsetWidth:(document.getElementById("kf_5251_head").offsetWidth+2)) + "px";
}
var ofloatip = document.getElementById("kf_5251");
var onload_float_Interval = window.setInterval(showKf,500);
var scrollChang = false;
var x0=0,y0=0,x1=0,y1=0,w0=0,h0=0,w1=0,h1=0;
var offx=6,offy=6,offw=6,offh=6;
var moveable=false,sizeable=false;
var hover='orange',normal='#EFF5FF',normalBorder='#79A7E2';//color;'#336699'
var index=10000;//z-index;

var KFcount = 0
function showKf()
{
	if(moveable)
	return;

	var body_width = document.getElementById('kf_5251_body').offsetWidth ;

	var body_left = document.getElementById('kf_5251_body').offsetLeft ;

	var head_width = document.getElementById('kf_5251_head').style.width ;
	//document.getElementById('kf_5251_head').style.width = 
	if(body_width +16 < 115)
		document.getElementById('kf_5251_head').style.width =115;
	else
		document.getElementById('kf_5251_head').style.width =body_width +16;

		
		
		var diffY = document.documentElement.scrollTop;	
		var diffX = document.documentElement.scrollLeft ;
			
		if(diffY==0)
		{		
			diffY = document.body.scrollTop;
		}
		
		if(diffX==0)
		{		
			diffX = document.body.scrollLeft;
		}


		if (self.innerHeight) { // all except Explorer 
		screen_width = self.innerWidth; 
		screen_hight = self.innerHeight; 
		} 
		else if (document.documentElement && document.documentElement.clientHeight) { 
		// Explorer 6 Strict Mode 
		screen_width = document.documentElement.clientWidth; 
		screen_hight = document.documentElement.clientHeight; 
		} else if (document.body) { // other Explorers 
		screen_width = document.body.clientWidth; 
		screen_hight = document.body.clientHeight; 
		} 


	
	ofloatip.style.top = diffY + alignH_float + "px" ;
	

	try{
	
		if(document.getElementById("aotu").style.display == "" || document.getElementById("aotu").style.display == "block" )
		{
			var auto_top = document.getElementById("aotu").style.top
			var auto_width = document.getElementById("aotu").offsetWidth
			var auto_hight = document.getElementById("aotu").offsetHeight
			if(typeof(auto_hight)=="undefined")
			auto_hight = 125;
			if(companyId == 6789) 
			{
				auto_hight -= 140;
			}
			document.getElementById("aotu").style.top = diffY + ( screen_hight  ) / 2 - (auto_hight)/2 + "px" ;

			if (document.all) 
			document.getElementById("aotu").style.left =   screen_width/2  - auto_width/2 + "px";

			
		}
	}
	catch(e){};
	

	if(ofloatip.style.display == "none")
	ofloatip.style.display = "";

	
	scrollChang = false;
	KFcount++;

	
}
function open_chat()
{
	var chat_win= window.open(kf_openurl_float,'chat_14494','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_14494','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){}
}

function open_tel_chat(wiseid,seat)
{
    var etel_url = "http://etel.5251.net/etel/dial.jsp?wiseid=" + wiseid + "&seat=" + seat +"&com_name=%E5%88%9B%E6%84%8F%E9%9F%B3%E4%B9%90%E7%9B%92%E6%89%B9%E5%8F%91%E7%BD%91";
;
	var win = window.open(etel_url,'e_tel_chat','height=473,width=703,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no');
	win.focus();
	
}

function hidden_float_div()
{	
	document.getElementById("kf_5251").style.display="none";
	try{clearInterval(onload_float_Interval);}catch(e){}
}



//开始拖动;
function startDrag(obj)
{
  if(event.button==1)
  {
    //锁定标题栏;
    obj.setCapture();
    //定义对象;
    var win = obj.parentNode;
   // var sha = eval("bg"+win.id);//win.nextSibling;
    //记录鼠标和层位置;
    x0 = event.clientX;
    y0 = event.clientY;
    x1 = parseInt(win.style.left);
    y1 = parseInt(win.style.top);
    //记录颜色;
    normal = obj.style.backgroundColor;
    //改变风格;
    obj.style.backgroundColor = '#FFEED3';//hover; 
    win.style.borderColor = hover;
    moveable = true;
  }
}
//拖动;
function drag(obj)
{
  if(moveable)
  {
    var win = obj.parentNode;
	change(win,y1 + event.clientY - y0,x1 + event.clientX - x0,0,0);
	
	
  }
}
//停止拖动;
function stopDrag(obj)
{
  if(moveable)
  {
    var win = obj.parentNode;
   // var sha = eval("bg"+win.id);//win.nextSibling;

    var msg = obj.nextSibling;
    win.style.borderColor     = "#79A7E2";//normal;
    obj.style.backgroundColor = normal;
    msg.style.color           = "#000000"//normal;

	obj.releaseCapture();
	//layout(obj);
    moveable = false;

	var diffY = document.body.scrollTop;	
	var diffX = document.body.scrollLeft; 
	if(diffY==0)
	{
		diffY = document.documentElement.scrollTop;	
		diffX = document.documentElement.scrollLeft;
	}

	alignH_float = ofloatip.offsetTop - diffY;
	alignW_float = ofloatip.offsetLeft - diffX
	//alert(diffX);
	//alert(alignW);
  }
}

function change(obj,top,left,width,height){
	//var sha = eval("bg"+obj.id);//obj.nextSibling;
	if (width!=0){
		obj.style.width=width;
		sha.style.width=width+6;

		var tmptitle=eval("idtitle"+obj.id);
		tmptitle.style.width=width-2*1;
		var tmptitlespan=eval("idspan"+obj.id);

		tmptitlespan.style.width=width-2*12-10;
		var tmpcon=eval("idcon"+obj.id);
		tmpcon.style.width=width-2*1;
	}
	if(height!=0){
		obj.style.height=height;
		//sha.style.height=height+6;

		var tmpcon=eval("idcon"+obj.id);
		tmpcon.style.height=height-20;
	}
	if(top!=0){
		obj.style.top=top;
		//sha.style.top=top-3;	
	}
	if(left!=0){
		obj.style.left=left;
		//sha.style.left=left-3;			
	}
	if (width!=0)
	{

		//改变信息宽度
		var tpmCou=parseInt((width-15)/fontWith)+1;
		//alert(tpmCou);
		var tmpA = obj.getElementsByTagName("A");
		var strttmpAs="";

		for (var i=0;i<tmpA.length;i++)
		{
			strttmpAs=tmpA[i].title;
			if (strttmpAs!="")
			{
				//alert(tpmCou);
				tmpA[i].innerText=strttmpAs.substr(0,tpmCou);
			}
			
	}
	}
}

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=14494&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);
}




