﻿var online=new Array();var urlroot="http://im.bizapp.qq.com:8000/";var tOut=-1;var drag=false;var g_safeNode=null;lastScrollY=0;var kfguin;var ws;var companyname;var welcomeword;var type;var wpadomain;var eid;var Browser={ie:/msie/.test(window.navigator.userAgent.toLowerCase()),moz:/gecko/.test(window.navigator.userAgent.toLowerCase()),opera:/opera/.test(window.navigator.userAgent.toLowerCase()),safari:/safari/.test(window.navigator.userAgent.toLowerCase())};if(kfguin){_Ten_rightDivHtml="<div id=\"_Ten_rightDiv\" style=\"position:absolute; top:160px; right:1px;\">";_Ten_rightDivHtml+=kf_getPopup_Ten_rightDivHtml(kfguin,ws,wpadomain);_Ten_rightDivHtml+="</div>";document.write(_Ten_rightDivHtml);if(type==1&&kf_getCookie("hasshown")==0){companyname=companyname.substr(0,15);welcomeword=kf_processWelcomeword(welcomeword);kfguin=kf_getSafeHTML(kfguin);companyname=kf_getSafeHTML(companyname);welcomeword=welcomeword.replace(/<brT>/g,"\r\n");welcomeword=kf_getSafeHTML(welcomeword);welcomeword=welcomeword.replace(/\r/g,"").replace(/\n/g,"<BR>");window.setTimeout("kf_sleepShow()",10000)}window.setTimeout("kf_moveWithScroll()",1)}function kf_getSafeHTML(C){var B="";var A=g_safeNode;if(!A){A=document.createElement("TEXTAREA")}if(A){if(Browser.moz){A.textContent=C}else{A.innerText=C}B=A.innerHTML;if(Browser.moz){A.textContent=""}else{A.innerText=""}g_safeNode=A}return B}function kf_moveWithScroll(){if(typeof window.pageYOffset!="undefined"){nowY=window.pageYOffset}else{if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat"){nowY=document.documentElement.scrollTop}else{if(typeof document.body!="undefined"){nowY=document.body.scrollTop}}}percent=0.1*(nowY-lastScrollY);if(percent>0){percent=Math.ceil(percent)}else{percent=Math.floor(percent)}document.getElementById("_Ten_rightDiv").style.top=parseInt(document.getElementById("_Ten_rightDiv").style.top)+percent+"px";if(document.getElementById("kfpopupDiv")){document.getElementById("kfpopupDiv").style.top=parseInt(document.getElementById("kfpopupDiv").style.top)+percent+"px"}lastScrollY=lastScrollY+percent;tOut=window.setTimeout("kf_moveWithScroll()",1)}function kf_hide(){if(tOut!=-1){clearTimeout(tOut);tOut=-1}document.getElementById("_Ten_rightDiv").style.visibility="hidden";document.getElementById("_Ten_rightDiv").style.display="none"}function kf_hidekfpopup(){if(tOut!=-1){clearTimeout(tOut);tOut=-1}document.getElementById("kfpopupDiv").style.visibility="hidden";document.getElementById("kfpopupDiv").style.display="none";tOut=window.setTimeout("kf_moveWithScroll()",1)}function kf_getPopupDivHtml(D,A,F,E,C){var B="";B+="<div style=\"float:left; height:150px; width:8px; background-image:url("+urlroot+"bg_1.gif);\"></div>";B+="<div style=\"font-family:Tahoma; text-align:left; float:left; height:150px; width:324px; background-image:url("+urlroot+"bg_2.gif); background-repeat:repeat-x;\">";B+="<div><h1 style=\"float:left; width:250px; height:28px; line-height:28px; padding:2px 20px 0 2px; margin:0 0 9px 0; font-size:14px; color:#FFFFFF; display:block; background:none; border:none; position:static;\">"+F+"</h1><a href=\"#\" onclick=\"kf_hidekfpopup();return false;\" style=\"background-image: url("+urlroot+"close.gif); float:right; height:19px; width:42px;\" onmouseover=\"javascript:this.style.backgroundPosition='bottom'\" onmouseout=\"javascript:this.style.backgroundPosition='top'\"></a></div>";B+="<div style=\"height:83px; padding:0 0 0 2px; clear:both;\">";B+="<div style=\"background-image:url("+urlroot+"face.jpg); height:70px; width:70px; float:left;\"></div>";B+="<p style=\"font-family:Tahoma; font-size:12px; line-height:24px; width: 240px; margin:0px; padding: 0 0 0 12px; display:block; float:left; margin-top:2px; word-wrap:break-word;\">"+E+"</p></div>";B+="<div style=\"clear:both;\">";B+="<a onclick=\"kf_hidekfpopup();return false;\" href=\"#\" style=\"float:right; background-image:url("+urlroot+"btn_1.gif); margin:0 0 0 5px; padding:0px; border:0px; height:21px; width:69px;\"></a>";B+="<a onclick=\"kf_openChatWindow(1,'"+C+"','"+D+"')\" href=\"#\" style=\"float:right; background-image:url("+urlroot+"btn_2.gif); margin:0; padding:0px; border:0px; height:21px; width:69px;\"></a></div>";B+="</div><div style=\"float:left; height:150px; width:8px; background-image:url("+urlroot+"bg_1.gif); background-position:right;\"></div>";return B}function kf_getPopup_Ten_rightDivHtml(D,A,C){var B="";B+="<div style=\"width:90px; height:150px;\">";B+="<div style=\"width:8px; height:150px; float:left; background:url("+urlroot+"bg_1.gif);\"></div>";B+="<div style=\"float:left; width:74px; height:150px; background:url("+urlroot+"middle.jpg); background-position: center;\">";B+="<div ><h1 style=\"line-height:17px; font-size:14px; color:#FFFFFF; margin:0px; padding:10px 0 13px 8px; display:block; background:none; border:none; float:none; position:static;\">&nbsp;</h1></div>";B+="<div style=\"height:83px; padding:0 0 0 2px; clear:both;\"><div style=\"width:70px; height:70px; float:left; background:url("+urlroot+"face.jpg);\"></div></div>";B+="<div style=\"clear:both;\"><a href=\"#\" onclick=\"kf_openChatWindow(0,'"+C+"','"+D+"')\" style=\"width:69px; height:21px; background:url("+urlroot+"btn_2.gif); margin:0 0 0 2px; display:block;\"></a></div></div>";B+="<div style=\"width:8px; height:150px; float:left; background:url("+urlroot+"bg_1.gif) right;\"></div></div>";return B}function kf_openChatWindow(A,B,C){window.open("http://wpa.qq.com/msgrd?V=1?&Uin="+C+"&Menu=yes","_blank","height=544, width=644,toolbar=no,scrollbars=no,menubar=no,status=no");if(A==1){kf_hidekfpopup()}return false}function kf_validateWelcomeword(D){var C=0;for(var B=0;B<D.length;B++){if(D.charAt(B)=="\n"){C++}if(C>2){return 2}}if(D.length>57+2*C){return 1}C=0;var A=D.indexOf("\n");while(A!=-1){D=D.substr(A+1);if(A-1<=19){C+=19}else{if(A-1<=38){C+=38}else{if(A-1<=57){C+=57}}}A=D.indexOf("\n")}C+=D.length;if(C>57){return 3}return 0}function kf_processWelcomeword(D){D=D.substr(0,57+10);var A="";var C=0;var B=D.indexOf("<brT>");while(C<57&&B!=-1){if(B<=19){C+=19;if(C<=57){A+=D.substr(0,B+5)}else{A+=D.substr(0,57-C>D.length?D.length:57-C)}}else{if(B<=38){C+=38;if(C<=57){A+=D.substr(0,B+5)}else{A+=D.substr(0,57-C>D.length?D.length:57-C)}}else{if(B<=57){C+=57;if(C<=57){A+=D.substr(0,B+5)}else{A+=D.substr(0,57-C>D.length?D.length:57-C)}}}}D=D.substr(B+5);B=D.indexOf("<brT>")}if(C<57){A+=D.substr(0,57-C>D.length?D.length:57-C)}return A}function kf_setCookie(B,D,G,E,C){var A=B+"="+escape(D)+";";var F=null;if(typeof (G)=="object"){F=G}else{if(typeof (G)=="number"){F=new Date();F=new Date(F.getFullYear(),F.getMonth(),F.getDate(),F.getHours(),F.getMinutes()+G,F.getSeconds(),F.getMilliseconds())}}if(F){A+="expires="+F.toGMTString()+";"}if(!E){A+="path=/;"}else{if(typeof (E)=="string"&&E!=""){A+="path="+E+";"}}if(!C&&typeof (VS_COOKIEDM)!="undefined"){C=VS_COOKIEDM}if(typeof (C)=="string"&&C!=""){A+="domain="+C+";"}document.cookie=A}function kf_getCookie(B){var E="";var D=document.cookie.split("; ");var A;var C;for(C=0;C<D.length;C++){A=D[C].split("=");if(A&&A.length>=2&&B==kf_rTrim(kf_lTrim(A[0]))){E=unescape(A[1])}}return E}function kf_sleepShow(){kf_setCookie("hasshown",1,"","/",wpadomain+".qq.com");var A=parseInt(document.getElementById("_Ten_rightDiv").style.top)+170;popupDivHtml="<div id=\"kfpopupDiv\" onmousedown=\"MyMove.Move('kfpopupDiv',event,1);\"  style=\"z-index:10000;filter:alpha(opacity=90);position: absolute; top: "+A+"px; right: 500px;color:#000;font-size: 12px;cursor:move;height: 150px;width: 340px;\">";popupDivHtml+=kf_getPopupDivHtml(kfguin,ws,companyname,welcomeword,wpadomain);popupDivHtml+="</div>";document.body.insertAdjacentHTML("beforeEnd",popupDivHtml)}function kf_dealErrors(){kf_hide();return true}function kf_lTrim(A){while(A.charAt(0)==" "){A=A.slice(1)}return A}function kf_rTrim(B){var A=B.length;while(B.charAt(A-1)==" "){B=B.slice(0,A-1);A--}return B}window.onerror=kf_dealErrors;var MyMove=new Tong_MoveDiv();function Tong_MoveDiv(){this.Move=function(C,I,E){if(C==""){return }var B=document.getElementById(C);if(!B){return }evt=I?I:window.event;B.style.position="absolute";B.style.zIndex=9999;var F=evt.srcElement?evt.srcElement:evt.target;var H=B.offsetWidth;var G=B.offsetHeight;var D=B.offsetLeft;var J=B.offsetTop;var A=document.createElement("DIV");document.body.appendChild(A);A.style.cssText="filter:alpha(Opacity=10,style=0);opacity:0.2;width:"+H+"px;height:"+G+"px;top:"+J+"px;left:"+D+"px;position:absolute;background:#000";A.setAttribute("id",C+"temp");this.Move_OnlyMove(C,evt,E)};this.Move_OnlyMove=function(A,D,B){var F=document.getElementById(A+"temp");if(!F){return }evt=D?D:window.event;var C=evt.clientX-F.offsetLeft;var E=evt.clientY-F.offsetTop;if(!window.captureEvents){F.setCapture()}else{window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}document.onmousemove=function(I){if(!F){return }I=I?I:window.event;var H=Math.max(document.body.scrollHeight,document.body.clientHeight,document.body.offsetHeight,document.documentElement.scrollHeight,document.documentElement.clientHeight,document.documentElement.offsetHeight);var J=Math.max(document.body.scrollWidth,document.body.clientWidth,document.body.offsetWidth,document.documentElement.scrollWidth,document.documentElement.clientWidth,document.documentElement.offsetWidth);var G=0;if(document.body.scrollWidth<J){G=document.body.scrollWidth}if(document.body.clientWidth<J&&G<document.body.clientWidth){G=document.body.clientWidth}if(document.body.offsetWidth<J&&G<document.body.offsetWidth){G=document.body.offsetWidth}if(document.documentElement.scrollWidth<J&&G<document.documentElement.scrollWidth){G=document.documentElement.scrollWidth}if(document.documentElement.clientWidth<J&&G<document.documentElement.clientWidth){G=document.documentElement.clientWidth}if(document.documentElement.offsetWidth<J&&G<document.documentElement.offsetWidth){G=document.documentElement.offsetWidth}if(I.clientX-C<=0){F.style.left=0+"px"}else{if(I.clientX-C>=J-F.offsetWidth-2){F.style.left=(G-F.offsetWidth-2)+"px"}else{F.style.left=I.clientX-C+"px"}}if(I.clientY-E<=1){F.style.top=1+"px"}else{if(I.clientY-E>=H-F.offsetHeight-30){F.style.top=(H-F.offsetHeight)+"px"}else{F.style.top=I.clientY-E+"px"}}};document.onmouseup=function(){if(!F){return }if(!window.captureEvents){F.releaseCapture()}else{window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP)}var K=document.getElementById(A);if(!K){return }var H=F.offsetLeft;var J=F.offsetTop;var G=K.offsetLeft;var I=K.offsetTop;MyMove.Move_e(A,H,J,G,I,B);document.body.removeChild(F);F=null}};this.Move_e=function(C,G,H,D,J,F){if(typeof (window["ct"+C])!="undefined"){clearTimeout(window["ct"+C])}var A=document.getElementById(C);if(!A){return }var E=st=8;var B=Math.abs(G-D);var I=Math.abs(H-J);if(B-I>0){if(I){E=Math.round(B/I)>8?8:Math.round(B/I)*6}else{E=0}}else{if(B){st=Math.round(I/B)>8?8:Math.round(I/B)*6}else{st=0}}if(G-D<0){E*=-1}if(H-J<0){st*=-1}if(Math.abs(D+E-G)<52&&E){E=E>0?2:-2}if(Math.abs(J+st-H)<52&&st){st=st>0?2:-2}if(Math.abs(D+E-G)<16&&E){E=E>0?1:-1}if(Math.abs(J+st-H)<16&&st){st=st>0?1:-1}if(B==0&&I==0){return }if(F){A.style.left=G+"px";A.style.top=H+"px";return }else{if(Math.abs(D+E-G)<2){A.style.left=G+"px"}else{A.style.left=D+E+"px"}if(Math.abs(J+st-H)<2){A.style.top=H+"px"}else{A.style.top=J+st+"px"}window["ct"+C]=window.setTimeout("MyMove.Move_e('"+C+"', "+G+" , "+H+", "+(D+E)+", "+(J+st)+","+F+")",1)}}}function wpa_count(){var A=document.getElementsByTagName("body").item(0);var B=document.createElement("img");var C=new Date();B.src="http://"+wpadomain+".qq.com/cgi/wpac?kfguin="+kfguin+"&ext=0&time="+C.getTime()+"ip=172.23.30.15&";B.style.display="none";A.appendChild(B)}

