document.write('');var define_url = "http://host10.123livehelp.com/html/"; var version = 3.2; var v = 0; if(urlLink==undefined){var urlLink;try{urlLink=window.location.href;}catch(e){try{urlLink=document.URL;}catch(e){urlLink="";}}} /********************for clear swf object when close the ie window start*********/ window.onunload=function(){try{var m=navigator.userAgent.toLowerCase().indexOf("msie")!=-1;if(m){var lh=document.getElementById('topcmm_123livehelp');livehelp.removeChild(lh);}}catch(e){}} /********************for clear swf object when close the ie window end*********/ var init_room; var init_url; var init_nickname; var init_preColor; var init_staff; var init_dc; var init_color; var init_dc_skin; var SELECT_NO_DC_NO_POPUP="You do not need to embed any code!"; var NOT_DISPLAY_ONLINE_STATUS="3"; //3 is the id for No Button var DISPLAY_ONLINE_STATUS_TEXT="4"; var CLIENT_ASSIGN_DEPT="1"; var CLIENT_ASSIGN_STAFF="2"; var CLIENT_STANDARD_EMBED_CODE=""; /**************************for open swf method start******************************/ function getParameter(arg){arg=(arg=="")?(arg+"?"):(arg+"&");return arg;} function openSWF(urlValue,widthValue,heightValue,divId,flashId) { init_room=""; var indexOfSWF=urlValue.indexOf('.swf'); var indexOfInterrogation=urlValue.indexOf('?'); var ieURL=""; var otherBrowserURL=""; var swfURL=""; var parameter=""; if(indexOfInterrogation!=-1) { swfURL=urlValue.substring(0,indexOfInterrogation); parameter=urlValue.substring(indexOfInterrogation); } else { swfURL=urlValue; } if(init_room!=undefined&¶meter.indexOf("init_room")==-1) { if(init_room!=0) { parameter=getParameter(parameter); parameter+="init_room="+init_room; } } if(init_url!=undefined&¶meter.indexOf("init_url")==-1) { parameter=getParameter(parameter); parameter+="init_url="+init_url; } if(init_nickname!=undefined&¶meter.indexOf("init_nickname")==-1) { parameter=getParameter(parameter); parameter+="init_nickname="+init_nickname; } if(init_preColor!=undefined&¶meter.indexOf("init_preColor")==-1) { parameter=getParameter(parameter); parameter+="init_preColor="+init_preColor; } if(init_staff!=undefined&¶meter.indexOf("init_staff")==-1) { parameter=getParameter(parameter); parameter+="init_staff="+init_staff; } if(init_dc!=undefined&¶meter.indexOf("init_dc")==-1) { parameter=getParameter(parameter); parameter+="init_dc="+init_dc; } if(indexOfSWF!=-1) { ieURL=swfURL.substring(0,indexOfSWF); otherBrowserURL=swfURL; } else { ieURL=swfURL; otherBrowserURL=swfURL+'.swf'; } if(init_color!=undefined&¶meter.indexOf("init_color")==-1) { parameter=getParameter(parameter); parameter+="init_color="+init_color; } if(urlValue.indexOf("dc.swf")!=-1) { parameter+="&footprint="+urlLink; if(typeof(define_url)!='undefined') { parameter+="&init_root="+define_url; } } ieURL=ieURL+parameter; otherBrowserURL=otherBrowserURL+parameter; var m=navigator.userAgent.toLowerCase().indexOf("msie")!=-1 if(m) //for ie, resolve the active swf problem { document.write('
'); AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,19,0','width',widthValue,'height',heightValue,'src',ieURL,'id',flashId,'quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie',ieURL,'name','topcmm_123livehelp','swfLiveConnect','true','wmode','opaque','AllowScriptAccess','always'); document.write('
'); } else { try { //if firefox use document.write(') to embed swf object, the browser will throw SetVariable is not a method exception document.write('
'); document.getElementById(divId).innerHTML=''; document.write('
'); } catch(e) { //can not use proxy document.write('
'); } } } /**************************for open swf method end******************************/ /*******************************Adobe method start******************************/ //v1.0 //Copyright 2006 Adobe Systems, Inc. All rights reserved. function AC_AddExtension(src, ext) { if (src.indexOf('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; } function AC_Generateobj(objAttrs, params, embedAttrs) { var str = ' '; str += ''; document.write(htmlcode); } function displayStatusText(assignType,assignId,onlineText,offlineText,clientHtmlUrl,win_width,win_height,init_url,init_room,init_nickname,init_preColor) { var htmlcode =""; if(getOnlineStatus(assignType,assignId)) { htmlcode=onlineText; } else { htmlcode=offlineText; } var functionStr="openClientInNewWindow('"+clientHtmlUrl+"','"+win_width+"','"+win_height+"','"+init_url+"','"+init_room+"','"+init_nickname+"','"+init_preColor+"');return false;"; htmlcode = ''+htmlcode+''; document.write(htmlcode); } function selectDC() { var button_type="0"; var buttonTypeLength=document.customForm.button_type.length; for(i=0;i'+deptList[i][0]; } else { document.getElementById("assign_dc_dept").innerHTML+=''+deptList[i][0]; } if(i>0 && i%7 ==0) { document.getElementById("assign_dc_dept").innerHTML+='
'; } } } function openClientInNewWindow(clientHtmlUrl,win_width,win_height,init_url,init_room,init_nickname,init_preColor) { if(win_width=="undefined"||win_width=="") { win_width=495; } if(win_height=="undefined"||win_height=="") { win_height=440; } var parameter=""; if(init_url=="undefined"||init_url=="") { init_url=urlLink; } parameter="?"; while(clientHtmlUrl.indexOf("?init_color")!=-1) { parameter="&"; break; } parameter+="init_url="+init_url; if(init_room!="undefined"&&init_room!="") { parameter=getParameter(parameter); parameter+="init_room="+init_room; } if(init_nickname!="undefined"&&init_nickname!="") { parameter=getParameter(parameter); parameter+="init_nickname="+init_nickname; } /*if(init_preColor!=undefined&&init_preColor!="") { parameter=getParameter(parameter); parameter+="init_preColor="+init_preColor; }*/ var urlStr=clientHtmlUrl+parameter; var win = window.open(urlStr, "123livehelp_client"+Math.round(Math.random()*1000), "resizable=1, width="+win_width+",height="+win_height+",status=1"); } //display status img end //generator code var CLIENT_HTML="client.html"; var LIVE_STATUS_JS="live_status.js"; var STYLE_CSS="style.css"; var MAIN_JS="123livehelp.js"; var ONLINE_JPG="img/online.jpg"; var OFFLINE_JPG="img/offline.jpg"; var ONLINE_1_JPG="img/online1.jpg"; var OFFLINE_1_JPG="img/offline1.jpg"; var ONLINE_2_JPG="img/online2.jpg"; var OFFLINE_2_JPG="img/offline2.jpg"; var DC_SWF="dc.swf"; //define the constat variable var BUTTON_TYPE_IMAGE="0"; var BUTTON_TYPE_TEXT="1"; var BUTTON_TYPE_NULL="-1"; var BUTTON_ASSIGN_NULL="0"; var BUTTON_ASSIGN_DEPT="1"; var BUTTON_ASSIGN_STAFF="2"; var INVIATION_STYLE_SLIDEDOWN=1; var INVIATION_STYLE_POPUP=0; var INVIATION_STYLE_BROWN=1; var INVIATION_STYLE_GREEN=2; var INVIATION_STYLE_RED=3; var INVIATION_STYLE_ORANAGE=4; var INVIATION_STYLE_BLUE=5; var INVIATION_STYLE_BLACK=6; var INVIATION_STYLE_VIOLET=7; var INVIATION_STYLE_CYAN=8; var INVIATION_STYLE_NULL=0; //define end var CLIENT_HTML_CODE_TEMPLATE=''; var CLIENT_STANDARD_EMBED_CODE=""; if(typeof(deptList)!='undefined'&&deptList.length!=0) { CLIENT_STANDARD_EMBED_CODE=generateCode("0","495","440","violet","0","0","1",deptList[0][1],"1",""); } else { //CLIENT_STANDARD_EMBED_CODE=generateCode("0","495","440","violet","0","0","0","0","1",""); } function generateCode(button_type,win_width,win_height,button_window_style,select_assign_type,assign_id,dc_skin,dc_dept,dc_app_type,url,onLineText,offLineText) { var rootUrl=urlLink.substring(0,urlLink.lastIndexOf('/')); var livestatusjs=LIVE_STATUS_JS; var styleCSS=STYLE_CSS; var mainjs=MAIN_JS; var online=ONLINE_JPG; var offline=OFFLINE_JPG; var dc=DC_SWF; var clientHtml=CLIENT_HTML+"?init_color="+button_window_style; var enableDC="true"; if(select_assign_type==CLIENT_ASSIGN_DEPT)//assign dept { clientHtml+='&init_room='+assign_id; } else if(select_assign_type==CLIENT_ASSIGN_STAFF)//assign staff { clientHtml+='&init_staff='+assign_id; } if(url!="") { rootUrl=url; } switch(button_type) { case '0': online=ONLINE_JPG; offline=OFFLINE_JPG; break; case '1': online=ONLINE_1_JPG; offline=OFFLINE_1_JPG; break; case '2': online=ONLINE_2_JPG; offline=OFFLINE_2_JPG; break; case '3': online=""; offline=""; break; case '4': online=onLineText; offline=offLineText; break; default: online=ONLINE_JPG; offline=OFFLINE_JPG; } if (win_width < 495) { alert("width can't be less than 495"); return CLIENT_STANDARD_EMBED_CODE; } if (win_height < 440) { alert("height can't be less than 440"); return CLIENT_STANDARD_EMBED_CODE; } var embedCode=CLIENT_HTML_CODE_TEMPLATE; var displayOnlineType=""; while(embedCode.indexOf("#displayStatusStyle#")!=-1) { if(typeof(onLineText)=='undefined'&&typeof(offLineText)=='undefined') { displayOnlineType="BUTTON_TYPE_IMAGE"; } else { displayOnlineType="BUTTON_TYPE_TEXT"; if(typeof(onLineText)=='undefined') { online=""; } else { online=onLineText; } if(typeof(offLineText)=='undefined') { offline="" } else { offline=offLineText; } } if(online==""&&offline=="") { displayOnlineType="BUTTON_TYPE_NULL"; } embedCode=embedCode.replace("#displayStatusStyle#",displayOnlineType); } while(embedCode.indexOf("#chatWindowSkin#")!=-1) { embedCode=embedCode.replace("#chatWindowSkin#",button_window_style); } while(embedCode.indexOf("#livestatusjs#")!=-1) { livestatusjs=rootUrl+'/'+livestatusjs; embedCode=embedCode.replace("#livestatusjs#",livestatusjs); } while(embedCode.indexOf("#styleCSS#")!=-1) { styleCSS=rootUrl+'/css/'+styleCSS; embedCode=embedCode.replace("#styleCSS#",styleCSS); } while(embedCode.indexOf("#mainjs#")!=-1) { mainjs=rootUrl+'/'+mainjs; embedCode=embedCode.replace("#mainjs#",mainjs); } if(displayOnlineType=="BUTTON_TYPE_IMAGE") { online=rootUrl+'/'+online; offline=rootUrl+'/'+offline; } while(embedCode.indexOf("#online#")!=-1) { embedCode=embedCode.replace("#online#",online); } while(embedCode.indexOf("#offline#")!=-1) { embedCode=embedCode.replace("#offline#",offline); } clientHtml=rootUrl+'/'+clientHtml; while(embedCode.indexOf("#clienthtmlurl#")!=-1) { embedCode=embedCode.replace("#clienthtmlurl#",clientHtml); } while(embedCode.indexOf("#width#")!=-1) { embedCode=embedCode.replace("#width#",win_width); } while(embedCode.indexOf("#height#")!=-1) { embedCode=embedCode.replace("#height#",win_height); } while(embedCode.indexOf("#define_url#")!=-1) { embedCode=embedCode.replace("#define_url#",rootUrl); } if(dc_skin==0) { enableDC="false"; } var dc_str=""; if(enableDC=="true") { if(dc_app_type==INVIATION_STYLE_SLIDEDOWN) { dc_str+="var invitation_popup_type=INVIATION_STYLE_SLIDEDOWN;\r\n"; } else { dc_str+="var invitation_popup_type=INVIATION_STYLE_POPUP;\r\n"; } var INVIATION_STYLE_BLUE=1; var dcSkinStr=""; switch(dc_skin) { case "1":dcSkinStr="INVIATION_STYLE_BROWN";break; case "2":dcSkinStr="INVIATION_STYLE_GREEN";break; case "3":dcSkinStr="INVIATION_STYLE_RED";break; case "4":dcSkinStr="INVIATION_STYLE_ORANAGE";break; case "5":dcSkinStr="INVIATION_STYLE_BLUE";break; case "6":dcSkinStr="INVIATION_STYLE_BLACK";break; case "7":dcSkinStr="INVIATION_STYLE_VIOLET";break; case "8":dcSkinStr="INVIATION_STYLE_CYAN";break; case "0":dcSkinStr="INVIATION_STYLE_NULL";break; } dc_str+="var invitation_skin="+dcSkinStr+";\r\n" dc_str+="var invitation_dept_id="+dc_dept+";\r\n" } while(embedCode.indexOf("#pre_dc#")!=-1) { embedCode=embedCode.replace("#pre_dc#",dc_str); } init_dc_skin=dc_skin; if(typeof(deptList)!="undefined"&&deptList.length==0) { enableDC="false"; } while(embedCode.indexOf("#enableDC#")!=-1) { embedCode=embedCode.replace("#enableDC#",enableDC); } var tempAssignType=""; while(embedCode.indexOf("#assigntype#")!=-1) { if(select_assign_type=="1") { tempAssignType="BUTTON_ASSIGN_DEPT" } else if(select_assign_type=="2") { tempAssignType="BUTTON_ASSIGN_STAFF"; } else { tempAssignType="BUTTON_ASSIGN_NULL"; } embedCode=embedCode.replace("#assigntype#",tempAssignType); } while(embedCode.indexOf("#pre_id#")!=-1) { var tempAssignStr=""; if(tempAssignType=="BUTTON_ASSIGN_STAFF") { tempAssignStr="var pre_staff_id=\""+assign_id+"\";\r\n"; } else if(tempAssignType=="BUTTON_ASSIGN_DEPT") { tempAssignStr="var pre_dept_id=\""+assign_id+"\";\r\n"; } else { tempAssignStr=""; } embedCode=embedCode.replace("#pre_id#",tempAssignStr); } while(embedCode.indexOf("#assignid#")!=-1) { embedCode=embedCode.replace("#assignid#",assign_id); } while(embedCode.indexOf("#dcappstyle#")!=-1) { } if(button_type==NOT_DISPLAY_ONLINE_STATUS&&(dc_skin=="0"||deptList.length==0)) { embedCode=SELECT_NO_DC_NO_POPUP; } return embedCode; } //generator code function getContentDocument(e) { if(e.contentDocument){return(e.contentDocument);}else if(e.contentWindow){return(e.contentWindow.document);}else if(e.document){return(e.document);}else{return(undefined);} } var documentjs={ getScripts:function(){ var retsrc=new Array(); for(var i=0;i0){ s=s.substr(s.indexOf('//')+2); retsrc[retsrc.length]=s.substr(s.indexOf('/')); }else{ retsrc[retsrc.length]=s; } } } return retsrc; }, isLoadedByName:function(jsname){ var js=documentjs.getScripts(); var f=false; for(var i=0;i \n'); document.write('on error resume next \n'); document.write('Sub lhclient_FSCommand(ByVal command, ByVal args)\n'); document.write(' call lhclient_DoFSCommand(command, args)\n'); document.write('end sub\n'); document.write(' \n'); } function lhclient_DoFSCommand(command, args) { if ((command == "123livehelp") && (args == "focus")) { focus(); } } //mehtods for demo page function generateEmbedCodeFromForm() { var button_type="0"; var buttonTypeLength=document.customForm.button_type.length; for(i=0;i'+deptList[i][0]+'
'; } else { document.getElementById("div_assign").innerHTML+=''+deptList[i][0]+'
'; } } } if(assignType==CLIENT_ASSIGN_STAFF)//pre select Dept { if(staffList.length==0) { document.getElementById("div_assign").innerHTML+='There is no staff.Please add one in admin panel.' } for(i=0;i'+staffList[i]+'
'; } else { document.getElementById("div_assign").innerHTML+=''+staffList[i]+'
'; } } } } function openCustomClient1() { var win_width = document.customForm.win_width.value; var win_height = document.customForm.win_height.value; if (win_width < 495) { alert("width can't be less than 495"); return; } if (win_height < 440) { alert("height can't be less than 440"); return; } var window_type="green"; var window_typeTypeLength=document.customForm.button_window_style.length; for(i=0;i FC_lastX){ FC_lastX = FC_lastX + FC_delayspeed + c; } if (document.documentElement.scrollLeft + FC_floatX < FC_lastX){ FC_lastX = FC_lastX - FC_delayspeed - c; } if (document.documentElement.scrollTop + FC_floatY > FC_lastY){ FC_lastY = FC_lastY + FC_delayspeed + c; } if (document.documentElement.scrollTop + FC_floatY < FC_lastY){ FC_lastY = FC_lastY - FC_delayspeed - c; } } document.getElementById('FC_floatlayer').style.posLeft= FC_lastX; document.getElementById('FC_floatlayer').style.posTop= FC_lastY; } setTimeout("FC_adjust()", 50); } function FC_define(){ if ((FC_NS4) || (FC_NS6)){ switch (FC_halign){ case "left": FC_floatX=iFC_floatX; break; case "right": FC_floatX=window.innerWidth-iFC_floatX-FC_layerwidth-20; break; case "center": FC_floatX=Math.round((window.innerWidth-20)/2)-Math.round(FC_layerwidth/2); break; }; switch (FC_valign){ case "top": FC_floatY=-FC_layerheight; break; case "bottom": FC_floatY=window.innerHeight-iFC_floatY-FC_layerheight; break; case "center": FC_floatY=Math.round((window.innerHeight-20)/2)-Math.round(FC_layerheight/2); break; }; } if (FC_IE4){ switch (FC_halign){ case "left": FC_floatX=iFC_floatX; break; case "right": FC_floatX=document.body.offsetWidth-iFC_floatX-FC_layerwidth-20; break; case "center": FC_floatX=Math.round((document.body.offsetWidth-20)/2)-Math.round(FC_layerwidth/2); break }; switch (FC_valign){ case "top": FC_floatY= -FC_layerheight;//iFC_floatY - 100; break; case "bottom": FC_floatY=document.body.offsetHeight-iFC_floatY-FC_layerheight break; case "center": FC_floatY=Math.round((window.screen.availHeight-20)/2)-Math.round(FC_layerheight/2) break; } } } //var FC_swf_url = "popwin.swf"; var popwinWidth = "216"; var popwinHeight = "120"; var dcfly; function onGetInvite(imgPath,skin,staff,staffMsg,dept,group){ //var rootUrl=urlLink.substring(0,urlLink.lastIndexOf('/')); // create the hidden popwindow //------popwin---------- var FC_swfhtmlcode="
"; FC_swfhtmlcode+="
"; FC_swfhtmlcode+="
"+staff+"
"; FC_swfhtmlcode+="
"; FC_swfhtmlcode+="
"; FC_swfhtmlcode+="
"; FC_swfhtmlcode+="
"; FC_swfhtmlcode+="
"; FC_swfhtmlcode+=""; FC_swfhtmlcode+=""; FC_swfhtmlcode+=""; FC_swfhtmlcode+="
AcceptDeny
"; FC_swfhtmlcode+="
"; //------popwin end------ document.getElementById('FC_floatlayer').innerHTML=FC_swfhtmlcode; window.focus(); this.focus(); FC_halign = "center"; FC_valign = "center"; FC_define(); } function onCloseInvite() { if(dcfly==0){ document.getElementById('FC_floatlayer').style.visibility = 'hidden'; } FC_halign = "center"; FC_valign = "top"; FC_define(); } function startDC(fly) { dcfly=fly; // create the popwin DIV var FC_swfhtmlcode = ""; var myFC_popwincode = ""; if (FC_NS4){ myFC_popwincode += ''; }else if ((FC_IE4) || (FC_NS6)){ if(document.body == null){ myFC_popwincode += ""; } myFC_popwincode += "
"; if(document.body == null){ myFC_popwincode += ""; } } if (FC_NS4){ myFC_popwincode += ''; }else if((FC_IE4) || (FC_NS6)){ myFC_popwincode += "<\/div>"; } document.write(myFC_popwincode); var iFC_floatX=FC_floatX; var iFC_floatY=FC_floatY; var FC_lastX=FC_floatX; var FC_lastY=FC_floatY; window.onresize = FC_define; if(document.body!=null) { FC_adjust(); FC_halign = "center"; //----set d.c. popwin fly mode--- if(dcfly==0){ FC_valign = "center"; }else{ FC_valign = "top"; } FC_define(); } } function varToSwf(args,staff,dept,imgpath,group) { if(args=="DCAccept"){ openClientWindow(dept,staff,imgpath,group); } onCloseInvite(); window.document.topcmm_123livehelp_dc.SetVariable("invite.Status", args); //openClientInNewWindow('client.html?init_room="'+init_room+'"',win_width_dc,win_height_dc,"","","",""); } function openClientWindow(initroom,initstaff,imgpath,group) { var vars=""; if(initroom==""){ vars="?init_staff="+initstaff+"&init_dc=1"; } else{ vars="?init_room="+initroom+"&init_staff="+initstaff+"&init_dc=1"; } vars +="&init_group="+group; var win_width_dc="495"; var win_height_dc="440"; //openClientInNewWindow("client.html"+vars,win_width_dc,win_height_dc,"","","",""); window.open(imgpath+"client.html" + vars,'', "resizable=yes,width=520,height=450,status=yes"); //getURL(clientUrl+"?init_room="+initroom+"&init_staff="+staff+"&init_dc=1", "_black"); } function livehelp() { var client_html_url=define_url+"client.html?init_color="+chat_window_skin; if(enable_invitation) { var dc_url=define_url+"dc.swf?skin="+invitation_skin+"&init_room="+invitation_dept_id; } client_html_url+="&init_group=swishmail";if(enable_invitation){dc_url+="&init_group=swishmail";} var button_assign_id=""; if(button_assign_type==BUTTON_ASSIGN_NULL) { button_assign_id=0; } else if(button_assign_type==BUTTON_ASSIGN_DEPT) { button_assign_id=pre_dept_id; client_html_url+="&init_room="+button_assign_id; } else { button_assign_id=pre_staff_id; client_html_url+="&init_staff="+button_assign_id; } if(button_type==BUTTON_TYPE_IMAGE) { displayStatusImg(button_assign_type,button_assign_id,online_display,offline_display,client_html_url,chat_window_width,chat_window_height); } else if(button_type==BUTTON_TYPE_TEXT) { displayStatusText(button_assign_type,button_assign_id,online_display,offline_display,client_html_url,chat_window_width,chat_window_height); } if(enable_invitation) { startDC(invitation_popup_type); openSWF(dc_url,"1","1","dc","topcmm_123livehelp_dc"); } } var button_type = BUTTON_TYPE_IMAGE; var online_display = "http://www.123livehelp.com/img/online.jpg"; var offline_display = "http://www.123livehelp.com/img/offline.jpg"; var button_assign_type = BUTTON_ASSIGN_NULL; var chat_window_skin = "blue"; var chat_window_width = 495; var chat_window_height = 495; var enable_invitation = true; var invitation_popup_type = INVIATION_STYLE_SLIDEDOWN; var invitation_skin = INVIATION_STYLE_BROWN; var invitation_dept_id = 1; init_group="swishmail";