


var companyId = 15027;
var kf_openurl="http://www.beyonddent.com.cn/beyond_kefu.html?flag=1&companyId=15027&style=33178&locate=cn" +"&refer="+ escape(window.location.href)+"&username="+encodeURIComponent("")+"&conn_word="+encodeURIComponent("");

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 ;	
}

//alert("userid is-->" + getCookie("kf51_userid"));
var ref = document.referrer; 
var local_host = document.domain;
if(ref.indexOf(local_host) < 0)
{
	setCookie("kf51_referrer",ref);
}
kf_openurl += "&keyword="+escape(getCookie("kf51_referrer"));
kf_openurl += "&userid="+userid;
function open_pic_chat()
{
	var chat_win= window.open(kf_openurl,'chat_15027','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="+15027+"&sessionId="+userid);}catch(e){}
}
function open_chat_person(workerid)
{
	var chat_win = window.open(kf_openurl+'&workId='+workerid+'&flag=3','chat_15027','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 is_kf_online = 0;
var kf_workids = "";
var workids = "";
var judge_kf_isonline = function(workerid){
	if(kf_workids.indexOf(","+workerid+",")>-1)return true;
	else return false;
}
var kftype=2;var isonline = 0;var myid="client"; var onliner_id=1;var img_hight = 0;img_width = 0;var hasOpen= false;var closeButton = true;var closeIMG ="http://img.5251.net/images/close.gif";
		var img_on = "http://img.5251.net/upload/2009-12-01/1091121055441_113_111.gif";var img_off = "http://img.5251.net/upload/2009-12-01/1091121056262_113_113.jpg";var alignx = 2;var alignW =1;var  alignH =1;var screen_height = 0;
			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; 
    /*
 * Compressed by JSA(www.xidea.org)
 */
eval("function IconClass(){	this.property=new Array();	this.left=0;	this.top=0;	this.last_left=0;this.last_top=0;	this.diffY=0;	this.diffX=0;	this.diffW=0;this.diffH=0; this.show=\"\";  this.scrollTimer=null;	this.floatHtml=null;	this.dreamsim=null;	this.autoScroll = autoScroll;this.imageTimer=onliner_imageTimer;this.get_tip_str=onliner_get_tip_str;	this.win_open=onliner_win_open;	this.start=onliner_start; this.get_clost_str=onliner_get_close_str; this.hidden=hidden_div;}");
    eval("var isNS6 = (document.getElementById&&!document.all) ? 1: 0;var isIE = (document.all) ? 1: 0;var isNS = (navigator.appName==\"Netscape\" && navigator.appVersion.charAt(0)==\"4\") ? 1: 0; var is_IE8= (navigator.userAgent.indexOf(\"MSIE 8\")>0) ? 1: 0;var isFF = (navigator.userAgent.indexOf(\"Firefox\")>0) ? 1: 0;");

    eval("function autoScroll(){ getImageProperty();try{showKFDiv()}catch(e){};	this.imageTimer();	this.diffY = document.body.scrollTop;	this.diffX = document.body.scrollLeft;	if(this.diffY==0){		this.diffY = document.documentElement.scrollTop;	}	if(this.diffX==0){		this.diffX = document.documentElement.scrollLeft;	}	if(isIE){		this.diffH = document.documentElement.offsetHeight;		this.diffW = document.documentElement.offsetWidth;	}else{		this.diffH = document.body.offsetHeight;		this.diffW = document.body.offsetWidth;	}	if(this.dreamsim.style.top!=(this.diffY+this.property[\"alignH\"])){		var dreamsheight=this.diffY+this.property[\"alignH\"]-this.dreamsim.offsetTop;		this.top=this.dreamsim.offsetTop+dreamsheight;	}	if(this.property[\"alignx\"]==1){		if(parseInt(this.dreamsim.style.left)!=(this.diffX+this.diffW)){			var dreamswidth=this.diffX+this.property[\"alignW\"]-this.dreamsim.offsetLeft;			dreamswidth=(dreamswidth>0?1:-1)*Math.ceil(Math.abs(dreamswidth));			this.left=this.dreamsim.offsetLeft+dreamswidth;		}	}else{		if(parseInt(this.dreamsim.style.left)!=(this.diffX+this.diffW-parseInt(this.dreamsim.style.width)-this.property[\"alignW\"]-20)){			var dreamswidth=this.diffX+this.diffW-parseInt(this.dreamsim.style.width)-this.property[\"alignW\"]-20-this.dreamsim.offsetLeft;			dreamswidth=(dreamswidth>0?1:-1)*Math.ceil(Math.abs(dreamswidth));			this.left=this.dreamsim.offsetLeft+dreamswidth;		}	}	this.dreamsim=document.getElementById(this.property[\"X_P\"]);	if(this.last_top!=this.top || this.last_left!=this.left){		this.last_top=this.top;  		this.last_left=this.left;		this.get_tip_str();		document.getElementById(this.property[\"div_X_P\"]).innerHTML=this.floatHtml;		dreamsim=document.getElementById(this.property[\"X_P\"]);	}	this.imageTimer();}");
   
    //
	/*eval("function onliner_get_tip_str(){	var d=new Date();	var img=\"\";	if (isonline==1) img=this.property[\"img_on\"];	else img=this.property[\"img_off\"];  var tt=\"\"; if(!(is_IE8 || isFF)) tt += \"<iframe   style='position:absolute;z-index:7998;width:expression(this.nextSibling.offsetWidth);height:expression(this.nextSibling.offsetHeight);top:expression(this.nextSibling.offsetTop);left:expression(this.nextSibling.offsetLeft);' frameborder='0' ></iframe>\";  var con_img=\"<img onclick=\\\"icon.win_open()\\\" src=\\\"\"+img+\"\\\" style='cursor:pointer'>\"; 		if(alignx ==2 ){tt += \"<DIV id='\"+this.property[\"X_P\"]+\"' style='z-index:7998;display:\"+this.show+\";right: \"+alignW+\"px; top: \"+this.top+\"px; width:\"+this.property[\"width\"]+\"px;height:\"+this.property[\"height\"]+\"px;overflow:hidden;POSITION: absolute;'>\"+this.get_clost_str()+con_img+\"<!--<div style='POSITION: absolute;top:0px;left:0px;'><input name='close' type='button' id='close' onClick='hidden_div()' value='close' style='margin: 0px;padding: 0px;border: 1px dotted #339900;background-color: #FFFFFF;height: 18px;width: 30px;'></div>--></div>\";}else{tt += \"<DIV id='\"+this.property[\"X_P\"]+\"' style='z-index:7998;display:\"+this.show+\";left:\"+alignW+\"px; top: \"+this.top+\"px; width:\"+this.property[\"width\"]+\"px;height:\"+this.property[\"height\"]+\"px;overflow:hidden;POSITION: absolute;'>\"+this.get_clost_str()+con_img+\"<!--<div style='POSITION: absolute;top:0px;left:0px;'><input name='close' type='button' id='close' onClick='hidden_div()' value='close' style='margin: 0px;padding: 0px;border: 1px dotted #339900;background-color: #FFFFFF;height: 18px;width: 30px;'></div>--></div>\";}	this.floatHtml=tt;}");*/

 eval("function onliner_get_tip_str(){	var d=new Date();	var img=\"\";	if (isonline==1) img=this.property[\"img_on\"];	else img=this.property[\"img_off\"];  var tt=\"\"; if(!(is_IE8 || isFF)) tt += \"<iframe   style='position:absolute;z-index:7998;width:expression(this.nextSibling.offsetWidth);height:expression(this.nextSibling.offsetHeight);top:expression(this.nextSibling.offsetTop);left:expression(this.nextSibling.offsetLeft);' frameborder='0'></iframe>\";  var con_img=\"<img src=\\\"\"+img+\"\\\" border='0'  style='cursor:pointer' onclick=\\\"icon.win_open()\\\" >\"; 		if(alignx ==2 ){tt += \"<DIV id='\"+this.property[\"X_P\"]+\"' style='z-index:7998;display:\"+this.show+\";right: \"+alignW+\"px; top: \"+this.top+\"px; width:\"+this.property[\"width\"]+\"px;height:\"+this.property[\"height\"]+\"px;overflow:hidden;POSITION: absolute;'>\"+this.get_clost_str()+con_img+\"</div>\";}else{tt += \"<DIV id='\"+this.property[\"X_P\"]+\"' style='z-index:7998;display:\"+this.show+\";left:\"+alignW+\"px; top: \"+this.top+\"px; width:\"+this.property[\"width\"]+\"px;height:\"+this.property[\"height\"]+\"px;overflow:hidden;POSITION: absolute;'>\"+this.get_clost_str()+con_img+\"</div>\";}	this.floatHtml=tt;}");

	eval("function onliner_get_close_str(){if (closeButton) return \"<img onclick='icon.hidden()' style='position:absolute; right:7px; top:7px; cursor:hand;' src='" + closeIMG + "'/>\"; return \"\";}");
    eval("function hidden_div(){	this.show=\"none\";document.getElementById(this.property[\"X_P\"]).style.display=\"none\";try{eval( \"clearInterval(icon.scrollTimer);\")}catch(e){}}");
    eval("function onliner_win_open() {hasOpen = true;open_pic_chat()}");
    eval("function onliner_imageTimer(){ if(document.getElementById(this.property[\"div_X_P\"]).innerHTML.indexOf('.gif')==-1 &&         document.getElementById(this.property[\"div_X_P\"]).innerHTML.indexOf('.jpg')==-1 &&         document.getElementById(this.property[\"div_X_P\"]).innerHTML.indexOf('.swf')==-1)    {      this.get_tip_str();      document.getElementById(this.property[\"div_X_P\"]).innerHTML=this.floatHtml;      this.dreamsim=document.getElementById(this.property[\"X_P\"]);    }	}");
    eval("function onliner_start(){	getImageProperty() ; if(alignH < 0){ this.property[\"alignH\"] = screen_height-img_hight;}document.write('<div id=\"'+this.property[\"div_X_P\"]+'\" ></div>');	this.dreamsim=document.getElementById(this.property[\"X_P\"]);}");
  eval("var icon=new IconClass();icon.property[\"onliner_id\"]=onliner_id;");
  eval("icon.property[\"img_on\"]=\""+img_on+"\";");
  eval("icon.property[\"img_off\"]=\""+img_off+"\";");

  eval("function getImageProperty(){ if(img_hight > 0 && img_width > 0) return;var img_tmp = img_off; if (isonline==1)img_tmp = img_on; if(img_tmp.indexOf(\".txt\") > -1) return;if(img_tmp.indexOf(\"10913144096.jpg\") > 0 || img_tmp.indexOf(\"en_offline.gif\") > 0 ){img_hight = 88;img_width = 171;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;};if(img_tmp.indexOf(\"1088215854.gif\") > 0 || img_tmp.indexOf(\"10882158160.gif\") > 0 ){img_hight = 62;img_width = 143;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;};if(img_tmp.indexOf(\"10882158490.gif\") > 0 || img_tmp.indexOf(\"1088215996.gif\") > 0 ){img_hight = 125;img_width = 93;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;};if(img_tmp.indexOf(\"10882157269.gif\") > 0 || img_tmp.indexOf(\"10882156495.gif\") > 0 ){img_hight = 73;img_width = 119;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;};if(img_tmp.indexOf(\"108841759233.gif\") > 0 || img_tmp.indexOf(\"108841759409.gif\") > 0){img_hight = 111;img_width = 82;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;};var pos = img_tmp.indexOf(\"_\"); if( pos > 0 ){var next_pos = img_tmp.indexOf(\"_\",pos+1);img_width=parseInt(img_tmp.substr(pos+1,next_pos));img_hight=parseInt(img_tmp.substr(next_pos+1));icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;}if(companyId==11328){img_hight = 159;img_width = 120;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;}if(companyId==7114){img_hight = 77;img_width = 160;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;return;}var   image=new   Image();if(isonline){image.src='"+img_on+"';}else {image.src='"+img_off+"';}; image.onerror=function(){};if(!image.complete){setTimeout('getImageProperty()',100);return;	};img_hight = image.height;img_width = image.width;icon.property[\"height\"]=img_hight;icon.property[\"width\"]=img_width;}");
//alert("2");
  
  eval("icon.property[\"alignx\"]="+alignx);
  eval("icon.property[\"alignW\"]="+alignW);
  eval("icon.property[\"alignH\"]="+alignH);
  eval("icon.property[\"X_P\"]=\"X_P\";");
  eval("icon.property[\"div_X_P\"]=\"div_X_P\";");
   // alert("3");
  eval("icon.start();");
 // alert("4");
  eval("icon.scrollTimer = window.setInterval(\"icon.autoScroll()\", 500); ");

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






		var work_id=0;



		var kf_openurl_auto="http://www.beyonddent.com.cn/beyond_kefu.html?flag=1&companyId=15027&style=33178&locate=cn" +"&refer="+ escape(window.location.href);
		function set51KfCookie(name, value) 
		{
			//var date =new Date();
			//date.setTime(date.getTime()+1*3600*1000*24);
			//var oCookie = name + "=" + escape(value) + ";expires="+date.toGMTString();
			var oCookie = name + "=" + escape(value);
			document.cookie = oCookie;
		}
		function getTime()
		{
			 var dd=new Date();
			 return Math.floor(dd.getTime()/1000);
		}
		//kf_openurl_auto += "&keyword="+escape(getCookie("kf51_referrer"));
		kf_openurl_auto += "&keyword="+escape(getCookie("kf51_referrer"))+ "&userid="+userid;
		var starttime = getTime();
		var auto_has_show = false;

	//	var auto_self_invite = "";
	//	var auto_self_invite_dialog = ""; 
		var auto_invite_type = "4"; 
		var is_auto_again = "1"; 
		var isonline=0;
		if(getCookie("auto_invite_type") == null || getCookie("auto_invite_type") == "")
		{
			set51KfCookie("auto_invite_type","0");
		}
		if(getCookie("is_auto_again") == null || getCookie("is_auto_again")	== "")
		{
			set51KfCookie("is_auto_again","1");
		}	
		if(  getCookie("auto_invite_type") !=  auto_invite_type  )
		{
			set51KfCookie("is_auto_again","1");
			set51KfCookie("auto_invite_type",auto_invite_type);
		}
	//	is_auto_again = getCookie("is_auto_again");
		is_auto_again = (getCookie("is_auto_again") == "")?"1":getCookie("is_auto_again");
		var time_to_show = 15000;
	
		var auto_agent = window.navigator.userAgent.toLowerCase();   
        var client_kf = {
			 isQuirks:	document.compatMode == 'BackCompat',   
			 isOpera:   auto_agent.indexOf('opera') > -1,   
			 isIE:		auto_agent.indexOf('msie') > -1,   
			 isIE6:      auto_agent.indexOf('msie 6') > -1,    
			 isIE7:		auto_agent.indexOf('msie 7') > -1,  
			 isIE8:      auto_agent.indexOf('msie 8') > -1,   
			 is360:		false
         }; 
		var is360Strict = client_kf.is360 && !client_kf.isQuirks && !client_kf.isIE6;
		var isIE =	client_kf.isIE;
		var isIE8 = client_kf.isIE8;
		var isIE6 =  client_kf.isIE6;
		var host = "http://kf.5251.net"; 
		var img_host = "http://img.5251.net";
		var is_show_source = 1;
		
	function getScreenProperty()
	{
			var kf_screen_p=new Array();
			if(window.innerHeight) { // all except Explorer 
				kf_screen_p.h=window.innerHeight;
				kf_screen_p.w=window.innerWidth;
			} 
			else if (document.documentElement && document.documentElement.clientHeight) { 
			// Explorer 6 Strict Mode 
				kf_screen_p.w = document.documentElement.clientWidth; 
				kf_screen_p.h = document.documentElement.clientHeight; 
			} else if (document.body) { // other Explorers 
				kf_screen_p.w = document.body.clientWidth; 
				kf_screen_p.h = document.body.clientHeight; 
			}
			return kf_screen_p;
	}
	function AutoClass(){
					this.property=new Array();
					this.divAlign='';
					this.top = 0;
					this.left=0;
					this.invite_bj='';
					this.show="block"; 
					this.scrollTimer=null;	
					this.autoTimer=null;
					this.configTimer = null;
					this.show_delay = 0;
			//		this.client_source = "";
					this.get_auto_str = getAutoStr;
					this.floatHtml= '';
					this.autoCssHtml = '';
					this.autoScroll = autoAutoScroll;
					this.start=auto_start;
					this.imgsInit=autoImagesInit;
					this.parsInit=autoParsInit;
					this.sizeConfiger = resizeAutoFrame;
					this.otherConfiger = autoConfiger;
		}
	var lastDiffY = 0;
	var auto = new AutoClass();
	if(is_auto_again == "1" )
	{
		if(companyId == 15168 && window.location.href.indexOf("index.aspx") == -1)
		{
		}
		else
		{
			auto.start();
			auto.autoTimer = window.setTimeout("auto.sizeConfiger()",auto.show_delay);
			if(!is360Strict)auto.scrollTimer = window.setInterval("auto.autoScroll()", 3);
			auto.configTimer = window.setTimeout("auto.otherConfiger()",auto.show_delay+1000);
		}
	}
function getAotu_kf_css(top_css,left_css,show_css)
{
	var cssS= "cursor:move;background:transparent;border:0px #f00 solid;width:auto;MARGIN: 0px;height:auto;top:"+ top_css+"px;left:"+left_css+"px;z-index:8000;display:" + show_css + ";font-size:14px;"
	cssS = (is360Strict)?(cssS + "position:fixed;") : (cssS + "position:absolute;");
	return cssS;
}
function auto_start()
{
	this.imgsInit();
	this.parsInit();
	var kFiframeStr = '<iframe  class="aotu_kf_iframe" frameborder="0"  id="aotu_kf_iframe"></iframe>';
	kFiframeStr+='<div id="aotu_kf" style="'+getAotu_kf_css(this.top,this.left,this.show)+'"';
	if(!is360Strict)
	{
		kFiframeStr += 'onmousedown="dragPanel(this,event, 1)" onmouseup="dragPanel(this,event, 3)" onmousemove="dragPanel(this,event, 2)"';
	}
	kFiframeStr +=' ></div>\n';
	document.write(this.autoCssHtml + kFiframeStr );
	if(isIE8)
	{
		try{
		GetObjFromDoc("aotu_kf_iframe").style.display="none";
		}catch(e){}
	}
	
}
function getAutoStr()
{
	var auto_str = '<div style="background:url('+this.invite_bj+') no-repeat center;border:0px;width:'+this.property["auto_width"]+'px;height:'+this.property["auto_height"]+'px;"><table  width="'+this.property["auto_width"]+'" height="'+(this.property["auto_height"]-4)+'" cellspacing="0"> <tr><td height="'+(this.property["auto_height"]-4)*0.7+'" >&nbsp;</td> </tr><tr><td height="'+(this.property["auto_height"]-4)*0.3+'" align="'+this.divAlign+'" valign="top"><div id="auto_buttonDiv" style="width:230px;border:0px;padding-left:30px;padding-right:30px;overflow:hidden;"><div style="float:left;border:0px; margin-right:20px;"><img src="'+this.property["img_open"]+'" onclick="javascript:'+this.property["img_open_click"]+';" style="cursor:pointer"/></div>';

	

	
	auto_str +='<div style="float:left;"><img src="'+this.property["img_refuse"]+'" onclick="javascript:'+this.property["img_refuse_click"]+';" style="cursor:pointer"/></div>'
	auto_str += '</div></td></tr></table>';
	
	auto_str+='</div>';
	if(client_kf.is360){auto_str = '<TABLE cellSpacing="0" cellPadding="0" bgColor="#666666" border="0"><TBODY><TR><TD height="1"></TD></TR></TBODY></TABLE><TABLE cellSpacing="1" cellPadding="0" border="0"><TBODY><TR><TD ><TABLE cellSpacing="1" cellPadding="0" border="0"><TBODY><TR><TD ><TABLE cellSpacing="0" cellPadding="0" border="0"><TBODY><TR><TD > '+ auto_str+ '     </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>';
	try{GetObjFromDoc("aotu_kf_iframe").style.display="none";}catch(e){}
	}
	this.floatHtml = auto_str;
}
function autoParsInit()
{
	this.divAlign ='right';
	
	this.show_delay = time_to_show;
	var kf_screen_p = getScreenProperty();
	this.property["hor_rate"] = 50/100;
	this.property["ver_rate"] = 50/100;

	this.left  = parseInt((kf_screen_p.w - this.property["auto_width"])*this.property["hor_rate"]);
	this.top  = parseInt((kf_screen_p.h - this.property["auto_height"])*this.property["ver_rate"]);

	var auto_cssStr = "<style TYPE='text/css'>\n<!--\n";
	auto_cssStr += "#aotu_kf div{margin:0;background:none;overflow:visible;}\n";
	auto_cssStr+= "#aotu_kf table{background:none;}\n";
	auto_cssStr+= "#aotu_kf tr{background:none;text-align:}\n";
	auto_cssStr+= "#aotu_kf td{background:none;}\n";


	//auto_cssStr +=  ".aotu_kf{border:0px #f00 solid;position:absolute;width:auto;height:auto;top:"+ this.top+"px;left:"+this.left+"px;z-index:8000;display:"+this.show+";font-size:14px;}\n";
	auto_cssStr += ".aotu_kf_iframe{position:absolute;z-index:8000;width:expression(this.nextSibling.offsetWidth);height:expression(this.nextSibling.offsetHeight);top:expression(this.nextSibling.offsetTop);left:expression(this.nextSibling.offsetLeft);}\n";
	auto_cssStr+= "-->\n</style>";
	this.autoCssHtml = auto_cssStr;
}
function autoImagesInit()
{
		this.show = 'block';
		this.property["img_refuse_click"]="hidden_auto()";
		this.property["img_open_click"]="open_win_chat()";;

		this.invite_bj = img_host + "/upload/2009-12-01/109112938147_419_203.jpg";
		this.property["img_open"] =  img_host + "/upload/2009-11-24/10910214112410_72_20.jpg";

	this.property["img_refuse"] = img_host + "/upload/2009-11-24/1091021411167_72_20.jpg";


	preDownImage(this.property["img_refuse"]);
	preDownImage(this.property["img_open"]);

	var KFco = 0;
	do{
		preDownImage(this.invite_bj);
		getImgAttribute(this.invite_bj);
		if ((this.property["auto_width"] > 100) && (this.property["auto_height"] > 50))	break;
		if(KFco > 10)
		{
			this.show = "none";break;
		}
		KFco++;
	}while(true)
}

function resizeAutoFrame()
{

	this.get_auto_str();	
	if( GetObjFromDoc("aotu_kf") == null){
		setTimeout('resizeAutoFrame()',100);
		return;
	}
	
	GetObjFromDoc("aotu_kf").innerHTML = this.floatHtml;
	resizeDivWidth();
	
}
function autoAutoScroll()
{
	if(dragable)	return;
	kf_screen_p = getScreenProperty();
	this.left  = (kf_screen_p.w-this.property["auto_width"])*this.property["hor_rate"];
	try{
		var diffY = document.documentElement.scrollTop;	
		var diffX = document.documentElement.scrollLeft ;
		if(diffY==0)	diffY = document.body.scrollTop;
		if(diffX==0)	diffX = document.body.scrollLeft;
		var percent=0.1*(diffY-lastDiffY); 
		if(percent>0)percent=Math.ceil(percent); 
		else percent=Math.floor(percent); 
		lastDiffY = lastDiffY+percent; 
		GetObjFromDoc("aotu_kf").style.top = parseInt(percent + GetObjFromDoc("aotu_kf").offsetTop) + "px" ;
		if( GetObjFromDoc("aotu_kf").offsetTop <= 0){
			GetObjFromDoc("aotu_kf").style.top = parseInt(diffY + this.top) + "px" ;
		}
		GetObjFromDoc("aotu_kf").style.left = parseInt(diffX + this.left) + "px";
	}catch(e){};
}
function autoConfiger()
{
	auto_has_show = true;
	if( auto_invite_type == "1" && (getCookie("href") == window.location.href))
	{
		set51KfCookie("is_auto_again","0");
	}
	set51KfCookie("auto_invite_type",auto_invite_type);
	set51KfCookie("href",window.location.href);
}
function resizeDivWidth()
{
	var tempChildNodes = GetObjFromDoc("auto_buttonDiv").childNodes;
	if( tempChildNodes[0].offsetWidth <= 30 || tempChildNodes[1].offsetWidth <= 30 ){
		setTimeout('resizeDivWidth()',100);
		return;
	}

	GetObjFromDoc("auto_buttonDiv").style.width = (tempChildNodes[0].offsetWidth + tempChildNodes[1].offsetWidth + 20)+"px";

	if(	 GetObjFromDoc("auto_buttonDiv").offsetHeight > (tempChildNodes[0].offsetHeight) + 2 )
	{
		GetObjFromDoc("auto_buttonDiv").style.width = GetObjFromDoc("auto_buttonDiv").offsetWidth + 60+"px"; //padding
	}
	if(companyId ==10334)
	{GetObjFromDoc("auto_buttonDiv").style.width ="280px";GetObjFromDoc("auto_buttonDiv").style.paddingLeft ="13px"; }

}
function GetObjFromDoc(id,theDoc)
{
	if(!theDoc){theDoc = document;}
	if (theDoc.getElementById){return theDoc.getElementById(id);}
	else if (document.all)
	{return theDoc.all(id);}
}
function getImgAttribute(src)
{
	
	var img_tmp = src;
	var pos = img_tmp.indexOf("_"); 
	var pos1= img_tmp.indexOf("auto");	
	if( pos > 0 && pos1 == -1)
	{
		var next_pos = img_tmp.indexOf("_",pos+1);
		img_width=parseInt(img_tmp.substr(pos+1,next_pos));
		img_hight=parseInt(img_tmp.substr(next_pos+1));
		auto.property["auto_width"] = img_width;
		auto.property["auto_height"] = img_hight;
		return;
	}
	if(img_tmp.indexOf("/auto/") > -1)
	{
		if(img_tmp.indexOf("/en_company/") > -1)
		{
			if(img_tmp.indexOf("a5.gif") > -1)
			{
				img_width=350;
				img_hight=130;
				
			}
			if(img_tmp.indexOf("a5.jpg") > -1)
			{
				img_width=385;
				img_hight=125;
				
			}
		}
		else
		{
			if(img_tmp.indexOf("/left_1") > -1)
			{
				img_width=360;
				img_hight=140;				
			}
			if(img_tmp.indexOf("/left_5") > -1)
			{
				img_width=365;
				img_hight=143;				
			}
			if(img_tmp.indexOf("/right_1") > -1)
			{
				img_width=341;
				img_hight=143;				
			}
			if(img_tmp.indexOf("/right_2") > -1)
			{
				img_width=418;
				img_hight=162;				
			}
			if(img_tmp.indexOf("/right_3") > -1)
			{
				img_width=380;
				img_hight=172;				
			}
			if(img_tmp.indexOf("/right_4") > -1)
			{
				img_width=350;
				img_hight=130;
				
			}
			if(img_tmp.indexOf("/right_5") > -1)
			{
				img_width=375;
				img_hight=171;				
			}
			if(img_tmp.indexOf("/right_6") > -1)
			{
				img_width=360;
				img_hight=136;				
			}
			if(img_tmp.indexOf("/right_7") > -1)
			{
				img_width=350;
				img_hight=130;				
			}
		}
		auto.property["auto_width"] = img_width;
		auto.property["auto_height"] = img_hight;
		return;
	}

	var img = new Image();
	img.src = src;
	img.onerror=function(){}
	auto.property["auto_width"] = img.width;
	auto.property["auto_height"] = img.height;
	
}
function preDownImage(src)
{
	var imgs = new Image();
	imgs.src = src;
	imgs.onerror=function(){}
	if(!imgs.complete)
	{
		setTimeout("preDownImage('"+src+"')",500);
		return;
	}
}
function isImage(src)
{
	var imgs = new Image();
	imgs.src = src;
	if(imgs.complete)
	{
		return (imgs.height > 0 || imgs.width > 0)?true:false;
	}
	return false;
}
var dragstart = new Array();
var dragable = false;

function dragPanel(obj,e, op) {
	if(op == 1) {
		dragstart = isIE ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
		dragstart[2] = parseInt(obj.offsetLeft);
		dragstart[3] = parseInt(obj.offsetTop);
	    dragable = true;
		if(auto.scrollTimer){window.clearInterval(auto.scrollTimer);}
		doane(e);
	} else if(op == 2 && dragstart[0] && dragable) {
		var dragnow = isIE ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
		obj.style.left = (dragstart[2] + dragnow[0] - dragstart[0]) + 'px';
		obj.style.top = (dragstart[3] + dragnow[1] - dragstart[1]) + 'px';
		doane(e);
	} else if(op == 3 && dragable) {
		var diff_y = document.documentElement.scrollTop;	
		var diff_x = document.documentElement.scrollLeft ;
		if(diff_y==0)diff_y = document.body.scrollTop;
		if(diff_x==0)diff_x = document.body.scrollLeft;
		auto.top = obj.offsetTop - diff_y;
		auto.property["hor_rate"] =  obj.offsetLeft /  diff_x;
		dragstart = [];
		dragable = false;
		auto.scrollTimer = window.setInterval("auto.autoScroll()", 3);	
		doane(e);
	}
}
function doane(event) {
	e = event ? event : window.event;
	if(isIE) {
		e.returnValue = false;
		e.cancelBubble = true;
	} else if(e) {
		e.stopPropagation();
		e.preventDefault();
	}
}


var kfwin_has_show = false;
 var onloadInterval = window.setInterval(checkIfShow,10000);

function sendAndRecieve(js_src)
{
	if(auto_invite_type == "3")
	{
		set51KfCookie("is_auto_again","0");
	}
	else
	{
		if(isonline)
		{
			js_src = "http://kf.5251.net" +js_src;
			var script=document.createElement("script");
			script.type='text/javascript';
			script.language='javascript';
			script.src=js_src;
			document.getElementsByTagName("head")[0].appendChild(script);
		}
	}
}
function hidden_auto()
{
	if( auto_invite_type =="2" || auto_invite_type =="3" || auto_invite_type =="4")
	{
		set51KfCookie("is_auto_again","0");
	}
	auto_has_show = false;
	var aotu=GetObjFromDoc("aotu_kf");
	aotu.style.display="none";	
	

	
	sendAndRecieve("/js/recieve.jsp?state=3&companyId="+companyId+"&sessionId="+userid);	
}

function open_win_chat()
{
	kf_openurl_auto = kf_openurl_auto+"&workId="+work_id;
	var chat_win= window.open(kf_openurl_auto,'chat_15027','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
	{
		if(auto_invite_type == "2" || auto_invite_type == "3")
		{
			set51KfCookie("is_auto_again","0");
		}
		kfwin_has_show = true;
		//window.clearInterval(onloadInterval);
		var aotu=GetObjFromDoc("aotu_kf");
		aotu.style.display="none";
		sendAndRecieve("/js/recieve.jsp?state=4&companyId="+companyId+"&sessionId="+userid);

	}catch(e){}
}



var counttimes = 0;
function checkIfShow()
{
	if(companyId == 14991)
	{
		if(kfwin_has_show) return;
	}
	/*
	var now_time = getTime();
	if(now_time - starttime > 600)
	{
		
			window.clearInterval(onloadInterval);
			return;
		
		
	}
	*/
	counttimes++;
	if(counttimes > 30)
	{
		if(counttimes % 2 ==1)return;
	}	
	
	//if(counttimes > 1)
	{
		sendAndRecieve("/js/autoShow.jsp?t="+counttimes+"&companyId="+companyId+"&sessionId="+userid);
	}
}

function show_kf_auto(workid){
    // nextAccept();
	work_id = workid;
	var aotu= GetObjFromDoc("aotu_kf");
	if(aotu)
	{
		aotu.style.display="block";
	}
	else
	{	
		auto.sizeConfiger();
	}
	auto_has_show = true;
}
function show_51kf_dialog(workid)
{
	work_id = workid;
	try
	{
		kfwin_has_show = true;
		//window.clearInterval(onloadInterval);
		sendAndRecieve("/js/recieve.jsp?state=4&companyId="+companyId+"&sessionId="+userid);	
		//window.open(kf_openurl_auto,"chat"+companyId,"height=473,width=703,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no");
		kf_openurl_auto = kf_openurl_auto+"&workId="+work_id;
		location.href=kf_openurl_auto;

		window.focus();
	}catch(e){}
}
var returning = 0;
try{returning=cc_k()}catch(e){}
sendAndRecieve("/js/autoShow.jsp?t=0&returning="+returning+"&companyId="+companyId+"&sessionId="+userid+"&route="+route+"&keyword="+escape(getCookie("kf51_referrer"))+"&page_title="+escape(kdocTitle));
//if(1)return;	




		