var jiaying_gb2312result="";function JiaYingPagerClass(){this.isInternetExplorer=navigator.appName.indexOf("Microsoft")!=-1;this.pageTitle=document.title.length>30?document.title.substring(0,30):document.title;this.referrer=document.referrer;this.searchEngine="";this.searchEngineNo="";this.searchEngineLangNo=1;this.keyWord="";this.pageURL=encodeURI(document.location);this.agentName=encodeURI(navigator.appName);this.osVer=encodeURI(window.navigator.userAgent);this.agent=encodeURI(navigator.userAgent);this.browserLang=this.isInternetExplorer?encodeURI(navigator.browserLanguage):encodeURI("unknown");this.screenX=screen.width;this.screenY=screen.height;this.searchEngineArr=new Array("","cn.bing.com/","google.com.hk/","google.com/","baidu.com/","3721.com/","yisou.com/","yahoo.com.cn/","yahoo.com/","sogou.com/","sina.com.cn/","iask.com/","tom.com/","163.com/","soso.com/","qq.com/","msn.com/","zhongsou.com/","googlesyndication.com/");this.searchEngineWord=new Array("","cn.bing.com/","google.com.hk/","google.com/","baidu.com/","baidu.com/","3721.com/","3721.com/","yisou.com/","yahoo.com.cn/","yahoo.com/","sogou.com/","sina.com.cn/","iask.com/","tom.com/","163.com/","soso.com/","qq.com/","msn.com/","zhongsou.com/");this.searchEnginePara=new Array("","q=","q=","q=","wd=","word=","name=","p=","p=","p=","p=","query=","k=","k=","word=","q=","w=","w=","q=","w=");this.searchEngineLang=new Array(0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1);this.getSearchEngine=function(){for(var B=1;B<this.searchEngineArr.length;B++){if(this.referrer.indexOf(this.searchEngineArr[B])>=0){this.searchEngineNo=B;this.searchEngineLangNo=this.searchEngineLang[B];this.searchEngine=this.searchEngineArr[B];return this.searchEngine}}this.searchEngine="";return this.searchEngine};this.UTF8ToGB2312=function(D){jiaying_gb2312result="";var E="";var G=D;try{G=decodeURI(G);for(var C=0;C<G.length;C++){window.execScript("jiaying_gb2312result=jiaying_gb2312result+hex(asc('"+G.charAt(C,1)+"'))","VBScript")}for(var B=0;B<jiaying_gb2312result.length;B=B+2){E=E+"%"+jiaying_gb2312result.substr(B,2)}}catch(F){}return E};this.getKeyWord=function(){if(this.searchEngine.length<=0){return""}var C=this.referrer.indexOf("?")+1;var H=this.referrer.substr(C);var B=H.split("&");var E=false;for(var G=1;G<this.searchEngineWord.length;G++){for(var F=0;F<B.length;F++){if(this.searchEngineArr[G]==this.searchEngine){var D=B[F].indexOf(this.searchEnginePara[G]);if(D>=0){if(this.searchEngineLang[G]==0){this.keyWord=this.UTF8ToGB2312(B[F].substr(this.searchEnginePara[G].length))}else{if(this.searchEngine="baidu.com/"){if(H!=null&&H.toLowerCase().indexOf("&ie=utf-8")>1){E=true;this.keyWord=this.UTF8ToGB2312(B[F].substr(this.searchEnginePara[G].length))}}if(E==false){this.keyWord=B[F].substr(this.searchEnginePara[G].length)}}return this.keyWord}}}}this.keyWord="";return this.keyWord};function A(){return this.pageURL}this.getTitle=function(){return this.pageTitle}}function JiaYingChatClass(){this.eprId="";this.position=0;this.isAutoChat=1;this.userListJSon=[];this.displayTimes=5;this.panelTop=50;this.isScroll=1;this.language="zh-cn";this.chatFormStyle=5;this.displayType=0;var newWindow=null;var lastScript="";var timer=2000;var oldArray=[];var newArray=[];var main_top=this.panelTop;var auto_top=180;var onLine_Color="#FE9903";var notOnLine_Color="#989898";var open_ICON_IMG=new Image();open_ICON_IMG.src="http://www.7k35.com/v2/chatJs/images/skin/openicon.gif";var close_ICON_IMG=new Image();close_ICON_IMG.src="http://www.7k35.com/v2/chatJs/images/skin/closeicon.gif";this.createDIV=function(strHTML){document.writeln(strHTML)};getJson=function(){try{var url="http://www.jiaying.com/getClientList.ashx?cid=2&mn=callback&"+Math.random();var JS=document.createElement("SCRIPT");var id=new Date().getTime();JS.id=id;JS.type="text/javascript";JS.setAttribute("src",url);JS.charset="gbk";if(document.readyState=="complete"){document.body.appendChild(JS)}else{setTimeout("getJson()",1000*5)}if(lastScript&&getLastScript(lastScript)){document.body.removeChild(lastScript);lastScript=id}}catch(e){}};getLastScript=function(id){return document.getElementById(id)};callback=function(response){try{eval("newArray="+response);processArray();var tt=setTimeout("getJson()",timer)}catch(e){var tt=setTimeout("getJson()",timer)}};this.processArray=function(){try{for(var n=0;n<newArray.length;n++){var s=0;for(var o=0;o<oldArray.length;o++){if(newArray[n].C==oldArray[o].C){s=1;if(newArray[n].S==oldArray[o].S){break}else{processNewDIV(newArray[n].P,newArray[n].C,oldArray[o].S,newArray[n].S)}}}if(s==0){processNewDIV(newArray[n].P,newArray[n].C,0,newArray[n].S)}}for(var i=0;i<oldArray.length;i++){var ss=0;for(var j=0;j<newArray.length;j++){if(oldArray[i].C==newArray[j].C){ss=1;break}}if(ss==0){processNewDIV(oldArray[i].P,oldArray[i].C,oldArray[i].S,0)}}oldArray=newArray}catch(e){}};this.processNewDIV=function(part,clientID,oldStatus,newStatus){var oStatus;var nStatus;var color;if(oldStatus==2||oldStatus==0){oStatus=0}else{oStatus=1}if(newStatus==2||newStatus==0){nStatus=0}else{nStatus=1}var n_ID=part+"_"+nStatus+"_"+clientID;var o_ID=part+"_"+oStatus+"_"+clientID;var n_Parent_ID=part+"_"+nStatus;var o_Parent_ID=part+"_"+oStatus;var n_Parent_Obj=JY_$(n_Parent_ID);var o_Parent_Obj=JY_$(o_Parent_ID);var o_Obj=JY_$(o_ID);if(o_Obj!=null){o_Parent_Obj.removeChild(o_Obj);if(document.readyState=="complete"){n_Parent_Obj.appendChild(o_Obj)}else{setTimeout("processNewDIV()",1000*5)}}else{return }o_Obj.id=n_ID;var n_IMG_ID="IMG"+clientID;var IMG_OBJ=JY_$(n_IMG_ID);if(IMG_OBJ){var path=IMG_OBJ.src;path=path.substr(0,path.lastIndexOf("/")+1)}var n_SPAN_ID="SPAN"+clientID;var SPAN_OBJ=JY_$(n_SPAN_ID);switch(parseInt(newStatus)){case 0:case 2:SPAN_OBJ.style.color=notOnLine_Color;IMG_OBJ.src=path+"0.gif";break;default:SPAN_OBJ.style.color=onLine_Color;IMG_OBJ.src=path+newStatus.toString()+".gif"}};this.selectClient=function(clientId){newWindow=window.open("http://www.jiaying.com/Sophisticatedblue.aspx?clientID="+clientId,"_bank","width=610,height=450,left=200,top=170,toolbar=no,location=no,status=no");newWindow.focus()};this.Div_CloseOrOpen=function(){var E_Gif=JY_$("jiayingGifDiv");var E_Main_Div=JY_$("jiayingMainDiv");if(E_Gif.style.display=="none"&&(E_Main_Div.style.display=="block"||E_Main_Div.style.display=="")){E_Gif.style.display="block";E_Main_Div.style.display="none"}else{E_Gif.style.display="none";E_Main_Div.style.display="block"}};startScroll=function(){var f1=new scrollFunction(main_top,JY_$("jiayingMainDiv"));f1.sscroll();var f2=new scrollFunction(main_top+20,JY_$("jiayingGifDiv"));f2.sscroll();var f3=new scrollFunction(auto_top,JY_$("jiayingPopDiv"));f3.sscroll();var timer=setTimeout("startScroll()",30)};scrollFunction=function(top,obj){var theTop=parseInt(top);var old=theTop;var tt;var timer;this.sscroll=function(){var pos;if(window.innerHeight){pos=window.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){pos=document.documentElement.scrollTop}else{if(document.body){pos=document.body.scrollTop}}}try{pos=pos-obj.offsetTop+theTop;pos=obj.offsetTop+pos/5;if(pos<theTop){pos=theTop}if(pos!=theTop){obj.style.top=pos+"px";tt=0}old=pos}catch(e){}}};this.DIV_OpenORClose=function(ID){var DIV=JY_$(ID);var IMG_PART_ID="IMG_PART_"+ID;var IMG=JY_$(IMG_PART_ID);var Main_Content=JY_$("middlecontent");var Main_Height=Main_Content.style.height;var M_Height=parseInt(Main_Height.substring(0,Main_Height.indexOf("px")));var height;var DIV_Height=DIV.style.height;if(DIV.style.display=="block"){DIV.style.display="none";IMG.src=close_ICON_IMG.src;height=M_Height-parseInt(DIV_Height.substring(0,DIV_Height.indexOf("px")))}else{DIV.style.display="block";IMG.src=open_ICON_IMG.src;height=M_Height+parseInt(DIV_Height.substring(0,DIV_Height.indexOf("px")))}};this.ClosePic=function(){var IMG=JY_$("jiayingGifDiv");if(IMG!=null){IMG.style.display="none"}};this.intializeDIV=function(){if(this.position==2){var obj=JY_$("jiayingGifDiv");if(obj!=null){var width=obj.style.width;var iWidth=parseInt(width.substring(0,width.indexOf("px")));obj.style.left=(document.body.scrollLeft+document.body.clientWidth-iWidth)+"px"}obj=JY_$("jiayingMainDiv");if(obj!=null){var iWidth=101;obj.style.left=(document.body.scrollLeft+document.body.clientWidth-iWidth)+"px"}}};JY_$=function(id){return document.getElementById(id)};this.beginDrag=function(elementToDrag,event){var delatX=event.clientX-parseInt(elementToDrag.style.left);var delatY=event.clientY-parseInt(elementToDrag.style.top);var maxLeft=parseInt(document.body.clientWidth)-parseInt(elementToDrag.clientWidth);var maxTop=parseInt(document.body.clientHeight)-parseInt(elementToDrag.clientHeight);if(document.addEventListener){document.addEventListener("mousemove",moveHandler,true);document.addEventListener("mouseup",upHandler,true)}else{if(document.attachEvent){document.attachEvent("onmousemove",moveHandler);document.attachEvent("onmouseup",upHandler)}else{var oldmovehandler=document.onmousemove;var olduphandler=document.onmouseup;document.onmousemove=moveHandler;document.onmouseup=upHandler}}if(event.stopPropagation){event.stopPropagation()}else{event.cancelBubble=true}if(event.preventDefault){event.preventDefault()}else{event.returnValue=false}function moveHandler(e){if(!e){e=window.event}elementToDrag.style.left=(e.clientX-delatX)+"px";elementToDrag.style.top=(e.clientY-delatY)+"px";var scroll_Top=document.documentElement.scrollTop||document.body.scrollTop;var left=parseInt(elementToDrag.style.left);var top=parseInt(elementToDrag.style.top)-scroll_Top;var e_top=top;if(left<0){elementToDrag.style.left="0px"}if(left>maxLeft){elementToDrag.style.left=maxLeft+"px"}if(top<0){elementToDrag.style.top="0px";e_top=0}if(top>maxTop){elementToDrag.style.top=maxTop+"px";e_top=maxTop-scroll_Top}switch(elementToDrag.id){case"jiayingMainDiv":main_top=e_top;break;case"jiayingPopDiv":auto_top=e_top;break}if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}}function upHandler(e){if(!e){e=window.event}if(document.removeEventListener){document.removeEventListener("mouseup",upHandler,true);document.removeEventListener("mousemove",moveHandler,true)}else{if(document.detachEvent){document.detachEvent("onmouseup",upHandler);document.detachEvent("onmousemove",moveHandler)}else{document.onmouseup=olduphandler;document.onousemove=oldmovehandler}}if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}}};this.createPopDIV=function(strHTML){document.writeln(strHTML)};this.autoChatWindow=function(){var openWindow=window.open("http://www.jiaying.com/s.aspx?cid=2","_bank","width=610,height=450,left=200,top=170,toolbar=no,location=no,status=no");openWindow.focus();showOrHidden()};this.getCookie=function(name){var offset=document.cookie.indexOf(name+"=");if(offset!=-1){offset+=name.length+1;var end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}return document.cookie.substring(offset,end)}else{return""}};this.getVisitorId=function(){var id=this.getCookie("jiaying_user0919");if(id==null||id==""){var rightNow=new Date();var uid=rightNow.getTime()+""+Math.floor(Math.random()*(9999));document.cookie="jiaying_user0919="+uid+"; expires=Thu, 6 Jan 2299 12:05:36 UTC; path=/";id=uid}return id};this.getLoginURL=function(){return escape(document.referrer)};this.getDestURL=function(){return escape(window.location)};this.openWin=function(eprUserId){var isOnline=this.isUserOnline(eprUserId);this.openChatWin(this.eprId,eprUserId,isOnline)};this.openChatWin=function(eprId,eprUserId,eprUserName,isOnline){var visitorId=this.getVisitorId();var openWindow;if(isOnline==1){openWindow=window.open("http://chat.7k35.com/v2/chatJs/chatForm.jsp?eprId="+eprId+"&eprUserId="+eprUserId+"&eprUserName=&visitorId="+visitorId+"&lan="+this.language+"&style="+this.chatFormStyle,"_blank","height=500,width=720,top=100,left=100,toolbar=no,menubar=no,resizable=no,scrollbars=no, location=no, status=no, statusbar=no");openWindow.document.title="\u5bf9\u8bdd\u7a97\u53e3"}else{openWindow=window.open("http://chat.7k35.com/v2/chatJs/leaveMsg.jsp?eprId="+eprId+"&eprUserId="+eprUserId+"&eprUserName=&visitorId="+visitorId+"&lan="+this.language+"&style="+this.chatFormStyle,"_blank","height=500,width=720,top=100,left=100,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");openWindow.document.title="\u7559\u8a00"}openWindow.focus();this.unShowRequestForm()};this.openSelectWin=function(eprId){var visitorId=this.getVisitorId();if(this.userListJSon.length==1){eprUserId=this.userListJSon[0].id;this.openChatWin(this.eprId,eprUserId,this.getUserName(eprUserId),this.isUserOnline(eprUserId))}else{var win=window.open("http://chat.7k35.com/v2/chatJs/selectForm.jsp?eprId="+eprId+"&visitorId="+visitorId+"&lan="+this.language+"&style="+this.chatFormStyle,"_blank","height=350,width=500,top=100,left=100,toolbar=no,menubar=no,resizable=no,scrollbars=no, location=no, status=no, statusbar=no");win.document.title="\u9009\u62e9\u5ba2\u670d"}this.unShowRequestForm()};this.openAutoSelectWin=function(eprId){var visitorId=this.getVisitorId();var openWindow=window.open("http://chat.7k35.com/v2/chatJs/autoSelect.jsp?eprId="+eprId+"&visitorId="+visitorId+"&lan="+this.language+"&style="+this.chatFormStyle,"_blank","height=500,width=720,top=100,left=100,toolbar=no,menubar=no,resizable=no,scrollbars=no, location=no, status=no, statusbar=no");this.unShowRequestForm()};this.createFlash=function(){var pager=new JiaYingPagerClass();var iestr="";var str="";iestr+="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"1\" height=\"1\" id=\"JiaYing_NC_Line\" align=\"middle\">";iestr+="<param name=\"allowScriptAccess\" value=\"always\" />";iestr+="<param name=\"movie\" value=\"http://chat.7k35.com/v2/chatJs/res_files/JiaYing_NC_Line.swf\" />";iestr+="<param name=\"FlashVars\" value=\"jiayingUser="+this.getVisitorId()+"&companyId="+this.eprId+"&destUser=&jiayingSrcURL="+this.getLoginURL()+"&jiayingDestURL="+this.getDestURL()+"&searchEngine="+pager.getSearchEngine()+"&keyword="+escape(pager.getKeyWord())+"&destPageTitle="+encodeURI(pager.getTitle())+"\"/>";iestr+="<param name=\"quality\" value=\"high\" />";iestr+="<param name=\"wmode\" value=\"transparent\">";iestr+="</object>";str+="<embed src=\"http://chat.7k35.com/v2/chatJs/res_files/JiaYing_NC_Line.swf\" quality=\"high\" bgcolor=\"#ffffff\"  name=\"JiaYing_NC_Line\" align=\"middle\" allowScriptAccess=\"always\" FlashVars==\"t=1&jiayingUser="+this.getVisitorId()+"&companyId="+this.eprId+"&destUser=&jiayingSrcURL="+this.getLoginURL()+"&jiayingDestURL="+this.getDestURL()+"&searchEngine="+pager.getSearchEngine()+"&keyword="+escape(pager.getKeyWord())+"&destPageTitle="+encodeURI(pager.getTitle())+"\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";if(navigator.appName.indexOf("Microsoft")!=-1){document.write(iestr)}else{document.write(str)}};this.getFlash=function(){return document.getElementById("JiaYing_NC_Line")};this.showOrHidden=function(){var isShow="yes";with(JY_$("jiayingPopDiv").style){var w=document.body.clientWidth;w=(w-300)/2;left=w+"px";if(display=="none"&&isShow=="yes"){display="block"}else{display="none"}}};this.showRequestForm=function(eprId,eprUserId,msg){var w=document.body.clientWidth;w=(w-300)/2;JY_$("jiayingPopDiv").style.left=w+"px";JY_$("jiayingPopDiv").style.display="block";var obj=document.getElementById("jy_query_msg");if(obj!=null){obj.innerHTML=msg}obj=document.getElementById("jy_query_eprUserId");if(obj!=null){obj.value=eprUserId}};this.autoShowRequestForm=function(){var dispTimes=this.getCookie("jiayingDispTimes");if(dispTimes==""){dispTimes="0"}dispTimes=parseInt(dispTimes);if(dispTimes<this.displayTimes){this.showOrHidden()}var time=new Date();time.setTime(time.getTime()+24*3600*1000);dispTimes=dispTimes+1;document.cookie="jiayingDispTimes = "+dispTimes+"; expires= "+time.toGMTString()};this.unShowRequestForm=function(){var time=new Date();time.setTime(time.getTime()+24*3600*1000);var dispTimes=99999999;document.cookie="jiayingDispTimes = "+dispTimes+"; expires= "+time.toGMTString()};this.getUserName=function(userId){for(var i in this.userListJSon){if(this.userListJSon[i].id==userId){return this.userListJSon[i].name}}return""};this.isUserOnline=function(userId){for(var i in this.userListJSon){if(this.userListJSon[i].id==userId){return this.userListJSon[i].online}}return 0};this.acceptForChat=function(){var eprUserId=document.getElementById("jy_query_eprUserId").value;if(eprUserId==null||eprUserId==""){if(this.userListJSon.length==1){eprUserId=this.userListJSon[0].id;this.openChatWin(this.eprId,eprUserId,this.getUserName(eprUserId),this.isUserOnline(eprUserId))}else{if(this.isAutoChat==1){this.openAutoSelectWin(this.eprId)}else{this.openSelectWin(this.eprId)}}}else{this.openChatWin(this.eprId,eprUserId,this.getUserName(eprUserId),this.isUserOnline(eprUserId))}JY_$("jiayingPopDiv").style.display="none"};this.setLanguage=function(lan){this.language=lan};this.intialize=function(mainDivHTML,popDivHTML,isMonitor,isAutoRequest,delayTime){main_top=this.panelTop;if(isMonitor==1){this.createFlash()}this.createDIV(mainDivHTML);eval("oldArray=[]");this.intializeDIV();this.createPopDIV(popDivHTML);if(this.isScroll==1){startScroll()}if(isAutoRequest==1){var pop_time=setTimeout("jiayingChatClassObj.autoShowRequestForm()",delayTime)}}}
