PageSourceSearch

http://czbank.com/cn/images/ucmonitor.js

js czbank.com collected 2026-09-26 01:12:05 UTC 29,794 bytes, 887 lines download raw bytes

1
2//################################################
3var ucws_var_debug=false;
4var ucws_stop_beat = false;
5var ucws_var_beatTimeOut = 5*1000;
6var ucws_var_checkagreelogin = 1*60*1000; /*2分钟后如果客户退出了,让客户再次上线*/
7var ucws_var_pageBeatCount = 0;
8var ucws_var_beatCountLimit = 200;
9var ucws_var_currPageId = "";
10var ucws_var_pageInter;
11var ucws_cookiekey_visitorid = "uc_visitorid";
12var ucws_var_visitorid = "";
13var ucws_var_customerid = "";
14
15var ucws_var_proxyserver = "webchat.czbank.com";
16var ucws_var_proxyport = "";
17var ucws_var_context = "webstat/"; //例如"webstat/"
18var ucws_var_header = "http://";
19//var ucws_var_pageRequestUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain";
20//var ucws_var_userBeatUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain";
21var ucws_var_pageRequestUrl = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "webstatmain";
22var ucws_var_userBeatUrl = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "webstatmain";
23
24var ucws_var_domain = "";
25
26var ucws_win_bgObj;
27var ucws_win_msgObj;
28var ucws_curr_inviteJson;
29
30var ucws_monitor_type = '0'; //状态监控
31
32//初始化正确的访问地址和端口
33function ucws_path_init() {
34	var str = document.getElementById("js_ucstarwebstat").src;
35	if(str != null && str.length > 0) {
36		var theHeader = "http://";
37		var index01 = str.indexOf("http://");
38		var index011 = str.indexOf("https://");
39		if(index01 < 0 && index011 >= 0) {
40			//theHeader = "https://";
41			index01 = index011;
42		}
43		ucws_var_header = theHeader;
44		if(index01 >= 0) {
45			str = str.substring(index01+theHeader.length,str.length);
46			var index02 = str.indexOf("/");
47			if(index02 >= 0) {
48				str = str.substring(0,index02);
49				var index03 = str.indexOf(":");
50				if(index03 >= 0) {
51					var myaddress = str;
52					var myipaddr = str.substring(0,index03);
53					var myport = str.substring(index03+1,str.length);
54					//ucws_var_proxyserver = myipaddr;
55					//ucws_var_proxyport = myport;
56					//ucws_var_pageRequestUrl = theHeader + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain";;
57					//var ucws_var_userBeatUrl = theHeader + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain";;
58					ucws_var_pageRequestUrl = theHeader + ucws_var_proxyserver  + "/" + ucws_var_context + "webstatmain";;
59					var ucws_var_userBeatUrl = theHeader + ucws_var_proxyserver  + "/" + ucws_var_context + "webstatmain";;
60				
61				} else {
62					//var myaddress = str;
63					//var myipaddr = str;
64					//ucws_var_proxyserver = myipaddr;
65					//ucws_var_proxyport = "80";
66					//if(ucws_var_header.indexOf("https://") >= 0) {
67					//	ucws_var_proxyport = "443";
68					//}
69					ucws_var_pageRequestUrl = theHeader + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain";;
70					var ucws_var_userBeatUrl = theHeader + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain";;
71				}
72			}
73		}
74	}
75}
76
77
78function ucws_showWin(title, msg, w, h){ 
79	
80	//var theImgInvite = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "images/uc_invite.png";
81	var theImgInvite = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "images/uc_invite.png";
82	
83	var titleheight = "22px"; // 提示窗口标题高度 
84	var bordercolor = "#666699"; // 提示窗口的边框颜色 
85	var titlecolor = "#FFFFFF"; // 提示窗口的标题颜色 
86	var titlebgcolor = "#A0BDE3"; // 提示窗口的标题背景色
87	var bgcolor = "#FFFFFF"; // 提示内容的背景色
88	
89	var iWidth = document.body.clientWidth; 
90	var iHeight = document.body.clientHeight;
91	var offTop = 0;
92	if(iHeight - h > 0) {
93		offTop = iHeight - h;
94	}
95	offTop = 10;
96	
97	var paddingLeft = 40;
98	//h = 70;
99	/*
100	//将背景设置成灰色
101	ucws_win_bgObj = document.createElement("div"); 
102	ucws_win_bgObj.style.cssText = "position:absolute;
102left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;";
103	document.body.appendChild(ucws_win_bgObj); 
104	*/
105	ucws_win_msgObj=document.createElement("div");
106	//var theCssText = "position:absolute;font:11px '宋体';top:"+(offTop)/2+"px;left:"+(iWidth-w)/2+"px;width:"+w+"px;height:"+h+"px;text-align:center;border:1px solid "+bordercolor+";background-color:"+bgcolor+";padding:1px;line-height:22px;z-index:2000;";
107	var theCssText = "position:absolute;font:11px '宋体';top:"+(offTop)/2+"px;left:"+(iWidth-w)/2+"px;width:"+w+"px;height:"+h+"px;text-align:center;padding:1px;line-height:22px;z-index:2000;";
108	theCssText += "background: url('" + theImgInvite + "') no-repeat;";
109	ucws_win_msgObj.style.cssText = theCssText;
110	document.body.appendChild(ucws_win_msgObj);
111	
112	var table = document.createElement("table");
113	ucws_win_msgObj.appendChild(table);
114	table.style.cssText = "margin:0px;border:0px;padding:0px;";
115	table.cellSpacing = 0;
116	var tr = table.insertRow(-1);
117	var titleBar = tr.insertCell(-1);
118	titleBar.style.cssText = "width:100%;height:"+titleheight+"px;text-align:left;padding:3px;margin:0px;font:bold 13px '宋体';";
119	titleBar.style.paddingLeft = "5px";
120	//titleBar.innerHTML = title;
121	var moveX = 0;
122	var moveY = 0;
123	var moveTop = 0;
124	var moveLeft = 0;
125	var moveable = false;
126	var docMouseMoveEvent = document.onmousemove;
127	var docMouseUpEvent = document.onmouseup;
128	ucws_win_msgObj.onmousedown = function() {
129		var evt = getEvent();
130		moveable = true; 
131		moveX = evt.clientX;
132		moveY = evt.clientY;
133		moveTop = parseInt(ucws_win_msgObj.style.top);
134		moveLeft = parseInt(ucws_win_msgObj.style.left);
135		
136		document.onmousemove = function() {
137			if (moveable) {
138				var evt = getEvent();
139				var x = moveLeft + evt.clientX - moveX;
140				var y = moveTop + evt.clientY - moveY;
141				//if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) {
142					ucws_win_msgObj.style.left = x + "px";
143					ucws_win_msgObj.style.top = y + "px";
144				//}
145			}	
146		};
147		document.onmouseup = function () { 
148			if (moveable) { 
149				document.onmousemove = docMouseMoveEvent;
150				document.onmouseup = docMouseUpEvent;
151				moveable = false; 
152				moveX = 0;
153				moveY = 0;
154				moveTop = 0;
155				moveLeft = 0;
156			} 
157		};
158	}
159	
160	var closeBtn = tr.insertCell(-1);
161	closeBtn.style.cssText = "cursor:pointer; padding-right:5px;";
162	closeBtn.innerHTML = "<span style='font-size:15pt; width: 10px; color:"+titlecolor+";'>x</span>";
163	closeBtn.onclick = function(){ 
164		try {
165			//删除背景设置
166			document.body.removeChild(ucws_win_bgObj); 
167		} catch(e) {
168			
169		}
170		document.body.removeChild(ucws_win_msgObj); 
171		
172		ucws_reLogin();
173	} 
174	var msgBox = table.insertRow(-1).insertCell(-1);
175	msgBox.style.cssText = "font:10pt '宋体';";
176	msgBox.colSpan  = 2;
177	msgBox.innerHTML = msg;
178	
179    // 获得事件Event对象,用于兼容IE和FireFox
180    function getEvent() {
181	    return window.event || arguments.callee.caller.arguments[0];
182    }
183} 
184
185/**
186 * 创建邀请的页面
187 */
188function ucws_createInviteWindow(_str) {
189	
190	//var theImgAgree = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "images/uc_agree.png";
191	//var theImgRefuse = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "images/uc_refuse.png";
192	var theImgAgree = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "images/uc_agree.png";
193	var theImgRefuse = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "images/uc_refuse.png";
194	
195	//请问有什么能帮助到您的?
196	var innerStr = "<div style='padding:5px; padding-left:80px;'>";
197	if(_str != null && _str != undefined) {
198		innerStr += decodeURIComponent(_str);
199	} else {
200		innerStr += "\u8BF7\u95EE\u6709\u4EC0\u4E48\u80FD\u5E2E\u52A9\u5230\u60A8\u7684\uFF1F";
201	}
202	
203	
204	
205	//同意
206    innerStr += "</br></br><input type='image' src='" + theImgAgree + "' value='\u540C\u610F' onclick='ucws_userAgree()'/>";
207    //拒绝
208    innerStr += "&nbsp;<input type='image' src='" + theImgRefuse + "' value='\u62D2\u7EDD' onclick='ucws_userDisAgree()'/>";
209	innerStr += "</div>";
210	
211    //邀请
212	ucws_showWin("\u9080\u8BF7",innerStr,315,120);
213	
214	//停止请求
215	ucws_stop_beat = true;
216	
217}
218
219
220/**
221 * 创建调试页面
222 */
223function ucws_createDebugDiv() {
224	if(document.getElementById("ucwsDebugInfo") != null) {
225    	return;
226    }
227    var div1 = document.createElement('div');
228    div1.id='ucwsDebugInfo';
229    div1.style.border='1px solid #ddd';
230	document.body.appendChild(div1);
231}
232
233/**
234 * pageId: id号,由客户端生成与服务器进行对应
235 * title: 标题
236 * browserType: 浏览器类型: 0:IE  1:火狐  2:Google
237 * browserCode: 浏览器编码
238 * pageUrl: 访问的页面
239 * param: 页面的参数
240 * statue: 状态  0:刚进入  1:退出
241 */
242function ucws_pageinfo(pageId,title,bsType,bsCode,pageUrl,param,statue,clientId) {
243	this.pageId = pageId;
244	this.title = title;
245	this.bsType = bsType;
246	this.bsCode = bsCode;
247	this.pageUrl = pageUrl;
248	this.param = param;
249	this.statue = statue;
250	this.clientId = clientId;
251}
252
253function ucws_userinfo(userid) {
254	this.userid = userid;
255}
256
257//获取页面信息
258function ucws_getPageInfo() {
259	var vTitle = document.title;
260	var vPageId = new Date().getTime();
261	ucws_var_currPageId = vPageId;
262	var vBrowserType = ucws_util_getBrowser();
263	var vBrowserCharset = ucws_util_getPageCharset();
264	var vFullUrl = document.location.href;
265	
266	
267	var pageObj = new ucws_pageinfo();
268	pageObj.pageId = vPageId;
269	pageObj.title = vTitle;
270	pageObj.bsType = vBrowserType;
271	pageObj.bsCode = vBrowserCharset;
272	pageObj.pageUrl = vFullUrl;
273	pageObj.clientId = ucws_var_visitorid;
274	
275	ucws_util_log(ucws_JSON.stringify(pageObj),1);
276	
277	var url = ucws_var_pageRequestUrl; 
278	url += "?callback=?" //跨域
279	ucws_getJSON(url, {time:new Date().getTime(),action:'webinfo',from:ucws_var_visitorid,body:ucws_JSON.stringify(pageObj)},
280		function(json){
281  			ucws_util_log("发送网页信息:"+json.body);
282  		}
283	);
284}
285
286//退出页面
287function ucws_outPageInfo() {
288	ucws_util_log("Out:" + ucws_var_currPageId);
289}
290
291//*********************utils******************
292//获取浏览器编码
293function ucws_util_getPageCharset(){
294    var charSet = "";
295    var oType = ucws_util_getBrowser();
296    switch(oType){
297        case "0":
298            charSet = document.charset;
299            break;
300        case "1":
301            charSet = document.characterSet;
302            break;
303        default:
304            break;
305    }
306    return charSet;
307}
308//获取浏览器类型: 0:IE  1:火狐  2:Google
309function ucws_util_getBrowser(){
310    var oType = "";
311    if(navigator.userAgent.indexOf("MSIE")!=-1){
312        oType="0"; //IE
313    }else if(navigator.userAgent.indexOf("Firefox")!=-1){
314        oType="1"; //Firefox
315    }else {
316    	oType="1";
317    }
318    return oType;
319}
320//日志调试
321function ucws_util_log(msg,level) {
322	
323	if(ucws_var_debug == false) {
324		return;
325	}
326	
327	if(level == undefined) {
328		level = 0;
329	}
330	var content = "level:" + level + "\n " + msg;
331	//alert();
332	
333	if(document.getElementById('ucwsDebugInfo') == null) {
334		ucws_createDebugDiv();
335	}
336	try {
337		document.getElementById('ucwsDebugInfo').innerHTML += content + "</br>";
338	} catch(e) {
339		
340	}
341}
342
343//获取随机生成的游客ID并存储到cookie中
344function ucws_getRandomVisitorId() {
345	var vTempId = "" + new Date().getTime();
346	vTempId = vTempId.substring(vTempId.length - 5, vTempId.length);
347	vTempId = ""+ Math.round(Math.random()*10000) + vTempId;
348	return vTempId; 
349}
350
351/**
352 * 获取游客的ID并放到cookie中
353 * @returns
354 */
355function ucws_getTheVisitorId() {
356	/*var theVisitorId = ucws_cookie(ucws_cookiekey_visitorid);
357	if(theVisitorId == null || theVisitorId == '') {
358		theVisitorId = ucws_getRandomVisitorId();
359		ucws_cookie(ucws_cookiekey_visitorid,theVisitorId,{ expires: 3650, path: '/' });
360	}
361	return theVisitorId;*/
362	//为避免使用jquer方法,这里直接生成id不去cookie中获取
363	return ucws_getRandomVisitorId();
364}
365
366//*********************end utils**************
367
368function ucws_pageBeat() {
369	if(ucws_stop_beat == true) {
370		return;
371	}
372	if(ucws_var_visitorid != null && ucws_var_visitorid != "") {
373		
374		if(ucws_var_pageBeatCount > ucws_var_beatCountLimit) {
375			ucws_util_log("Beat Limit Out");
376			return;
377		}
378		
379		ucws_util_log("Page Beat: " + ucws_var_currPageId + ucws_var_pageBeatCount);
380		ucws_var_pageBeatCount ++;
381		ucws_postuserbeat();
382	}
383	
384}
385
386function ucws_postuserbeat() {
387	var userInfo = new ucws_userinfo();
388	userInfo.userid = ucws_var_visitorid;
389	
390	var url = ucws_var_pageRequestUrl; 
391	url += "?callback=?" //跨域
392	ucws_getJSON(url, {time:new Date().getTime(),action:'userbeat',from:ucws_var_visitorid,body:ucws_JSON.stringify(userInfo)},
393		function(json){
394			try {
395  				ucws_util_log("握手:"+json.body);
396  				if(json.invite == "true") {
397  					ucws_curr_inviteJson = json;
398  					ucws_createInviteWindow(json.memo);
399  				}
400  			} catch(e) {
401  				ucws_util_log(e);
402  			}
403  			window.setTimeout(ucws_pageBeat, ucws_var_beatTimeOut);
404  		}
405	);
406}
407
408
409function ucws_reLogin() {
410	ucws_stop_beat = false;
411	ucws_init(ucws_var_customerid,ucws_monitor_type,ucws_var_domain);
412}
413
414/**
415 * 判断是否是函数
416 */
417function isUcFunction( fn ) {
418	return !!fn && !fn.nodeName && fn.constructor != String &&
419	fn.constructor != RegExp && fn.constructor != Array &&
420	/function/i.test( fn + "" );
421}
422
423/**
424 * 同意邀请
425 */
426function ucws_userAgree() {
427	//alert('Agree:' + ucws_var_visitorid);
428	if(ucws_curr_inviteJson != null) {
429		//alert('Invite:' + ucws_curr_inviteJson.seatId + "|" + ucws_curr_inviteJson.seatName);
430		var funcucws_callback_agree;
431		try { funcucws_callback_agree = eval('ucws_callback_agree') } catch(e) { }
432		if(funcucws_callback_agree != undefined && isUcFunction(funcucws_callback_agree)) {
433			funcucws_callback_agree(ucws_curr_inviteJson.seatId,ucws_curr_inviteJson.seatName,ucws_var_customerid);
434		} else {
435			
436			var theArgObj = new Object();
437			theArgObj.seatId = ucws_curr_inviteJson.seatId;
438			theArgObj.seatName = ucws_curr_inviteJson.seatName;
439			theArgObj.customerid = ucws_var_customerid;
440			theArgObj.seatType = '1';
441			ucws_userAgree_confirm(theArgObj);
442			
443			//ucws_preloginWin(ucws_curr_inviteJson.seatId,ucws_curr_inviteJson.seatName,ucws_var_customerid, '1');
444			
445		}
446	}
447	
448	//var agreeUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" 
448+ ucws_var_context + "ucmonitor_control.jsp";
449	var agreeUrl = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "ucmonitor_control.jsp";
450	agreeUrl += "?callback=?"; //跨域
451	ucws_getJSON(agreeUrl,{action:'agree',visitorId:ucws_var_visitorid});
452	
453	try {
454		//删除背景设置
455		document.body.removeChild(ucws_win_bgObj); 
456	} catch(e) {
457		
458	}
459	document.body.removeChild(ucws_win_msgObj); 
460	
461	window.setTimeout(ucws_checkReLogin,ucws_var_checkagreelogin);
462}
463
464function ucws_userAgree_confirm(_argData) {
465	var argSeatId = _argData.seatId;
466	var argSeatName = _argData.seatName;
467	var argCustomerid = _argData.customerid;
468	var argSeatType = _argData.seatType;
469	
470	try {
471	   if(ucws_preloginWin_agree != undefined) {
472	       
473	   }
474	} catch(e) {
475	   alert("请在页面中配置ucws_preloginWin_agree申请加入函数");
476	   return;
477	}
478	ucws_preloginWin_agree(argSeatId,argSeatName,argCustomerid, argSeatType);
479	/*
480	if(ucws_preloginWin_agree != undefined) {
481		ucws_preloginWin_agree(argSeatId,argSeatName,argCustomerid, argSeatType);
482	} else {
483		ucws_preloginWin(argSeatId,argSeatName,argCustomerid, argSeatType);
484	}
485	*/
486}
487
488/**
489 * 拒绝邀请
490 */
491function ucws_userDisAgree() {
492	//alert('DisAgree:' + ucws_var_visitorid);
493	if(ucws_curr_inviteJson != null) {
494		//alert('Invite:' + ucws_curr_inviteJson.seatId + "|" + ucws_curr_inviteJson.seatName);
495		//var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucmonitor_control.jsp";
496		var url = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "ucmonitor_control.jsp";
497		url += "?callback=?"; //跨域
498		ucws_getJSON(url,{action:'disagree',visitorId:ucws_var_visitorid});
499	}
500	
501	try {
502		//删除背景设置
503		document.body.removeChild(ucws_win_bgObj); 
504	} catch(e) {
505			
506	}
507	document.body.removeChild(ucws_win_msgObj); 
508	
509	ucws_reLogin();
510	
511}
512
513/**
514 * 页面关闭退出监控
515 */
516function ucws_prelogout() {
517	if(ucws_var_visitorid == undefined || ucws_var_visitorid == null) {
518		return;
519	}
520	var userInfo = new ucws_userinfo();
521	userInfo.userid = ucws_var_visitorid;
522	
523	if(ucws_monitor_type == '0') {
524		//不进行状态监控
525		return;
526	}
527	var url = ucws_var_pageRequestUrl; 
528	url += "?callback=?" //跨域
529	ucws_getJSON(url, {time:new Date().getTime(),action:'logout',from:ucws_var_visitorid,body:ucws_JSON.stringify(userInfo)},
530		function(json){
531  			ucws_util_log("登出:"+json.body);
532  			//add by polarrwl , 2011.06.24
533  			//ucws_getPageInfo();
534  			ucws_var_pageInter = window.setTimeout(ucws_pageBeat, 3*1000);
535  		}
536	);
537}
538
539window.onbeforeunload = function() {
540	ucws_prelogout();
541}
542
543/**
544 * 检查重连情况
545 */
546function ucws_checkReLogin() {
547	if(ucws_stop_beat == true) {
548		ucws_reLogin();
549	} else {
550		window.setTimeout(ucws_checkReLogin,ucws_var_checkagreelogin);
551	}
552}
553
554/**********************提供外部调用的接口***************************/
555
556/**
557 * 监控初始化
558 * @param {Object} customerId 游客ID,如果为空,则自动创建
559 * @param {Object} mtype 是否进行邀请监控。0:否 1:是 缺省是"是"
560 * @param {Object} domain 域(服务器组织架构中对应的域)
561 */
562function ucws_init(customerId,mtype,domain) {
563	
564	//初始化IP地址
565	ucws_path_init();
566	
567	//设置domain
568	if(domain != undefined) {
569		ucws_var_domain = domain;
570	}
571	
572	//初始化当前的客户ID(正式客户用customerId,游客用ucws_var_visitorid);
573	if(customerId != null && customerId.length > 0) {
574		ucws_var_visitorid = customerId;
575		ucws_var_customerid = customerId;
576		ucws_util_log("customer id :" + ucws_var_visitorid);
577	} else {
578		ucws_var_visitorid = ucws_getTheVisitorId();
579		ucws_util_log("Visitor id :" + ucws_var_visitorid);
580	}
581	
582	var userInfo = new ucws_userinfo();
583	userInfo.userid = ucws_var_visitorid;
584	
585	if(mtype != undefined) {
586		ucws_monitor_type = '' + mtype;
587	}
588	//监控游客户或者客户的浏览情况
589	if(ucws_monitor_type == '1') {
590		if(!customerId || customerId == '') {
591			alert('只能监控正式客户');
592			return;
593		}
594		var url = ucws_var_pageRequestUrl; 
595		url += "?callback=?" //跨域
596		ucws_getJSON(url, {time:new Date().getTime(),action:'login',from:ucws_var_visitorid,body:ucws_JSON.stringify(userInfo)},
597			function(json){
598	  			ucws_util_log("登陆:"+json.body);
599	  			//add by polarrwl , 2011.06.24
600	  			//ucws_getPageInfo();
601	  			ucws_var_pageInter = window.setTimeout(ucws_pageBeat, 3*1000);
602	  		}
603		);
604	}
605}
606
607/**
608 * 正常的登录方式
609 */
610function ucws_prelogin(_config) {
611	if(_config == undefined || _config == null) {
612		alert('Config not Found');
613	}
614	var theUserType = _config.usertype; /*用户类型:0:游客,1:正式客户,2:网站客户*/
615	var username = _config.username; /*用户帐号:如果是正式客户和网站客户需要用到*/
616	var issso = _config.issso; /*是否单点登录*/
617	var serverip = _config.serverip; /*单点登录的服务器地址*/
618	var xmppport = _config.xmppport; /*单点登录的端口号*/
619	var serverport = _config.serverport; /*IM服务器的HTTP端口号,单点登录用*/
620	var winWidth = _config.winwidth; /*弹出窗口宽*/
621	var winHeight = _config.winheight; /*弹出窗口高*/ 
622	var custname = _config.custname; /*客户名称*/
623	var openSeat = _config.openseat; /*是否直接打开座席或者座席队列*/
624	var seatId = _config.seatid; /*是否直接打开座席或者座席队列*/
625	var seatType = _config.seattype; /*是否直接打开座席或者座席队列*/
626	var opentype = _config.opentype; /*打开类型*/
627	var clienttype = _config.clienttype; /*客户端类型: phone:手机客户端(对应ucstarclient_phone目录) 其他:web客户端(对应ucstarclient目录)*/
628	/*初始化数据*/
629	if(theUserType == undefined || theUserType == null) {
630		theUserType = '0';
631	}
632	if(clienttype == undefined || clienttype == null) {
633		clienttype = '';
634	}
635	//如果是游客,则帐号采用自动生成的游客ID
636	if(theUserType == '0' && (username == undefined || username == null || username == '')) {
637		username = ucws_var_visitorid;
638	}
639	if(opentype == undefined) {
640		opentype = "0";
641	}
642	if(issso == undefined) {
643		issso = true;
644	}
645	if(custname == undefined) {
646		custname = "客户";
647	}
648	if(winWidth == undefined) {
649		winWidth = 600;
650	}
651	if(winHeight == undefined) {
652		winHeight = 400;
653	}
654	if(openSeat == undefined) {
655		openSeat = false;
656	}
657	if(seatId == undefined) {
658		seatId = "";
659	}
660	if(seatType == undefined) {
661		seatType = "0";
662	}
663	/*初始化数据-END*/
664	
665	//var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context;
666	var url = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context;
667	if(openSeat == true) {
668		url += "ucmonitor_login_seat.jsp"
669	} else {
670		url += "ucmonitor_login_normal.jsp"
671	}
672	
673	url += "?username=" + username;
674	url += "&userType=" + theUserType;
675	url += "&serverip=" + serverip;
676	url += "&xmppport=" + xmppport;
677	url += "&serverport=" + serverport;
678	url += "&custname=" + encodeURIComponent(custname);
679	url += "&issso=" + issso;
680	url += "&seatId=" + seatId;
681	url += "&seatType=" + seatType;
682	url += "&clienttype=" + clienttype;
683	if(opentype == '1') {
684		location.href = url;
685	} else {
686		var myWin = window.open(url,"login",'width=' + winWidth + ',height=' + winHeight + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no');
687	}
688}
689
690/**
691 * 直接打开座席会话
692 * @param {} _visitorId
693 * @param {} _seatId
694 */
695function ucws_preloginWin(_seatId, _seatName, _customerId, _seatType, _winWidth, _winHeight) {
696	if(_seatType == undefined || _seatType == ""){
697		_seatType = "0";
698	}
699	var theUserType = "0";
700	if(_customerId != null && _customerId != '') {
701		theUserType = "1";
702	}
703	if(ucws_var_visitorid == null || _seatId == null || ucws_var_visitorid == '' || _seatId == '') {
704		alert('error,seatid or visitorid is null!');
705		return;
706	}
707	//var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucmonitor_login.jsp";
708	var url = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "ucmonitor_login.jsp";
709	if(theUserType == 1) {
710		url += "?username=" + _customerId;
711	} else {
712		url += "?username=" + ucws_var_visitorid;
713	}
714	url += "&seatId=" + _seatId;
715	url += "&seatName=" + _seatName;
716	url += "&userType=" + theUserType;
717	url += "&domainUri=" + (null == ucws_var_domain ? "":ucws_var_domain);
718	url += "&seatType=" + _seatType;
719	var winW = 600;
720	var winH = 400;
721	if(_winWidth != undefined) {
722		winW = _winWidth;
723	}
724	if(_winHeight != undefined) {
725		winH = _winHeight;
726	}
727	var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no');
728}
729
730/**
731 * 直接打开座席会话   安信
732 * @author lggang
733 * @param {} _visitorId
734 * @param {} _seatId
735 */
736function ucws_preloginWin_anxin(_customerId, _customerSource, _ssoServerIp, _ssoLoginUrl, _ssoServerDomain, _ssoXmppPort, _ssoServerPort, _winWidth, _winHeight) {
737	//var webClientUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "anxin_webclient/client/";
738	var webClientUrl = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "anxin_webclient/client/";
739	
740	var url = "";
741	if(_customerId != undefined && _customerId != ""){
742		url = _ssoLoginUrl;
743		url += "?thetime=" + new Date().getTime(); 
744		url += "&username=" + _customerId;
745		url += "&usersource=" + _customerSource;
746		url += "&serverip=" + _ssoServerIp;
747		url += "&serverdomain=" + _ssoServerDomain;
748		url += "&xmppport=" + _ssoXmppPort;
749		url += "&serverport=" + _ssoServerPort;
750		url += "&webclienturl=" + webClientUrl;
751	}else{
752		url = webClientUrl;
753		//url += "ucallclient.html?usersource="+_customerSource;
754		url += "anxinclient.html?usersource="+_customerSource;
755	}
756	var winW = 800;
757	var winH = 600;
758	if(_winWidth != undefined) {
759		winW = _winWidth;
760	}
761	if(_winHeight != undefined) {
762		winH = _winHeight;
763	}
764	var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no');
765}
766
767/**
768 * SSO登陆模式
769 *
770 */
771function ucws_preloginWin_ssocom(_customerId, _dataconf, _winWidth, _winHeight) {
772    //var webClientUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucstarwebcall/";
773    var webClientUrl = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "ucstarwebcall/";
774    var url = "";
775    if(_customerId != undefined && _customerId != ""){
776        url = _dataconf.ssourl;
777        url += "?thetime=" + new Date().getTime(); 
778        url += "&username=" + _customerId;
779        url += "&usersource=" + _dataconf.source;
780        url += "&serverip=" + _dataconf.serverip;
781        url += "&serverdomain=" + _dataconf.domain;
782        url += "&xmppport=" + _dataconf.xmppport;
783        url += "&serverport=" + _dataconf.serverport;
784        url += "&webclienturl=" + webClientUrl;
785        if(_dataconf.seatid != undefined) {
786            url += "&seat=" + _dataconf.seatid;
787        }
788        if(_dataconf.seattype != undefined) {
789            url += "&seatType=" + _dataconf.seattype;
790        }
791    }else{
792        url = webClientUrl;
793        url += "ucstarclient.html?usersource="+_dataconf.source;
794    }
795    var winW = 800;
796    var winH = 600;
797    if(_winWidth != undefined) {
798        winW = _winWidth;
799    }
800    if(_winHeight != undefined) {
801        winH = _winHeight;
802    }
803    var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no');
804}
805
806/**
807 * 直接打开座席会话   安信
808 * @author lggang
809 * @param {} _visitorId
810 * @param {} _seatId
811 */
812function ucws_preloginWin_webcall(_customerId, _customerSource, _ssoServerIp, _ssoLoginUrl, _ssoServerDomain, _ssoXmppPort, _ssoServerPort, _winWidth, _winHeight) {
813	//var webClientUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucstarclient_webcall/client/";
814	var webClientUrl = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "ucstarclient_webcall/client/";
815	var url = "";
816	if(_customerId != undefined && _customerId != ""){
817		url = _ssoLoginUrl;
818		url += "?thetime=" + new Date().getTime(); 
819		url += "&username=" + _customerId;
820		url += "&usersource=" + _customerSource;
821		url += "&serverip=" + _ssoServerIp;
822		url += "&serverdomain=" + _ssoServerDomain;
823		url += "&xmppport=" + _ssoXmppPort;
824		url += "&serverport=" + _ssoServerPort;
825		url += "&webclienturl=" + webClientUrl;
826	}else{
827		url = webClientUrl;
828		url += "ucallclient.html?usersource="+_customerSource;
829		//url += "anxinclient.html?usersource="+_customerSource;
830	}
831	var winW = 800;
832	var winH = 600;
833	if(_winWidth != undefined) {
834		winW = _winWidth;
835	}
836	if(_winHeight != undefined) {
837		winH = _winHeight;
838	}
839	var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no');
840}
841
842/**
843 * 直接打开座席会话 浙商
844 * @author yqiang
845 * @param {} _visitorId
846 * @param {} _seatId
847 */
848function ucws_preloginWin_czbank(_seatId, _userid ,_voiphone ,_lable,_nickname,_selfpriority, _winWidth, _winHeight) {
849	
850	var theUserType = "0";
851	if(_userid != null && _userid != '') {
852		theUserType = "2";
853	}
854	if(ucws_var_visitorid == null || _seatId == null || ucws_var_visitorid == '' || _seatId == '') {
855		alert('error,seatid or visitorid is null!');
856		return;
857	}
858	//var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucmonitor_login.jsp";
859	var url = ucws_var_header + ucws_var_proxyserver  + "/" + ucws_var_context + "ucmonitor_login.jsp";
860	if(theUserType == 2) {
861		url += "?username=" + _userid;
862	} else {
863		url += "?username=" + ucws_var_visitorid;
864	}
865	url += "&seatId=" + _seatId;
866	url += "&seatName=" + '';
867	url += "&userType=" + theUserType;
868	url += "&domainUri=" + (null == ucws_var_domain ? "":ucws_var_domain);
869	url += "&seatType=" + 0;
870	url += "&priority=" + 1;
871	url += "&voiphone=" + _voiphone;
872	url += "&lable=" + _lable;
873	url += "&nickname=" + encodeURIComponent(_nickname);
874	url += "&selfpriority=" + _selfpriority;
875	var winW = 600;
876	var winH = 400;
877	if(_winWidth != undefined) {
878		winW = _winWidth;
879	}
880	if(_winHeight != undefined) {
881		winH = _winHeight;
882	}
883	var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menubar=no,resizable=no');
884}
885
886
887/**********************提供外部调用的接口-END***************************/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.