(function(){var b=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript";a.src="http://img.s.aliimg.com/pm/js/itbu/pm/jsserver/plugins/qyzx_utils.js?v=20111201";a.charset="GBK";a.onload=a.onreadystatechange=function(){var c=a.readyState;if(!c||c==="loaded"||c==="complete"){b=a=a.onload=a.onreadystatechange=null;PM_QYZX_Entry()}};b.insertBefore(a,null)})();function PM_QYZX_Entry(){var h=window.__itbu_webim_utils__,N=h.$;if(/(^|\&)logger\=1(\&|$)/.test(location.search.substring(1))){h.logger.enabled()}if(T()){return h.logger.warn("使用google翻译或ali crmcs链接过来的用户，不做记录！","status:"+T())}if(!h.flash.hasVersion("9.0.28")){return h.logger.warn("浏览器未安装flash，或者flash版本低于9.0.28！")}var y="http://img.s.aliimg.com/pm",ai="http://img.s.aliimg.com",v="/pm/images/itbu/pm/jsserver",ac="socket.pm.china.alibaba.com:8080",i="http://js.pm.china.alibaba.com/jsserver/JSServlet",k="detail.china.alibaba.com";var B={url_jsserver:i,url_webim_css:y+"/css/itbu/pm/jsserver/WebIM.css?v=20111201",url_ww_online:"http://amos.im.alisoft.com/mullidstatus.aw?callback={0}&uids={1}",url_acookie:"http://acookie.alibaba.com/1.gif",siteId:null,sellerId:null,fromSite:null,fromSiteMap:{offerdetail:1,cnalichn:2,pm_standard:3},ipAddress:null,accessLogId:null,receiptName:null,receiptWwId:null,sidebar:null,sidebarPosition:1,sidebarDisplayState:1,sidebar_state:{EXPANDS:1,COLLAPSED:2},cookie:{cna:null,vid:null,lastCnalibabaId:null,slid:null,lastLoginWWId:null,is_first_visited:null,cn_acookie:"cna",cn_vid:"_ITBU_VISITOR_ID_",cn_is_first_visited:"_ITBU_IS_FIRST_VISITED_",cn_last_login_ww:"__last_login__",url_alisoft_getcookie:"http://m.alisoft.com/home/cookieProxy!getCookieValue.jspa",cd_name_itbu:"__itbu_cd_name__",cd_name_alisoft:"__cd_name__",expires:(function(){var U=(new Date()).getTime()+31536000000;return(new Date(U)).toGMTString()})(),domain_offerdetail:k,domain_detailp4p:"detailp4p.china.alibaba.com",domain_yellowpage:"china.alibaba.com",domain_china_alibaba_com:(function(){return k.substring(k.indexOf("."))})(),limit_count_visitor_list:20},WebIM:{name:"",container:null,height:250,width:353,isSocketPage:false,isOnLogined:false,status:1,pos:{x:0,y:0},newMsgID:(function(){var U="MsgID_"+h.randomGUID()+"_",ak=0;return function(){return U+(++ak)}})(),messageQueue:{put:function(ak,U){this[ak]=U;return ak},get:function(U){return this[U]},remove:function(U){delete this[U]}},socketFlash:null,socket_flash_id:"oSocket_"+h.randomGUID(),socket_flash_swf:y+"/images/itbu/pm/jsserver/PigeonClient-v3.3.swf?v=20111201",socket_flash_vars:(function(){return["socketUrl="+ac,"initFunction=__itbu_socket_flash_onReady__","onDataSent=__itbu_onDataSent__","onDataReceieved=__itbu_onDataReceived__","loginedFunction=__itbu_onLogined__","logoutedFunction=__itbu_onLogouted__","chartSet=UTF-8"].join("&")})(),mgrFlash:null,manager_flash_id:"oMgr_"+h.randomGUID(),manager_flash_swf:y+"/images/itbu/pm/jsserver/SocketClientManager-v3.3.swf?v=20111201",manager_flash_vars:(function(){return["initCallBack=__itbu_manager_flash_onReady__","startSocketCallBack=__itbu_startSocket__","sendDataCallBack=__itbu_sendMessage__","soUrl="+v].join("&")})(),chatFlash:null,chat_flash_id:"oChat_"+h.randomGUID(),chat_flash_swf:y+"/images/itbu/pm/jsserver/WebIM-v3.3.swf?v=20111201",chat_flash_vars:(function(){return["webImStatusCallBack=__itbu_page_webImStatusCallBack__","setWebimOnPageCallBack=__itbu_page_WebImHasOpened__","unReadMessageCallBack=__itbu_page_unReadMessage__","setWebImNameCallBack=__itbu_page_setWebImName__","accessLogId=","flashUrl="+ai,"soUrl="+v].join("&")})(),eTypes:{first_enter:"first_enter",enter:"enter",leave:"leave",leave_site:"leave_site",leave_page:"leave_page",contact:"contact",probe_action:"probe_action",tips_action:"tips_action",resume_conn:"resume_conn",update_visitor:"update_visitor"},pNames:{event:"event",sellerId:"sellerId",cna:"cna",vid:"vid",loginId:"loginId",content:"webImContent",probe_action:"probeAction",tips_action:"tipsAction",accessLogId:"accesslogId",toId:"toId",pageUrl:"pageUrl",fromUrl:"fromUrl",fromSite:"fromSite",title:"title",siteId:"siteId",visitorName:"visitorName",visitorSex:"visitorSex",visitorPhone:"visitorPhone",visitorMobile:"visitorMobile",visitorEmail:"visitorEmail",visitorCompany:"visitorCompany",visitorIp:"visitorIp",visitorArea:"area",isAnonymous:"isAnonymous",isNeedUpdate:"isNeedUpdate",receiptWwId:"receiptWwId",slid:"slid"},sender_visitor:'<font color="#308712">我</font>',sender_seller:'<font color="#0066cc">{0}</font>'},visitor:{name:"",sex:"",phone:"",mobile:"",email:"",area:"",company:"",lastLoginWWId:"",slid:""},autoAnswerMessage:{autoWelcome:"",unsayVisitor:"",unsayI:"",Initiative:"",sellerOffline:""},epConfig:{adminMemberId:"",color:"",welcomeWords:"",contacts:[]},regexps:{inputStatus:/^_(?:.*)_$/,filterSizeAttr:/size=\".*?\"/gi,filterImgTag:/\<img.*?\/?\>/gi},isNeedFeedbackForSendMsg:true};var m=h.JSON,w=h.flash,e=h.logger,n=h.alitalk,Z=h.clientScreen,V=h.pluginManager,R=B.WebIM,b=B.cookie,l=B.visitor,ad=B.autoAnswerMessage,ag=B.epConfig,A=R.messageQueue;R.init=j;R.show=F;R.hide=K;R.showMaxTips=z;R.hideMaxTips=W;R.showMinTips=u;R.rePosSidebar=X;b.read=h.readCookie;b.save=h.saveCookie;h.domReady(function(){var U=b.read(b.cn_acookie);if(U){return f()}h.reqByImage(B.url_acookie,f)});var f=function(){var al=N("oPMWebIM");if(al){var U=h.getUrlParameterMap(al.src);B.sellerId=U.sid;B.fromSite=U.site}if(!B.sellerId){return e.error("页面卖家id（sellerId）为空，程序无法继续运行！")}var ak=String.format(B.url_jsserver+"?sellerId={0}",B.sellerId);e.log("访问["+ak+"]");h.reqByScript(ak,b.cd_name_itbu,function(am){if(!am||!am.cna||!am.vid||am.errorCode){return e.error("访问["+ak+"]失败！JSServer返回值："+m.stringify(am))}e.log("JSServer返回值："+m.stringify(am));if(am.isWhite!=="y"){return e.log("非白名单用户不加载WebIM！")}B.siteId=am.siteId;B.ipAddress=am.ipAddress;B.receiptWwId=h.decode(am.receiptWwId);B.receiptName=h.decode(am.receiptName||am.receiptWwId);b.cna=am.cna;b.vid=am.vid;b.slid=am.slid||"";b.lastCnalibabaId=am.lastCnalibabaId;l.sex=h.decode(am.sex);l.name=h.decode(am.name);l.area=h.decode(am.area);l.phone=h.decode(am.phone);l.email=h.decode(am.email);l.mobile=h.decode(am.mobile);l.company=h.decode(am.corpName);l.slid=b.slid;l.lastLoginWWId=am.lastCnalibabaId;ad.unsayI=h.decode(am.unsayI);ad.Initiative=h.decode(am.Initiative);ad.autoWelcome=h.decode(am.autoWelcome);ad.unsayVisitor=h.decode(am.unsayVisitor);ad.sellerOffline=h.decode(am.offLineReceive);h.extend(am.epConfig,ag);ag.adminMemberId=am.epConfig.adminMemberId||B.sellerId;q()})};var q=function(){var ak=location.hostname,al=/^(?:www\.)/;if(al.test(ak)){ak="."+ak.replace(al,"")}if(!(/(?:\.alibaba\.com)$/.test(ak))){if(!b.read(b.cn_acookie)){b.save(b.cn_acookie,b.cna,ak,"/",b.expires)}}if(!b.lastCnalibabaId){var U=b.url_alisoft_getcookie;e.log("访问["+U+"]！");h.reqByScript(U,b.cd_name_alisoft,function(an){if(an){an=h.decode(an);var am=new RegExp(b.cn_last_login_ww+"=([^|]+)");if(am.test(an)){b.lastLoginWWId=h.decode(RegExp.$1)}}e.log("访问["+U+"]！返回值："+an);ae()})}else{if(unescape(b.lastCnalibabaId).indexOf(":")>=0){b.lastCnalibabaId=b.lastLoginWWId=l.lastLoginWWId=""}ae()}};var ae=function(){var ak={p:"fixed",x:0,y:0};if(h.isIE6){var U=h.clientViewArea();ak.p="absolute";ak.x=U.scrollLeft;ak.y=U.scrollTop}w.create({id:R.socket_flash_id,src:R.socket_flash_swf,flashVars:R.socket_flash_vars,wmode:"window",containerStyle:String.format("overflow:hidden; height:1px; width:1px; position:{0}; left:{1}px; top:{2}px; z-index:10000;",ak.p,ak.x,ak.y+2),titleBarStyle:"display:none;"});w.create({id:R.manager_flash_id,src:R.manager_flash_swf,flashVars:R.manager_flash_vars+"&corpId="+B.sellerId+"&siteId="+B.siteId,wmode:"window",containerStyle:String.format("overflow:hidden; height:1px; width:1px; position:{0}; left:{1}px; top:{2}px; z-index:10000;",ak.p,ak.x,ak.y+1),titleBarStyle:"display:none;"});w.create({id:R.chat_flash_id,src:R.chat_flash_swf,flashVars:R.chat_flash_vars+"&corpId="+B.sellerId+"&siteId="+B.siteId+"&vid="+b.vid,wmode:"window",containerStyle:String.format("overflow:hidden; height:1px; width:1px; position:{0}; left:{1}px; top:{2}px; z-index:10000;",ak.p,ak.x,ak.y),titleBarStyle:"overflow:hidden; height:31px; width:353px; background:transparent url("+y+"/images/itbu/pm/jsserver/webIM_title.gif?v=20111201) no-repeat scroll 0px 0px; cursor:move; -moz-user-select:none; font-size:12px;",titleTxtStyle:"overflow:hidden; height:31px; width:260px; position:absolute; left:33px; -moz-user-select:none; white-space:nowrap; text-overflow:ellipsis; text-align:left; vertical-align:middle; line-height:31px;",closeButtonStyle:"overflow:hidden; height:11px; width:11px; background:transparent url("+y+"/images/itbu/pm/jsserver/v2/webim/close.gif?v=20111201) no-repeat scroll 0px 0px; position:absolute; right:5px; top:5px; cursor:pointer;",objectDivStyle:"background:transparent url("+y+"/images/itbu/pm/jsserver/bg.gif?v=20111201) no-repeat scroll -1px -1px; position:relative;"});e.log("正在加载flash！");(function(){if(!R.socketFlash||!R.mgrFlash){return setTimeout(arguments.callee,333)}if(!R.chatFlash){R.chatFlash=N(R.chat_flash_id)}if(!R.container){R.container=N(R.chatFlash.parentNode.parentNode)}if(!R.chatFlash.setAutoMessages){return setTimeout(arguments.callee,333)}e.log("chat flash加载完成！");R.mgrFlash.startCheckMonitor();R.init();setTimeout(function(){if(R.isSocketPage&&!R.isOnLogined){return setTimeout(arguments.callee,333)}P();M.startListener(B.sellerId,B.siteId,b.vid,B.accessLogId,B.receiptWwId,B.receiptName,B.fromSite)},333)})()};var M=(function(){var ao=["first","enter","leaveSite","leavePage","probeAction","chat","reConnect","updateVisitor","tipsAction"],an={},am={},ak;for(var al=0,U=ao.length;al<U;al++){ak=ao[al];an[ak]=[];am[ak]=(function(ap){return function(au){var ar=an[ap];if(typeof(au)=="function"){ar.push(au)}else{for(var at=0,aq=ar.length;at<aq;at++){(ar[at]).apply(am,arguments)}}}})(ak)}am.startListener=function(au,ap,av,aq,aw,ax,at){var ay=this;if(b.is_first_visited=="n"){ay.enter(au,ap,av,aq,aw,ax,at)}else{ay.first(au,ap,av,aq,aw,ax,at)}var ar=document.body;ar.onunload=window.onunload=window.onbeforeunload=function(){ar=ar.onunload=window.onunload=window.onbeforeunload=null;ay.leavePage(au,ap,av,B.accessLogId);R.chatFlash.deleteWebImName();R.mgrFlash.closeAllLocalConnection();R.socketFlash.closeAllLocalConnection();for(var az=0,aA="";az<1000;az++,aA+="blocking"){}}};return am})();M.first(function(ak,aq,U,am,ap,ao,an){e.log("发送 firstEnter 事件消息！");var al={};al[R.pNames.event]=R.eTypes.first_enter;al[R.pNames.cna]=b.cna;al[R.pNames.sellerId]=ak;al[R.pNames.siteId]=aq;al[R.pNames.vid]=U;al[R.pNames.slid]=b.slid;al[R.pNames.loginId]=b.lastCnalibabaId||b.lastLoginWWId;al[R.pNames.pageUrl]=h.encode(location.href);al[R.pNames.fromUrl]=h.encode(document.referrer);al[R.pNames.title]=h.encode(document.title);al[R.pNames.fromSite]=B.fromSiteMap[an]||1;al[R.pNames.visitorIp]=B.ipAddress;al[R.pNames.receiptWwId]=ap;al.webImName=R.name;al.receiptName=h.encode(ao);x(ak,aq,U,am,R.name,al)});M.enter(function(ak,aq,U,am,ap,ao,an){e.log("发送 enter 事件消息！");var al={};al[R.pNames.event]=R.eTypes.enter;al[R.pNames.cna]=b.cna;al[R.pNames.sellerId]=ak;al[R.pNames.siteId]=aq;al[R.pNames.vid]=U;al[R.pNames.slid]=b.slid;al[R.pNames.loginId]=b.lastCnalibabaId||b.lastLoginWWId;al[R.pNames.pageUrl]=h.encode(location.href);al[R.pNames.fromUrl]=h.encode(document.referrer);al[R.pNames.title]=h.encode(document.title);al[R.pNames.fromSite]=B.fromSiteMap[an]||1;al[R.pNames.visitorIp]=B.ipAddress;al[R.pNames.receiptWwId]=ap;al.webImName=R.name;al.receiptName=h.encode(ao);x(ak,aq,U,am,R.name,al)});M.leavePage(function(ak,an,U,am){var al={};al[R.pNames.event]=R.eTypes.leave_page;al[R.pNames.cna]=b.cna;al[R.pNames.sellerId]=ak;al[R.pNames.siteId]=an;al[R.pNames.vid]=U;al[R.pNames.accessLogId]=am;x(ak,an,U,am,"",al)});M.leaveSite(function(ak,an,U,am){ah(ak+":"+U);var al={};al[R.pNames.event]=R.eTypes.leave_site;al[R.pNames.cna]=b.cna;al[R.pNames.sellerId]=ak;al[R.pNames.siteId]=an;al[R.pNames.vid]=U;x(ak,an,U,am,"",al)});M.reConnect(function(ak,an,U,am){var al={};al[R.pNames.event]=R.eTypes.resume_conn;al[R.pNames.cna]=b.cna;al[R.pNames.sellerId]=ak;al[R.pNames.siteId]=an;al[R.pNames.vid]=U;al[R.pNames.accessLogId]=am;x(ak,an,U,am,"",al)});M.probeAction(function(ak,ap,U,am,ao,an){var al={};al[R.pNames.event]=R.eTypes.probe_action;al[R.pNames.cna]=b.cna;al[R.pNames.sellerId]=ak;al[R.pNames.siteId]=ap;al[R.pNames.vid]=U;al[R.pNames.accessLogId]=am;al[R.pNames.probe_action]=ao;al[R.pNames.receiptWwId]=an;x(ak,ap,U,am,"",al)});M.tipsAction(function(ak,ap,U,am,ao,an){var al={};al[R.pNames.event]=R.eTypes.tips_action;al[R.pNames.cna]=b.cna;al[R.pNames.sellerId]=ak;al[R.pNames.siteId]=ap;al[R.pNames.vid]=U;al[R.pNames.accessLogId]=am;al[R.pNames.tips_action]=ao;al[R.pNames.receiptWwId]=an;x(ak,ap,U,am,"",al)});M.updateVisitor(function(ak,ap,U,ao,aq,am,al){var an={};an[R.pNames.event]=R.eTypes.update_visitor;an[R.pNames.cna]=b.cna;an[R.pNames.sellerId]=ak;an[R.pNames.siteId]=ap;an[R.pNames.vid]=U;an[R.pNames.slid]=al.slid||b.slid;an[R.pNames.loginId]=al.lastLoginWWId||b.lastCnalibabaId||b.lastLoginWWId;an[R.pNames.isNeedUpdate]="y";an[R.pNames.isAnonymous]=al.isHide;an[R.pNames.visitorName]=h.encode(al.name);an[R.pNames.visitorSex]=h.encode(al.sex||l.sex);an[R.pNames.visitorPhone]=h.encode(al.phone);an[R.pNames.visitorMobile]=h.encode(al.mobile);an[R.pNames.visitorEmail]=h.encode(al.email);an[R.pNames.visitorCompany]=h.encode(al.company);an[R.pNames.visitorArea]=h.encode(al.area||l.area);x(ak,ap,U,ao,"",an)});M.chat(function(ao,ak,aq,ap,al,U,ar,an){var am={};am[R.pNames.event]=R.eTypes.contact;am[R.pNames.cna]=b.cna;am[R.pNames.sellerId]=ao;am[R.pNames.siteId]=ak;am[R.pNames.vid]=aq;am[R.pNames.toId]=U?U.join(","):"";am[R.pNames.slid]=ar.slid||b.slid;am[R.pNames.loginId]=ar.lastLoginWWId||b.lastCnalibabaId||b.lastLoginWWId;am[R.pNames.content]=h.encode(al);am[R.pNames.isNeedUpdate]="y";am[R.pNames.isAnonymous]=ar.isHide;am[R.pNames.visitorName]=h.encode(ar.name);am[R.pNames.visitorSex]=h.encode(ar.sex||l.sex);am[R.pNames.visitorPhone]=h.encode(ar.phone);am[R.pNames.visitorMobile]=h.encode(ar.mobile);am[R.pNames.visitorEmail]=h.encode(ar.email);am[R.pNames.visitorCompany]=h.encode(ar.company);am[R.pNames.visitorArea]=h.encode(ar.area||l.area);A.put(an,m.stringify(am))});window.__itbu_sendMessage__=function(am,ao,ak,aq,ap,ar,al,U,at){if(am==2&&!ap){return}e.log("window.__itbu_sendMessage__","eType="+am,"event="+(am==0?"contact":am==1?"leaveSite":am==2?"reConnect":am==3?"probeEvent":am==4?"updateVisitor":"unknow"),"sellerId="+ao,"siteId="+ak,"vid="+aq,"accessLogId="+ap,"WebImName="+ar,"msg="+al,"toIds="+m.stringify(U),"cardObj="+m.stringify(at));switch(am){case 0:aj("ekf_front_sendmessage");var an=R.newMsgID();M.chat(ao,ak,aq,ap,al,U,at,an);G(aq,R.sender_visitor,h.htmlEncode(al),"","");return{eventType:R.eTypes.contact,msgId:an,msgContent:A.get(an)};case 1:M.leaveSite(ao,ak,aq,ap);break;case 2:M.reConnect(ao,ak,aq,ap);break;case 3:d(A.put(R.newMsgID(),al));break;case 4:M.updateVisitor(ao,ak,aq,ap,al,U,at);break}};window.__itbu_onDataSent__=function(ap,ar){var ao=m.parse(A.get(ap)),am=ao[R.pNames.event],ax=ao[R.pNames.vid];e.log("window.__itbu_onDataSent__","event="+am,"dataId="+ap,"send_msg="+A.get(ap),"res_data="+ar);A.remove(ap);if(am==R.eTypes.contact){var aA;if(ar){var ak=m.parse(ar);if(ak.code!="0"){if(ak.code=="2"){aA="（发送失败，您发送的内容中含有敏感词）"}else{aA="（发送失败）"}}}else{aA="（发送失败）"}if(aA){G(ax,R.sender_visitor,h.decode(ao[R.pNames.content])+aA,"","")}return}if((am==R.eTypes.first_enter||am==R.eTypes.enter)&&ar){var ak=m.parse(ar),U=ak.receiptUsers||[],at=ak.offlineMsgs,az=(ak.showInvitation=="true"),aw=(at&&at.length),ay=h.decode(ao.receiptName),av=h.decode(ak.autoWelcomeWord),al=h.decode(ak.offerUrl),an,au="";R.chatFlash.setAccessLogId(ao.webImName,(B.accessLogId=ak.accesslogId));for(var aq=0;aq<U.length;aq++){an=U[aq];if(!au){au=h.decode(an.userName)}R.chatFlash.addSellerInfo({vid:ax,sellerWWId:an.wwId,sellerName:h.decode(an.userName)})}if(!au&&ay){au=ay}if(aw){return aa(at)}if(az&&(av||al)){G(ax,String.format(R.sender_seller,au),av+" "+al,"","invite")}}};window.__itbu_onDataReceived__=function(U){e.log("window.__itbu_onDataReceived__","wangwang_data="+U);if(!U){return}var al=m.parse(U),ak=al.msg?h.decode(al.msg):"";if(B.regexps.inputStatus.test(ak)){return}e.log("window.__itbu_onDataReceived__","wangwang_msg="+ak);ak=ak.replace(B.regexps.filterSizeAttr,"");ak=ak.replace(B.regexps.filterImgTag,"<br/>");G(al.toId,String.format(R.sender_seller,h.decode(al.fromName)),ak,"",al.msgType||"")};window.__itbu_openWebIM__=function(U){var ak=R.chatFlash;if(!ak){return e.warn("打开WebIM失败，WebIM.chatFlash还没有加载完成！")}if(!ak.openWebIm){return e.warn("打开WebIM失败，WebIM.chatFlash.openWebIm方法为空！")}if(U){e.log("window.__itbu_openWebIM__","旺旺ID: "+U.uid,"旺旺name: "+U.sellerName);ak.addSellerInfo({vid:b.vid,sellerWWId:U.uid,sellerName:U.sellerName||U.uid})}ak.openWebIm();aj("jzyx_alitalkonlie_click")};window.__itbu_page_webImStatusCallBack__=function(U){e.log("window.__itbu_page_webImStatusCallBack__","status="+U);if(R.status==3){R.pos._dd=undefined}switch(R.status=U){case 0:R.show();M.probeAction(B.sellerId,B.siteId,b.vid,B.accessLogId,"show",B.receiptWwId);break;case 1:R.hide();break;case 2:R.hide();R.status=1;R.showMinTips();break;case 3:R.showMaxTips();break}};window.__itbu_page_WebImHasOpened__=function(U){e.log("window.__itbu_page_WebImHasOpened__","是否显示WebIM："+U,"WebIM.status："+R.status);if(U){if(R.status==0){R.show()}else{R.status=3;R.showMaxTips()}}else{R.hide()}};window.__itbu_page_unReadMessage__=function(ak){if(!ak){return e.warn("window.__itbu_page_unReadMessage__","参数为空！")}e.log("window.__itbu_page_unReadMessage__","未读消息："+m.stringify(ak));if(ak.isNotifyShow=="y"){var U=ak.chatContent;U=U.replace(/face=\".*?\"/gi,"");U=U.replace(/color=\".*?\"/gi,"");R.showMaxTips({ic:ak.unReadMessageCount,wwName:ak.sellerName,msgDate:ak.receieveTime,txt:U});aj("ekf_front_outmessage")}else{R.showMinTips(ak.unReadMessageCount)}};window.__itbu_page_setWebImName__=function(U){e.log("window.__itbu_page_setWebImName__","WebIm标识符："+U);R.name=U};window.__itbu_setWebImTitle__=function(U){e.log("window.__itbu_setWebImTitle__","WebIM标题："+U);t(U)};window.__itbu_setBrowerTitle__=function(U){e.log("window.__itbu_setBrowerTitle__","文档标题："+U);if(document.title!==U){document.title=U}};window.__itbu_onLogined__=function(U){if(!B._isNoSendTracelog){B._isNoSendTracelog=1;aj(String.format("jzyx_webim_cna[{0}]_logined",b.cna))}e.log("window.__itbu_onLogined__",U);R.isOnLogined=true;R.mgrFlash.reConnected();return 0};window.__itbu_onLogouted__=function(){R.isOnLogined=false};window.__itbu_startSocket__=function(){aj(String.format("jzyx_webim_cna[{0}]_startSocket",b.cna));e.log("window.__itbu_startSocket__");R.isSocketPage=true;R.socketFlash.__start()};window.__itbu_stopSocket__=function(){R.socketFlash.__stop()};window.__itbu_socket_flash_onReady__=function(){e.log("window.__itbu_socket_flash_onReady__","socket flash加载完成！");R.socketFlash=N(R.socket_flash_id)};window.__itbu_manager_flash_onReady__=function(){e.log("window.__itbu_manager_flash_onReady__","manager flash加载完成！");R.mgrFlash=N(R.manager_flash_id)};window.__itbu_WebIM_setPosition__=function(){if(R.status!=1){L()}};window.__itbu_removeUnReadMsgTips__=function(){h.trigger(h.getByClassName(B.sidebar,"webim2_max_tips")[0],"click")};window.__itbu_sendmsg_feedback__=function(){if(B.isNeedFeedbackForSendMsg){B.isNeedFeedbackForSendMsg=false;I(E(),h.encode(location.href),B.receiptWwId)}};window.__itbu_clickInvitationState__=function(){aj("jzyx_ball_acceptinvation")};window.__itbu_clickSaveVisitorInfo__=function(){aj("jzyx_webim_modifynamecard")};window.__itbu_clickAnonymousNegotiate__=function(){aj("jzyx_webim_anounymous")};window.__itbu_replySellerMessage__=function(){aj("pm_respond_seller_message")};window.__itbu_systemMessage__=function(){aj("pm_receive_system_message")};function j(){ab();p();e.log("JSServer取到的访客信息："+m.stringify(l));e.log("JSServer取到的自动应答信息："+m.stringify(ad));try{var ak=R.chatFlash;ak.setVisitorInfo(l);ak.letJSInitWebIm();ak.setBrowerTitleForFlash(document.title);ak.setAutoMessages(ad);if(B.receiptWwId){ak.addSellerInfo({vid:b.vid,sellerWWId:B.receiptWwId,sellerName:B.receiptName})}}catch(U){e.warn("WebIM基础信息设置失败，接口调用异常！Error: "+U.message)}}function ab(){if(h.isIE6){var ak=(h.clientViewArea().isStandard?document.documentElement:document.body);ak.style.overflowX="hidden"}h.addStyleSheet(B.url_webim_css);O();D();if(Z.isHighResolution()){B.sidebarDisplayState=B.sidebar_state.EXPANDS}else{B.sidebarDisplayState=B.sidebar_state.COLLAPSED}if(B.sidebarDisplayState===B.sidebar_state.EXPANDS){B.sidebar.style.right="0px"}else{B.sidebar.style.right="-155px";var an=h.getByClassName(B.sidebar,"webim2_bar")[0];an.style.left="-28px";an.style.display="block";var ar=h.getByClassName(B.sidebar,"webim2_tips")[0];ar.style.left=-118-28+"px"}var an=h.getByClassName(B.sidebar,"webim2_bar")[0];h.on(an,"click",function(av){h.stopPropagation(av);var aw=h.getByClassName(B.sidebar,"webim2_tips")[0];h.elAnimate(an,"left",0,200);h.elAnimate(aw,"left",-118,200,function(){an.style.display="none";h.elAnimate(B.sidebar,"right",0,200)});aj("jzyx_ball_unfold");window.__itbu_openWebIM__()});var ao=h.getByClassName(B.sidebar,"webim2_title_btn")[0];h.on(ao,"click",function(av){h.stopPropagation(av);h.elAnimate(B.sidebar,"right",-155,200,function(){var aw=h.getByClassName(B.sidebar,"webim2_bar")[0];var ax=h.getByClassName(B.sidebar,"webim2_tips")[0];aw.style.display="block";h.elAnimate(aw,"left",-28,200);h.elAnimate(ax,"left",-118-28,200)});aj("jzyx_ball_fold")});var ap=h.getByClassName(B.sidebar,"webim2_max_tips")[0];h.on(ap,"click",function(av){h.stopPropagation(av);window.__itbu_openWebIM__();aj("ekf_front_max_tips_clickmessage");M.tipsAction(B.sellerId,B.siteId,b.vid,B.accessLogId,"hide",B.receiptWwId)});var au=h.getByClassName(B.sidebar,"webim2_min_tips")[0];h.on(au,"click",function(av){h.stopPropagation(av);window.__itbu_openWebIM__();aj("ekf_front_min_tips_clickmessage");M.tipsAction(B.sellerId,B.siteId,b.vid,B.accessLogId,"hide",B.receiptWwId)});var al=h.getByClassName(B.sidebar,"webim2_welcomeword")[0];h.on(al,"click",function(av){h.stopPropagation(av);window.__itbu_openWebIM__();aj("jzyx_welcomeword_click")});var aq=h.getByClassName(B.sidebar,"webim2_button_qt")[0];h.on(aq,"click",function(av){h.stopPropagation(av);window.__itbu_openWebIM__();aj("jzyx_ljqt_click")});var U=h.getByClassName(B.sidebar,"webim2_max_tips_cls")[0];h.on(U,"click",function(av){h.stopPropagation(av);R.showMinTips();try{R.chatFlash.closeProbeForJS()}catch(aw){e.warn("WebIM.chatFlash.closeProbeForJS为空！")}aj("ekf_front_closemessage");M.tipsAction(B.sellerId,B.siteId,b.vid,B.accessLogId,"min",B.receiptWwId)});var am=function(){if(V.blockCounter>0){return setTimeout(am,333)}B.sidebar.style.display="block";X()};a(am);var at=y+"/js/itbu/pm/jsserver/plugins/";V.load(B,[{name:"setup_navi",url:at+"qyzx_setup_navi.js?v=20111201",condition:af,block:true},{name:"dazzle_card",url:at+"qyzx_dazzle_card.js?v=20111201",condition:s,block:true},{name:"free_phone",url:at+"qyzx_free_phone.js?v=20111201",condition:o,block:true}])}function O(){H();var ak="oWebIM2_Slider2",U="点此可以免费打电话给卖家，沟通更快速。";var al=document.createElement("div");al.innerHTML=('<div class="webim2 webim2_'+ag.color+'" id="'+ak+'">  <div class="webim2_static">    <div class="webim2_title">      <div class="webim2_title_btn"></div>    </div>    <div class="webim2_welcomeword"><div>&nbsp;</div></div>    <div class="webim2_free_phone_tips"><div>'+U+'</div></div>    <div class="webim2_arrow"></div>    <div class="webim2_button_qt"></div>    <div class="webim2_free_phone_button" id="oWebIM2FreePhoneButton"></div>  </div>  <div class="webim2_contacts"></div>  <div class="webim2_footer"></div>  <div class="webim2_bar">    <div class="webim2_bar_btn"></div>    <div class="webim2_bar_txt"></div>  </div>  <div class="webim2_tips">    <div class="webim2_max_tips">      <div class="webim2_max_tips_box">        <div class="webim2_max_tips_ttl">来自卖家的未读消息：共<span>0</span>条。<a>点击查看</a></div>        <div class="webim2_max_tips_from">&nbsp;</div>        <div class="webim2_max_tips_text">          <div class="webim2_max_tips_marquee">&nbsp;</div>        </div>      </div>      <div class="webim2_max_tips_cls"></div>      <div class="webim2_max_tips_ljhf"></div>    </div>    <div class="webim2_min_tips">      <div><span>0</span>条未读消息</div>    </div>  </div></div>');document.body.appendChild(al.firstChild);B.sidebar=N(ak)}function a(aq){var U=ag;var an=h.htmlEncode(h.decode(U.welcomeWords)||"您好，欢迎新老客户咨询洽谈！");if(an.getByteLength()>41){an=String.ellipsis(an,41)}var ak=h.getByClassName(B.sidebar,"webim2_welcomeword")[0];ak.innerHTML="<div>"+an+"</div>";var ap=[],ar=/^cnalichn/;h.each(U.contacts,function(au,at){ap[at]=(ar.test(au.memberId)?au.memberId:"cnalichn"+au.memberId)});var ao="rnd"+h.randomGUID();window[ao]=function(at){window[ao]=null;if(!at||at.success!==true){return e.warn("请求企业在线接待人员在线状态失败！")}am(at.data)};h.reqByScript(String.format(B.url_ww_online,ao,ap.join(";")));function am(av){var at,au=[];h.each(U.contacts,function(ay,ax){at=av[ax];ay.online=at;at=(at==0||at==2||at==3||at==6?0:at==1?1:at==4||at==5?2:0);ay.name=al(h.decode(ay.name));ay.jobTitle=al(h.decode(ay.jobTitle));au[ax]=String.format('<div class="webim2_contact {1}" id="{0}"><div class="{2}"></div><span class="webim2_name">{3}</span></div>',("id_"+ax+"_"+ay.memberId),(ax===0?"webim2_clr1":at===1?"webim2_clr2":"webim2_clr3"),(at===0?"webim2_wwdown":at===1?"webim2_wwon":"webim2_wwmobile"),String.ellipsis(h.htmlEncode(ay.name+" "+(ay.jobTitle||"")),16))});h.getByClassName(B.sidebar,"webim2_contacts")[0].innerHTML=au.join("");var aw=function(ax,ay){h.stopPropagation(ax);var az=U.contacts[parseInt(ay.id.replace(/^id_(\d+)_.+$/,"$1"),10)];J(az);g(az.memberId);aj("ekf_front_clickcontact")};h.each(h.getByClassName(B.sidebar,"webim2_contact"),function(ax){h.on(ax.firstChild,"click",function(ay){aw(ay,ax)});h.on(ax.lastChild,"click",function(ay){aw(ay,ax)})});if(aq){aq()}}function al(at){return at.replace(/\u0000/g,"").replace(/\u0022/g,'"').replace(/\u0027/g,"'")}}function D(){var U=function(){X();window.__itbu_WebIM_setPosition__()};if(h.isIE6){h.on(window,"scroll",U)}h.on(window,"resize",U);h.on(window,"unload",function(){h.un(window,"unload",arguments.callee);h.un(window,"scroll",U);h.un(window,"resize",U)})}function X(){B.sidebar.style.bottom="auto";B.sidebar.style.bottom=c()-30+"px"}function c(){if(B.sidebarPosition==1){var U=h.clientViewArea();return Math.round((U.height-B.sidebar.offsetHeight)/2)}return 100}function F(){R.hideMaxTips();R.container.style.height=R.height+32+"px";R.container.style.width=R.width+"px";L();R.chatFlash.style.height=R.height+"px";R.chatFlash.style.width=R.width+"px"}function K(){R.chatFlash.style.height="1px";R.chatFlash.style.width="1px";var U=R.container.style;U.height="1px";U.width="1px";setTimeout(function(){if(U.position=="fixed"){U.left="0px";U.top="0px"}else{var ak=h.clientViewArea();U.left=ak.scrollLeft+"px";U.top=ak.scrollTop+"px"}},50)}function d(ak){var U=R.socketFlash.__addData(ak,A.get(ak));if(U==-2){setTimeout(function(){d(ak)},100)}}function x(ak,ao,U,am,an,al){R.mgrFlash.sendData(3,ak,ao,U,am,an,m.stringify(al))}function G(U,am,an,al,ak){R.mgrFlash.receieveDataFromServer(U,am,an,al,ak)}function aa(U){h.each(U,function(al){var ak=h.decode(al.msg);ak=ak.replace(B.regexps.filterSizeAttr,"");ak=ak.replace(B.regexps.filterImgTag,"<br/>");G(al.toId,String.format(R.sender_seller,h.decode(al.fromName)),ak,al.time||"","")})}function L(){var ak=R.pos;if(ak._dd){h.setPosition(R.container,ak.x,ak.y)}else{ak._dd=1;var U=h.setPosition(R.container,"rb",166,120);ak.x=U.x;ak.y=U.y}}function z(U){var al=h.getByClassName(B.sidebar,"webim2_max_tips")[0],ar=h.getByClassName(B.sidebar,"webim2_min_tips")[0],ak=h.getByClassName(al,"webim2_max_tips_ttl")[0],ao=h.getByClassName(al,"webim2_max_tips_from")[0],ap=h.getByClassName(al,"webim2_max_tips_text")[0];al.style.display="block";ar.style.display="none";if(U){var am=h.stripTags(U.wwName);var an=U.msgDate||"";if(an){an=" ("+an.split(" ")[1]+")"}var aq=h.htmlDecode(h.stripTags(U.txt));ak.innerHTML="来自卖家的未读消息：共<span>"+U.ic+"</span>条。<a>点击查看</a>";ao.innerHTML=String.ellipsis(am,12,true)+an;S(ap,h.htmlEncode2(aq));ar.innerHTML="<div><span>"+U.ic+"</span>条未读消息</div>"}else{e.warn("调用showMaxTips，参数为空！内容有可能显示不正确！")}M.tipsAction(B.sellerId,B.siteId,b.vid,B.accessLogId,"max",B.receiptWwId)}function u(U){var al=h.getByClassName(B.sidebar,"webim2_max_tips")[0],ak=h.getByClassName(B.sidebar,"webim2_min_tips")[0];al.style.display="none";ak.style.display="block";if(U!=null){ak.innerHTML="<div><span>"+U+"</span>条未读消息</div>"}}function W(){var ak=h.getByClassName(B.sidebar,"webim2_max_tips")[0],U=h.getByClassName(B.sidebar,"webim2_min_tips")[0];ak.style.display="none";U.style.display="none"}function t(U){var ak=R.container.firstChild;if(ak.nodeType!=1){ak=ak.nextSibling}var al=ak.firstChild;if(al.nodeType!=1){al=al.nextSibling}if(al.firstChild){al.removeChild(al.firstChild)}al.appendChild(document.createTextNode(U));al.title=U}function p(){var U=R.container.firstChild;if(U.nodeType!=1){U=U.nextSibling}var ak=U.lastChild;if(ak.nodeType!=1){ak=ak.previousSibling}h.dragDrop(R.container,N(U),R.pos);h.on(ak,"mousedown",h.stopPropagation);h.on(ak,"mouseup",function(al){h.stopPropagation(al);if(R.chatFlash.closeWebImForJS){R.chatFlash.closeWebImForJS()}else{e.warn("关闭WebIM失败，WebIM.chatFlash.closeWebImForJS方法为空！")}M.probeAction(B.sellerId,B.siteId,b.vid,B.accessLogId,"hide",B.receiptWwId);aj("jzyx_webim_closed");B.isNeedFeedbackForSendMsg=true})}function r(al){var ak=b.read(b.cn_is_first_visited);if(ak){var U=ak.split("|");if(U.length>=b.limit_count_visitor_list){U.splice(0,1)}U.push(al);ak=U.join("|")}else{ak=al}b.save(b.cn_is_first_visited,ak,b.domain_china_alibaba_com,"/")}function ah(ak){if(!(new RegExp(b.domain_china_alibaba_com)).test(location.hostname)){return}var U=b.read(b.cn_is_first_visited);if(U.indexOf(ak)==-1){return}if((new RegExp(ak+"$")).test(U)){U=U.replace(new RegExp("\\|?"+ak),"")}else{U=U.replace(new RegExp(ak+"\\|?"),"")}b.save(b.cn_is_first_visited,U,b.domain_china_alibaba_com,"/")}function P(){if(location.hostname===b.domain_offerdetail||location.hostname===b.domain_detailp4p||Q()){var U=b.read(b.cn_is_first_visited),an=B.sellerId+":"+b.vid;if(U.indexOf(an)!=-1){b.is_first_visited="n"}else{r(an)}}else{var al=location.hostname,am=/^(?:www\.)/;if(am.test(al)){al="."+al.replace(am,"")}b.is_first_visited=b.read(b.cn_is_first_visited);if(!b.is_first_visited){b.save(b.cn_is_first_visited,"n",al,"/")}var ak=(new RegExp(b.domain_offerdetail+"$")).test(h.getUrlDomain(document.referrer));if(ak){b.is_first_visited="n"}}}function Q(){return(("http://"+b.domain_yellowpage+"/company")===("http://"+location.host+"/company"))}function aj(U){if(window.dmtrack&&dmtrack.tracelog){dmtrack.tracelog(U)}}function T(){if(window.self!=window.top){return 1}if(location.protocol==="file:"){return 2}var U=location.hostname;if(U==""){return 3}if(U==="localhost"||U==="127.0.0.1"){return 4}if(U==="translate.googleusercontent.com"){return 5}if(U==="crmcs.cn.alibaba-inc.com"){return 6}return 0}function g(al){if(B.fromSite!=="offerdetail"&&B.fromSite!=="cnalichn"){return}var ak=(b.lastCnalibabaId||b.lastLoginWWId||"");var U=String.format("http://interface.xp.china.alibaba.com/eq/enquiry/traceEnquiry.json?fromId={0}&toId={1}&receiveMemberId={2}&source=1&offerId=&cna={3}&_={4}",ak,B.sellerId,al,b.cna,(new Date()).getTime());h.reqByImage(U)}function I(ak,am,al){var U=("http://stat.china.alibaba.com/feedbackfromalitalk.html?type=jzyx_webim_sendmessage&online="+ak+"&refer="+am+"&step=SENDIM&toId="+al+"&fromId=notmember");h.reqByImage(U)}function H(){var U=ag.color;switch(U){case"red":U="brown";break;case"yellow":U="grey";break;case"purple":U="white";break;default:U=U||"blue"}ag.color=U}function J(U){if(n.canTalk()){return n.talk(U.memberId,U.online,"cnalichn",C(U))}window.__itbu_openWebIM__({uid:U.memberId,sellerName:U.name})}function C(ak){if(!window.getFeedbackStr){return""}var U={opt:{id:ak.memberId,online:ak.online}};return getFeedbackStr(U,0)}function E(){var U=0;h.each(ag.contacts,function(ak){if(B.receiptWwId===ak.memberId){U=(ak.online===1?1:0);return false}});return U}function S(ao,ar){var al=ao.children[0],U=al.style,am=0,an=arguments.callee;clearInterval(an.timerId);U.left="0";al.innerHTML=ar;var ak=170,aq=Y(ar,14);if(aq>ak){setTimeout(function(){an.timerId=setInterval(ap,25)},1500);if(!al.onmouseover){al.onmouseover=function(){an.pause=true};al.onmouseout=function(){an.pause=false}}}function ap(){if(an.pause){return}if(--am<=-aq){am=ak}U.left=am+"px"}}function Y(am,al){var an=document.createElement("div"),ak=an.style,U;ak.display="block";ak.position="absolute";ak.visibility="hidden";ak.fontSize=(al||12)+"px";document.body.appendChild(an);an.innerHTML=am;U=an.offsetWidth;an.parentNode.removeChild(an);an=ak=null;return U}function af(ak){var U=(ag.adminMemberId===(b.lastCnalibabaId||b.lastLoginWWId));if(U){ak()}}function s(ak){var U=("http://itradeinf.china.alibaba.com/itrade/enterprise/checkSellerIsTpUser.htm?mid="+B.sellerId+"&prop=_ITU_ISTPUSER_");h.reqByScript(U,"_ITU_ISTPUSER_",function(al){if(al===true){ak()}})}function o(U){if(B.fromSite==="cnalichn"){return}U()}};
