From 8bdbd143582cbe7f4b01c0352489023055f93c11 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Tue, 30 Oct 2007 12:24:14 +0000 Subject: [PATCH] location other than /webim in javascript, fixed for safari git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@34 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/obfuscator/src/brws.js | 30 ++ src/obfuscator/src/common.js | 526 ++++++++++++++++++++++ src/obfuscator/src/page_chat.js | 330 ++++++++++++++ src/obfuscator/src/page_pendingclients.js | 286 ++++++++++++ src/webim/js/brws.js | 2 +- src/webim/js/common.js | 2 +- src/webim/js/page_chat.js | 2 +- src/webim/js/page_pendingclients.js | 2 +- src/webim/libs/chat.php | 2 +- 9 files changed, 1177 insertions(+), 5 deletions(-) create mode 100644 src/obfuscator/src/brws.js create mode 100644 src/obfuscator/src/common.js create mode 100644 src/obfuscator/src/page_chat.js create mode 100644 src/obfuscator/src/page_pendingclients.js diff --git a/src/obfuscator/src/brws.js b/src/obfuscator/src/brws.js new file mode 100644 index 00000000..9a895eb0 --- /dev/null +++ b/src/obfuscator/src/brws.js @@ -0,0 +1,30 @@ +var myAgent = ""; +var myVer = 0; +var myRealAgent = ""; + +function detectAgent() { + var AGENTS = ["opera","msie","safari","firefox","netscape","mozilla"]; + var agent = navigator.userAgent.toLowerCase(); + for (var i = 0; i < AGENTS.length; i++) { + var agentStr = AGENTS[i]; + if (agent.indexOf(agentStr) != -1) { + myAgent = agentStr; + if (!window.RegExp) + break; + + var versionExpr = new RegExp(agentStr + "[ \/]?([0-9]+(\.[0-9]+)?)"); + if (versionExpr.exec(agent) != null) { + myVer = parseFloat(RegExp.$1); + } + break; + } + } + myRealAgent = myAgent; + if( navigator.product == "Gecko") + myAgent = "moz"; +} +detectAgent(); + +function getEl(name) { + return document.getElementById(name); +} diff --git a/src/obfuscator/src/common.js b/src/obfuscator/src/common.js new file mode 100644 index 00000000..bc9ff3d3 --- /dev/null +++ b/src/obfuscator/src/common.js @@ -0,0 +1,526 @@ +/* + * Web Messenger common script + * http://sourceforge.net/projects/webim + * + * Based on Prototype JavaScript framework, version 1.3.1 + * http://prototype.conio.net/ (c) 2005 Sam Stephenson + */ + +//- getEl, myAgent, myRealAgent + +//- localized + +//- onComplete, obj, params, $apply$ +//- threadParams, servl, frequency, user, threadid, token +//- updaterOptions, url, company, agentservl, noclients, wroot + + +var Class = { + create: function() { + return function() { + this./**/initialize./**/apply(this, arguments); + }; + }, + + inherit: function(child,parent,body) { + Object./**/extend(Object.extend(child.prototype, parent.prototype), body ); + } +}; + +Object.extend = function(destination, source) { + for (property in source) { + destination[property] = source[property]; + } + return destination; +}; + +Object.prototype.extend = function(_object) { + return Object.extend.apply(this, [this, _object]); +}; + +Function.prototype./**/bind = function(_object) { + var __method = this; + return function() { + return __method.apply(_object, arguments); + } +}; + +Function.prototype./**/bindAsEventListener = function(_object) { + var __method = this; + return function(event) { + __method.call(_object, event || window.event); + } +}; + +Number.prototype./**/toColorPart = function() { + var digits = this.toString(16); + if (this < 16) return '0' + digits; + return digits; +}; + +var Try = { + these: function() { + var returnValue; + + for (var i = 0; i < arguments.length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) {} + } + + return returnValue; + } +}; + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this./**/currentlyExecuting = false; + + this./**/registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.callback(); + } finally { + this.currentlyExecuting = false; + } + } + } +}; + +/*--------------------------------------------------------------------------*/ + +function findObj( id ) +{ + var x; + if( !( x = document[ id ] ) && document.all ) x = document.all[ id ]; + if( !x && document.getElementById ) x = document.getElementById( id ); + if( !x && !document.all && document.getElementsByName ) + { + x = document.getElementsByName( id ); + if( x.length == 0 ) return null; + if( x.length == 1 ) return x[ 0 ]; + } + + return x; +} + +if (!Array.prototype./**/push) { + Array.prototype.push = function() { + var startLength = this.length; + for (var i = 0; i < arguments.length; i++) + this[startLength + i] = arguments[i]; + return this.length; + }; +} + +function $() { + var elems = new Array(); + + for (var i = 0; i < arguments.length; i++) { + var elem = arguments[i]; + if (typeof elem == 'string') + elem = findObj(elem); + + if (arguments.length == 1) + return elem; + + elems.push(elem); + } + + return elems; +} + +if (!Function.prototype.apply) { + Function.prototype.apply = function(obj, params) { + var parameterStrings = new Array(); + if (!obj) obj = window; + if (!params) params = new Array(); + + for (var i = 0; i < params.length; i++) + parameterStrings[i] = 'params[' + i + ']'; + + obj.$apply$ = this; + var result = eval('obj.$apply$(' + + parameterStrings.join(', ') + ')'); + obj.$apply$ = null; + + return result; + }; +} + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')}, + function() {return new XMLHttpRequest()} + ) || false; + }, + + getXml: function(_response) { + if( _response && + _response.status >= 200 && + _response.status < 300 ) { + var xmlDoc = _response.responseXML; + if( xmlDoc && xmlDoc.documentElement ) + return xmlDoc.documentElement; + } + return null; + }, + + getError: function(_response) { + return _response.statusText || "connection error N" + _response.status; + }, + + emptyFunction: function() {} +}; + +Ajax./**/Base = function() {}; +Ajax.Base.prototype = { + setOptions: function(_options) { + this._options = { + _method: 'post', + asynchronous: true, + parameters: '' + }.extend(_options || {}); + }, + + responseIsSuccess: function() { + return this./**/transport.status == undefined + || this.transport.status == 0 + || (this.transport.status >= 200 && this.transport.status < 300); + }, + + responseIsFailure: function() { + return !this.responseIsSuccess(); + } +}; + +Ajax./**/Request = Class.create(); +Ajax.Request./**/Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Class.inherit( Ajax.Request, Ajax.Base, { + initialize: function(url, _options) { + this.transport = Ajax.getTransport(); + this.setOptions(_options); + this.request(url); + }, + + request: function(url) { + var parameters = this._options.parameters || ''; + if (parameters.length > 0) parameters += '&_='; + + try { + if (this._options._method == 'get' && parameters.length > 0) + url += '?' + parameters; + + this.transport.open(this._options._method, url, this._options.asynchronous); + + if (this._options.asynchronous) { + this.transport.onreadystatechange = this.onStateChange.bind(this); + setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10); + } + + this.setRequestHeaders(); + + var pbody = this._options.postBody ? this._options.postBody : parameters; + this.transport.send(this._options._method == 'post' ? pbody : null); + + } catch (e) { + this.dispatchException(e); + } + }, + + setRequestHeaders: function() { + var requestHeaders = + ['X-Requested-With', 'XMLHttpRequest']; + + if (this._options._method == 'post') { + requestHeaders.push('Content-type', + 'application/x-www-form-urlencoded'); + + /* Force "Connection: close" for Mozilla browsers to work around + * a bug where XMLHttpReqeuest sends an incorrect Content-length + * header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType) + requestHeaders.push('Connection', 'close'); + } + + if (this._options.requestHeaders) + requestHeaders.push.apply(requestHeaders, this._options.requestHeaders); + + for (var i = 0; i < requestHeaders.length; i += 2) + this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); + }, + + onStateChange: function() { + var readystate = this.transport.readyState; + if (readystate != 1) + this.respondToReadyState(this.transport.readyState); + }, + + header: function(name) { + try { + return this.transport.getResponseHeader(name); + } catch (e) {} + }, + + evalResponse: function() { + try { + return eval(this.transport.responseText); + } catch (e) { + this.dispatchException(e); + } + }, + + respondToReadyState: function(readystate) { + var event = Ajax.Request.Events[readystate]; + + if (event == 'Complete') { + try { + (this._options['on' + this.transport.status] + || this._options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')] + || Ajax.emptyFunction)(this.transport); + } catch (e) { + this.dispatchException(e); + } + + if ((this.header('Content-type') || '').match("text\\/javascript")) + this.evalResponse(); + } + + try { + (this._options['on' + event] || Ajax.emptyFunction)(this.transport); + } catch (e) { + this.dispatchException(e); + } + + /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ + if (event == 'Complete') + this.transport.onreadystatechange = Ajax.emptyFunction; + }, + + dispatchException: function(exception) { + (this._options.onException || Ajax.emptyFunction)(this, exception); + } +}); + +var EventHelper = { + register : function(obj, ev,func){ + var oldev = obj[ev]; + + if (typeof oldev != 'function') { + obj[ev] = func; + } else { + obj[ev] = function() { + oldev(); + func(); + } + } + } +}; + +/* + Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work + of Simon Willison (see comments by Simon below). + http://ripcord.co.nz/behaviour/ +*/ + +var Behaviour = { + list : new Array, + + register : function(sheet){ + Behaviour.list.push(sheet); + }, + + init : function(){ + EventHelper.register(window, 'onload', function(){ + Behaviour.apply(); + }); + }, + + apply : function(){ + for (h=0;sheet=Behaviour.list[h];h++){ + for (selector in sheet) { + list = document.getElementsBySelector(selector); + if (!list) + continue; + for( i = 0; element = list[i]; i++ ) { + sheet[selector]( element ); + } + } + } + } +}; + +Behaviour.init(); + +function getAllChildren(e) { + // Returns all children of element. Workaround required for IE5/Windows. Ugh. + return e.all ? e.all : e.getElementsByTagName('*'); +} + +document.getElementsBySelector = function(selector) { + // Attempt to fail gracefully in lesser browsers + if (!document.getElementsByTagName) { + return new Array(); + } + // Split selector in to tokens + var tokens = selector.split(' '); + var currentContext = new Array(document); + for (var i = 0; i < tokens.length; i++) { + token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');; + if (token.indexOf('#') > -1) { + // Token is an ID selector + var bits = token.split('#'); + var tag_name = bits[0]; + var id = bits[1]; + var element = document.getElementById(id); + if (element == null || tag_name && element.nodeName.toLowerCase() != tag_name ) { + // tag with that ID not found, return false + return new Array(); + } + // Set currentContext to contain just this element + currentContext = new Array(element); + continue; // Skip to next token + } + if (token.indexOf('.') > -1) { + // Token contains a class selector + var bits = token.split('.'); + var tag_name = bits[0]; + var class_name = bits[1]; + if (!tag_name) { + tag_name = '*'; + } + // Get elements matching tag, filter them for class selector + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tag_name == '*') { + elements = getAllChildren(currentContext[h]); + } else { + elements = currentContext[h].getElementsByTagName(tag_name); + } + if( elements == null ) + continue; + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (found[k].className && found[k].className.match(new RegExp("\\b"+class_name+"\\b"))) { + currentContext[currentContextIndex++] = found[k]; + } + } + continue; // Skip to next token + } + + // [evgeny] code for attribute selection is removed... + + if (!currentContext[0]){ + return; + } + + // If we get here, token is JUST an element (not a class or ID selector) + tag_name = token; + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements = currentContext[h].getElementsByTagName(tag_name); + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = found; + } + return currentContext; +}; + +var NodeUtils = { + + getNodeValue: function(parent,name) { + var nodes = parent.getElementsByTagName( name ); + if( nodes.length == 0 ) + return ""; + nodes = nodes[0].childNodes; + var reslt = ""; + for( i = 0; i < nodes.length; i++ ) + reslt += nodes[i].nodeValue; + return reslt; + }, + + getNodeText: function(_node) { + var _nodes = _node.childNodes; + var _text = ""; + for( i = 0; i < _nodes.length; i++ ) + _text += _nodes[i].nodeValue; + return _text; + }, + + getAttrValue: function(parent,name) { + for( k=0; k < parent.attributes.length; k++ ) + if( parent.attributes[k].nodeName == name ) + return parent.attributes[k].nodeValue; + return null; + } +}; + +var CommonUtils = { + getRow: function(_id,_table) { + var _row = _table.rows[_id]; + if( _row != null ) + return _row; + if( _table.rows['head'] != null ) + return null; + + for( k=0; k < _table.rows.length; k++ ) { + if( _table.rows[k].id == _id ) + return _table.rows[k]; + } + return null; + }, + + getCell: function(_id,_row,_table) { + var _cell = _row.cells[_id]; + if( _cell != null ) + return _cell; + if( _table.rows['head'] != null ) + return null; + for( k=0; k < _row.cells.length; k++ ) { + if( _row.cells[k].id == _id ) + return _row.cells[k]; + } + return null; + }, + + insertCell: function(_row,_id,_className,_align,_height, _inner) { + var cell = _row.insertCell(-1); + cell.id = _id; + if(_align) + cell.align = _align; + cell.className = _className; + if(_height) + cell.height = _height; + cell.innerHTML = _inner; + } +}; diff --git a/src/obfuscator/src/page_chat.js b/src/obfuscator/src/page_chat.js new file mode 100644 index 00000000..3d9771af --- /dev/null +++ b/src/obfuscator/src/page_chat.js @@ -0,0 +1,330 @@ +var FrameUtils = { + getDocument: function(frm) { + if (frm.contentDocument) { + return frm.contentDocument; + } else if (frm.contentWindow) { + return frm.contentWindow.document; + } else if (frm.document) { + return frm.document; + } else { + alert( myRealAgent + ": cannot find document in frame " + frm); + //for( var a in frm ) + // alert( a ); + return null; + } + }, + + initFrame: function(frm) { + var doc = this.getDocument(frm); + doc.open(); + doc.write(""); + doc.write(""); + doc.write(""); + doc.write("
"); + doc.write(""); + doc.close(); + frm.onload = function() { + if( frm./**/myHtml ) { + FrameUtils.getDocument(frm).getElementById('content').innerHTML += frm.myHtml; + FrameUtils.scrollDown(frm); + } + }; + }, + + insertIntoFrame: function(frm, htmlcontent) { + var vcontent = this.getDocument(frm).getElementById('content'); + if( vcontent == null ) { + if( !frm.myHtml ) frm.myHtml = ""; + frm.myHtml += htmlcontent; + } else { + vcontent.innerHTML += htmlcontent; + } + }, + + scrollDown: function(frm) { + var vbottom = this.getDocument(frm).getElementById('bottom'); + if( myAgent == 'opera' ) { + frm.contentWindow.scrollTo(0,this.getDocument(frm).getElementById('content').clientHeight); + } else if( vbottom ) + vbottom.scrollIntoView(false); + } +}; + +Ajax.ChatThreadUpdater = Class.create(); +Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, { + + initialize: function(_options) { + this.setOptions(_options); + this._options.onComplete = this.requestComplete.bind(this); + this.updater = {}; + this.frequency = (this._options.frequency || 2); + FrameUtils.initFrame(this._options.container); + if( this._options.message ) { + this._options.message.onkeydown = this.handleKeyDown.bind(this); + this._options.message.onfocus = (function() { this.focused = true; }).bind(this); + this._options.message.onblur = (function() { this.focused = false; }).bind(this) + } + this.update(); + }, + + updateOptions: function(act) { + this._options.parameters = 'act='+act+'&thread=' + (this._options.threadid || -1) + + '&token=' + (this._options.token || 0)+ + '&lastid=' + (this._options.lastid || 0); + if( this._options.user ) + this._options.parameters += "&user=true"; + }, + + enableInput: function(val) { + if( this._options.message ) + this._options.message.disabled = !val; + }, + + stopUpdate: function() { + this.enableInput(true); + if( this.updater._options ) + this.updater._options.onComplete = undefined; + clearTimeout(this.timer); + }, + + update: function() { + this.updateOptions("refresh"); + this.updater = new Ajax.Request(this._options.servl, this._options); + }, + + requestComplete: function(_response) { + this.enableInput(true); + var xmlRoot = Ajax.getXml(_response); + if( xmlRoot && xmlRoot.tagName == 'thread' ) { + this.updateContent( xmlRoot ); + } else { + this.handleError(_response, xmlRoot, 'refresh messages failed'); + } + + this.timer = setTimeout(this.update.bind(this), this.frequency * 1000); + }, + + postMessage: function(msg) { + this.stopUpdate(); + this.updateOptions("post"); + var postOptions = {}.extend(this._options); + postOptions.parameters += "&message=" + encodeURIComponent(msg); + postOptions.onComplete = (function(presponse) { + this.requestComplete( presponse ); + if( this._options.message ) { + this._options.message.value = ''; + this._options.message.focus(); + } + }).bind(this); + this.enableInput(false); + this.updater = new Ajax.Request(this._options.servl, postOptions); + }, + + changeName: function(newname) { + new Ajax.Request(this._options.servl, {parameters:'act=rename&thread=' + (this._options.threadid || -1) + + '&token=' + (this._options.token || 0) + '&name=' + encodeURIComponent(newname)}); + }, + + onThreadClosed: function(_response) { + var xmlRoot = Ajax.getXml(_response); + if( xmlRoot && xmlRoot.tagName == 'closed' ) { + setTimeout('window.close()', 2000); + } else { + this.handleError(_response, xmlRoot, 'cannot close'); + } + }, + + closeThread: function() { + var _params = 'act=close&thread=' + (this._options.threadid || -1) + '&token=' + (this._options.token || 0); + if( this._options.user ) + _params += "&user=true"; + new Ajax.Request(this._options.servl, {parameters:_params, onComplete: this.onThreadClosed.bind(this)}); + }, + + processMessage: function(_target, message) { + var destHtml = NodeUtils.getNodeText(message); + FrameUtils.insertIntoFrame(_target, destHtml ); + }, + + setupAvatar: function(avatar) { + var imageLink = NodeUtils.getNodeText(avatar); + if( this._options.avatar && this._options.user ) { + this._options.avatar.innerHTML = imageLink != "" + ? "\"\"\"\"/" + : ""; + } + }, + + updateContent: function(xmlRoot) { + var haveMessage = false; + + var result_div = this._options.container; + var _lastid = NodeUtils.getAttrValue(xmlRoot, "lastid"); + if( _lastid ) + this._options.lastid = _lastid; + + for( var i = 0; i < xmlRoot.childNodes.length; i++ ) { + var node = xmlRoot.childNodes[i]; + haveMessage = true; + if( node.tagName == 'message' ) + this.processMessage(result_div, node); + else if( node.tagName == 'avatar' ) + this.setupAvatar(node); + // TODO thread events + } + if( haveMessage ) { + FrameUtils.scrollDown(this._options.container); + if( !this.focused ) + window.focus(); + } + }, + + handleKeyDown: function(k) { + if( k ){ ctrl=k.ctrlKey;k=k.which; } else { k=event.keyCode;ctrl=event.ctrlKey; } + if( this._options.message && ((k==13 && ctrl) || (k==10)) ) { + this.postMessage( this._options.message.value ); + return false; + } + return true; + }, + + handleError: function(_response, xmlRoot, _action) { + if( xmlRoot && xmlRoot.tagName == 'error' ) { + this.setStatus(NodeUtils.getNodeValue(xmlRoot,"descr")); + } else { + this.setStatus(_action+', ' + Ajax.getError(_response)); + } + }, + + setStatus: function(k) { + if( this.statusTimeout ) + clearTimeout(this.statusTimeout); + window.status = k; + this.statusTimeout = setTimeout(this.clearStatus.bind(this), 4000); + }, + + clearStatus: function() { + window.status = ""; + } +}); + + +HSplitter = Class.create(); +HSplitter.prototype = { + initialize: function(_options) { + this._options = _options; + this.captured = 0; + if( this._options.first && this._options.second && this._options.control ) { + this._options.control.onmousedown = this.onmousedownEvent.bind(this); + this._options.control.onmouseup = this.onmouseupEvent.bind(this); + this._options.control.onmousemove = this.onmouseMoveEvent.bind(this); + } + }, + + onmousedownEvent: function(e) { + var ev = e || event; + + if( this._options.control.setCapture ) + this._options.control.setCapture(); + this.start_height = this._options.first.style.pixelHeight || this._options.first.clientHeight; + this.start_offset = ev.screenY; + this._options.maxfirst = this._options.first.style.pixelHeight + this._options.second.clientHeight - this._options.minsec; + this.captured = 1; + }, + + onmouseupEvent: function() { + if( this.captured ) { + if( this._options.control.releaseCapture ) + this._options.control.releaseCapture(); + this.captured = 0; + } + }, + + onmouseMoveEvent: function(e) { + var ev = e || event; + + if( this.captured ) { + var new_height = this.start_height - (ev.screenY - this.start_offset); + if( new_height > this._options.maxfirst ) + new_height = this._options.maxfirst; + else if( new_height < this._options.minfirst ) + new_height = this._options.minfirst; + if( myAgent == 'moz' ) + this._options.first.style.height=new_height+'px'; + else + this._options.first.style.pixelHeight = new_height; + } + } +}; + +var Chat = { + threadUpdater : {}, + hSplitter : {}, + + applyName: function() { + Chat.threadUpdater.changeName($('uname').value); + $('changename1').style.display='none'; + $('changename2').style.display='inline'; + }, + + showNameField: function() { + $('changename1').style.display='inline'; + $('changename2').style.display='none'; + } +}; + +Behaviour.register({ + '#postmessage a' : function(el) { + el.onclick = function() { + var message = $('msgwnd'); + if( message ) + Chat.threadUpdater.postMessage(message.value); + }; + }, + 'select#predefined' : function(el) { + el.onchange = function() { + var message = $('msgwnd'); + message.value = this.options[this.selectedIndex].innerText || this.options[this.selectedIndex].innerHTML; + this.selectedIndex = 0; + message.focus(); + }; + }, + 'div#changename2 a' : function(el) { + el.onclick = function() { + Chat.showNameField(); + return false; + }; + }, + 'div#changename1 a' : function(el) { + el.onclick = function() { + Chat.applyName(); + return false; + }; + }, + 'div#changename1 input#uname' : function(el) { + el.onkeydown = function(e) { + var ev = e || event; + if( ev.keyCode == 13 ) { + Chat.applyName(); + } + }; + }, + 'a#refresh' : function(el) { + el.onclick = function() { + Chat.threadUpdater.stopUpdate(); + Chat.threadUpdater.update(); + }; + }, + 'a.closethread' : function(el) { + el.onclick = function() { + Chat.threadUpdater.closeThread(); + }; + } +}); + +EventHelper.register(window, 'onload', function(){ + Chat.webimRoot = threadParams.wroot; + Chat.hSplitter = new HSplitter({control:$("spl1"), first:$("msgwndtd"), second:$("chatwndtd"), minfirst:30, minsec:30}); + Chat.threadUpdater = new Ajax.ChatThreadUpdater(({container:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}).extend( threadParams || {} )); +}); diff --git a/src/obfuscator/src/page_pendingclients.js b/src/obfuscator/src/page_pendingclients.js new file mode 100644 index 00000000..a6dc21cf --- /dev/null +++ b/src/obfuscator/src/page_pendingclients.js @@ -0,0 +1,286 @@ +Ajax.PeriodicalUpdater = Class.create(); +Class.inherit( Ajax.PeriodicalUpdater, Ajax.Base, { + + initialize: function(_options) { + this.setOptions(_options); + this._options.onComplete = this.requestComplete.bind(this); + this._options.onException = this.handleException.bind(this); + this.frequency = (this._options.frequency || 2); + this.updater = {}; + this.update(); + }, + + handleException: function(_request, ex) { + if( this._options.handleError ) + this._options.handleError( ex.name + " occured: " + ex.message ); + this.stopUpdate(); + this.timer = setTimeout(this.update.bind(this), this.frequency * 1000); + }, + + stopUpdate: function() { + if( this.updater._options ) + this.updater._options.onComplete = undefined; + clearTimeout(this.timer); + }, + + update: function() { + if( this._options.updateParams ) + this._options.parameters = (this._options.updateParams)(); + this.updater = new Ajax.Request(this._options.url, this._options); + }, + + requestComplete: function(presponse) { + if (presponse != null && presponse.status == 200 ) { + var xmlDoc = presponse.responseXML; + (this._options.updateContent || Ajax.emptyFunction)( xmlDoc ); + } else { + if( this._options.handleError ) + this._options.handleError(Ajax.getError(_response)); + } + + this.timer = setTimeout(this.update.bind(this), this.frequency * 1000); + } +}); + +var HtmlGenerationUtils = { + + insertSplitter: function( _row ) { + var cell = _row.insertCell(-1); + cell.style.backgroundImage = 'url('+webimRoot+'/images/tablediv3.gif)'; + cell.innerHTML = ''; + }, + + removeHr: function(_table, _index ) { + _table.deleteRow(_index+2); + _table.deleteRow(_index+1); + _table.deleteRow(_index); + }, + + insertHr: function(_table, _index) { + var row = _table.insertRow(_index); + var cell = row.insertCell(-1); + cell.colSpan = 13; + cell.height = 2; + + row = _table.insertRow(_index); + cell = row.insertCell(-1); + cell.colSpan = 13; + cell.style.backgroundColor = '#E1E1E1'; + cell.innerHTML = ''; + + row = _table.insertRow(_index); + cell = row.insertCell(-1); + cell.colSpan = 13; + cell.height = 2; + }, + + popupLink: function(link, title, wndid, inner, width, height) { + return ''+ + inner+''; + }, + + generateOneRowTable: function(content) { + return '' + content + '
'; + }, + + viewOpenCell: function(username,servlet,id,canview,canopen,ban,message) { + var cellsCount = 2; + var link = servlet+"?thread="+id; + var innerContent = ( ban == "full" ) ? ""+username+"" : ( ( ban == "other" ) ? ""+username+"" : username ); + var gen = ''; + gen += HtmlGenerationUtils.popupLink( canopen ? link : link+"&viewonly=true", localized[canopen ? 0 : 1], "ImCenter"+id, innerContent, 600, 420); + gen += ''; + if( canopen ) { + gen += ''; + gen += HtmlGenerationUtils.popupLink( link, localized[0], "ImCenter"+id, ''+localized[0]+'', 600, 420); + gen += ''; + cellsCount++; + } + + return HtmlGenerationUtils.generateOneRowTable(gen); + } + + +}; + +Ajax.ThreadListUpdater = Class.create(); +Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, { + + initialize: function(_options) { + this.setOptions(_options); + this._options.updateParams = this.updateParams.bind(this); + this._options.handleError = this.handleError.bind(this); + this._options.updateContent = this.updateContent.bind(this); + this._options.lastrevision = 0; + this.delta = 0; + this.t = this._options.table; + this.periodicalUpdater = new Ajax.PeriodicalUpdater(this._options); + }, + + updateParams: function() { + return "company=" + this._options.company + "&since=" + this._options.lastrevision; + }, + + setStatus: function(msg) { + this._options.status.innerHTML = msg; + }, + + handleError: function(s) { + this.setStatus( s ); + }, + + updateThread: function(node) { + var id, stateid, vstate, canview = false, canopen = false, ban = null; + + for( var i = 0; i < node.attributes.length; i++ ) { + var attr = node.attributes[i]; + if( attr.nodeName == "id" ) + id = attr.nodeValue; + else if( attr.nodeName == "stateid" ) + stateid = attr.nodeValue; + else if( attr.nodeName == "state" ) + vstate = attr.nodeValue; + else if( attr.nodeName == "canopen" ) + canopen = true; + + } + + function setcell(_table, row,id,pcontent) { + var cell = CommonUtils.getCell( id, row, _table ); + if( cell ) + cell.innerHTML = pcontent; + } + + var row = CommonUtils.getRow("thr"+id, this.t); + if( stateid == "closed" ) { + if( row ) { + HtmlGenerationUtils.removeHr(this.t, row.rowIndex+1); + this.t.deleteRow(row.rowIndex); + } + return; + } + + var vname = NodeUtils.getNodeValue(node,"name"); + var vaddr = NodeUtils.getNodeValue(node,"addr"); + var vtime = NodeUtils.getNodeValue(node,"time"); + var agent = NodeUtils.getNodeValue(node,"agent"); + var modified = NodeUtils.getNodeValue(node,"modified"); + var message = NodeUtils.getNodeValue(node,"message"); + var etc = ""; + + + + var startRow = CommonUtils.getRow(stateid, this.t); + var endRow = CommonUtils.getRow(stateid+"end", this.t); + + if( row != null && (row.rowIndex <= startRow.rowIndex || row.rowIndex >= endRow.rowIndex ) ) { + HtmlGenerationUtils.removeHr(this.t, row.rowIndex+1); + this.t.deleteRow(row.rowIndex); + row = null; + } + if( row == null ) { + row = this.t.insertRow(startRow.rowIndex+1); + HtmlGenerationUtils.insertHr(this.t, startRow.rowIndex+2); + row.id = "thr"+id; + CommonUtils.insertCell(row, "name", "table", null, 30, HtmlGenerationUtils.viewOpenCell(vname,this._options.agentservl,id,canview,canopen,ban,message) ); + HtmlGenerationUtils.insertSplitter(row); + CommonUtils.insertCell(row, "contid", "table", "center", null, vaddr ); + HtmlGenerationUtils.insertSplitter(row); + CommonUtils.insertCell(row, "state", "table", "center", null, vstate ); + HtmlGenerationUtils.insertSplitter(row); + CommonUtils.insertCell(row, "op", "table", "center", null, agent ); + HtmlGenerationUtils.insertSplitter(row); + CommonUtils.insertCell(row, "time", "table", "center", null, this.getTimeSince(vtime) ); + HtmlGenerationUtils.insertSplitter(row); + CommonUtils.insertCell(row, "wait", "table", "center", null, (stateid!='chat' ? this.getTimeSince(modified) : '-') ); + HtmlGenerationUtils.insertSplitter(row); + CommonUtils.insertCell(row, "etc", "table", "center", null, etc ); + + if( stateid == 'wait' || stateid == 'prio' ) + return true; + } else { + setcell(this.t, row,"name",HtmlGenerationUtils.viewOpenCell(vname,this._options.agentservl,id,canview,canopen,ban,message)); + setcell(this.t, row,"contid",vaddr); + setcell(this.t, row,"state",vstate); + setcell(this.t, row,"op",agent); + setcell(this.t, row,"time",this.getTimeSince(vtime)); + setcell(this.t, row,"wait",(stateid!='chat' ? this.getTimeSince(modified) : '-')); + setcell(this.t, row,"etc",etc); + } + return false; + }, + + updateQueueMessages: function() { + function updateQueue(t,id,nclients) { + var startRow = t.rows[id]; + var endRow = t.rows[id+"end"]; + if( startRow == null || endRow == null ) + return; + var _status = endRow.cells["status"]; + if( _status == null ) + return; + _status.innerHTML = (startRow.rowIndex + 1 == endRow.rowIndex) ? nclients : ""; + _status.height = (startRow.rowIndex + 1 == endRow.rowIndex) ? 30 : 10; + } + + updateQueue(this.t, "wait", this._options.noclients); + updateQueue(this.t, "prio", this._options.noclients); + updateQueue(this.t, "chat", this._options.noclients); + }, + + getTimeSince: function(srvtime) { + var secs = Math.floor(((new Date()).getTime()-srvtime-this.delta)/1000); + var minutes = Math.floor(secs/60); + var prefix = ""; + secs = secs % 60; + if( secs < 10 ) + secs = "0" + secs; + if( minutes >= 60 ) { + var hours = Math.floor(minutes/60); + minutes = minutes % 60; + if( minutes < 10 ) + minutes = "0" + minutes; + prefix = hours + ":"; + } + + return prefix + minutes+":"+secs; + }, + + updateContent: function(xmldoc) { + var root = xmldoc.documentElement; + var newAdded = false; + if( root.tagName == 'threads' ) { + var _time = NodeUtils.getAttrValue(root, "time"); + var _revision = NodeUtils.getAttrValue(root, "revision" ); + + if( _time ) + this.delta = (new Date()).getTime() - _time; + if( _revision ) + this._options.lastrevision = _revision; + + for( var i = 0; i < root.childNodes.length; i++ ) { + var node = root.childNodes[i]; + if( node.tagName == 'thread' ) + if( this.updateThread(node) ) + newAdded = true; + } + this.updateQueueMessages(); + this.setStatus( "Up to date" ); + if( newAdded ) + window.focus(); + } else if( root.tagName == 'error' ) { + this.setStatus( "error: " + NodeUtils.getNodeValue(root,"descr") ); + } else { + this.setStatus( "wrong response" ); + } + } +}); + +var webimRoot = ""; + +EventHelper.register(window, 'onload', function(){ + webimRoot = updaterOptions.wroot; + new Ajax.ThreadListUpdater(({table:$("threadlist"),status:$("connstatus")}).extend(updaterOptions || {})); +}); + diff --git a/src/webim/js/brws.js b/src/webim/js/brws.js index 366f649d..7474f85c 100644 --- a/src/webim/js/brws.js +++ b/src/webim/js/brws.js @@ -1 +1 @@ -var myAgent="";var kj=0;var myRealAgent="";function lj(){var oj=["\157pe\162a","\u006d\u0073\u0069\145","\163\141\146ar\u0069","\146i\u0072\u0065f\u006f\170","\u006e\u0065ts\143a\u0070\145","\u006d\u006f\u007ai\u006cl\u0061"];var ai=navigator.userAgent.toLowerCase();for(var i=0;i=0310&&iq.status<(273+27)){var jq=iq.responseXML;if(jq&&jq.documentElement)return jq.documentElement;} return null;} ,kq:function(iq){return iq.statusText||"\u0063\u006fn\156\u0065ct\u0069o\u006e \145r\u0072\157\162\u0020N"+iq.status;} ,lq:function(){} } ;tq.oq=function(){} ;tq.oq.prototype={pq:function(dq){this.dq={eq:'\u0070o\163\u0074',fq:true,gq:''} .hn(dq||{} );} ,aq:function(){return this.bq.status==undefined ||this.bq.status==0 ||(this.bq.status>=(153+47)&&this.bq.status<(191+109));} ,cq:function(){return!this.aq();} } ;tq.vq=mn.nn();tq.vq.wq=['\u0055\u006einit\151\141li\172e\u0064','\u004c\157a\u0064\u0069ng','Lo\u0061d\145\144','\u0049\u006e\164\u0065ra\u0063ti\166e','C\157m\u0070\154\145\u0074e'];mn.sn(tq.vq,tq.oq,{qn:function(url,dq){this.bq=tq.uq();this.pq(dq);this.xq(url);} ,xq:function(url){var gq=this.dq.gq||'';if(gq.length>0)gq+='&\137=';try{if(this.dq.eq=='\147\u0065\164'&&gq.length>0)url+='\077'+gq;this.bq.open(this.dq.eq,url,this.dq.fq);if(this.dq.fq){this.bq.onreadystatechange=this.yq.pn(this);setTimeout((function(){this.zq(1)} ).pn(this),012);} this.$q();var _q=this.dq.mr?this.dq.mr:gq;this.bq.send(this.dq.eq=='\u0070\157\u0073t'?_q:null);} catch(e){this.nr(e);} } ,$q:function(){var qr=['X\055\122equ\u0065\163\u0074e\144\055\127i\164\u0068','\130MLH\164\164pRe\161u\145s\164'];if(this.dq.eq=='p\u006fst'){qr._n('C\u006fn\u0074e\156t\055t\171\u0070\u0065','\141p\u0070\u006cica\u0074\151\157\u006e\057x-w\u0077\u0077\055f\u006frm\u002d\u0075r\154\u0065\156c\157\144ed');if(this.bq.overrideMimeType)qr._n('Connect\151\157\156','clos\145');} if(this.dq.qr)qr._n.rn(qr,this.dq.qr);for(var i=0;i-1){var wr=token.split('#');var xr=wr[0];var id=wr[1];var element=document.getElementById(id);if(element==null||xr&&element.nodeName.toLowerCase()!=xr){return new Array();} vr=new Array(element);continue;} if(token.indexOf('.')>-1){var wr=token.split('.');var xr=wr[0];var yr=wr[1];if(!xr){xr='\052';} var zr=new Array;var $r=0;for(var h=0;h=(158+42)&&iq.status<0x12c){var jq=iq.responseXML;if(jq&&jq.documentElement)return jq.documentElement;} return null;} ,kq:function(iq){return iq.statusText||"\u0063o\u006e\156\u0065ct\u0069on\u0020\145\u0072\u0072\u006f\u0072\u0020N"+iq.status;} ,lq:function(){} } ;tq.oq=function(){} ;tq.oq.prototype={pq:function(dq){this.dq={eq:'p\u006f\163\164',fq:true,gq:''} .hn(dq||{} );} ,aq:function(){return this.bq.status==undefined ||this.bq.status==0 ||(this.bq.status>=0xc8&&this.bq.status<(213+87));} ,cq:function(){return!this.aq();} } ;tq.vq=mn.nn();tq.vq.wq=['Un\151\u006e\u0069t\u0069al\u0069\u007a\u0065\144','\u004c\157\u0061d\151\u006e\147','Load\u0065\144','I\u006e\164\u0065\162a\143\164i\u0076\145','\u0043\157m\160\154\145\164\u0065'];mn.sn(tq.vq,tq.oq,{qn:function(url,dq){this.bq=tq.uq();this.pq(dq);this.xq(url);} ,xq:function(url){var gq=this.dq.gq||'';if(gq.length>0)gq+='&\137\u003d';try{if(this.dq.eq=='g\145t'&&gq.length>0)url+='?'+gq;this.bq.open(this.dq.eq,url,this.dq.fq);if(this.dq.fq){this.bq.onreadystatechange=this.yq.pn(this);setTimeout((function(){this.zq(1)} ).pn(this),(8+2));} this.$q();var _q=this.dq.mr?this.dq.mr:gq;this.bq.send(this.dq.eq=='p\157\163t'?_q:null);} catch(e){this.nr(e);} } ,$q:function(){var qr=['X-\122e\u0071\165\145s\u0074\145\u0064-\127\151t\150','X\115LH\u0074\164\u0070\u0052e\u0071\165es\u0074'];if(this.dq.eq=='pos\164'){qr._n('\103\157\156\u0074\u0065\u006et\u002d\164\171\160\u0065','a\160p\154ic\u0061\164i\u006f\156\057\170-\u0077\167\167-form\055\165\162l\u0065\156\143o\144ed');if(this.bq.overrideMimeType)qr._n('\u0043\157\156n\145\u0063\164\151\157\156','\143\u006cos\u0065');} if(this.dq.qr)qr._n.rn(qr,this.dq.qr);for(var i=0;i-1){var wr=token.split('#');var xr=wr[0];var id=wr[1];var element=document.getElementById(id);if(element==null||xr&&element.nodeName.toLowerCase()!=xr){return new Array();} vr=new Array(element);continue;} if(token.indexOf('\u002e')>-1){var wr=token.split('.');var xr=wr[0];var yr=wr[1];if(!xr){xr='\052';} var zr=new Array;var $r=0;for(var h=0;h\074\150\145\u0061d\u003e");zs.write("\074l\151\u006ek\u0020\u0072\u0065l=\"sty\u006c\u0065\u0073h\145\145\u0074\" \u0074\171pe\u003d\"\u0074ex\u0074\057\143\163s\" \u006de\144\151\u0061\075\"a\154\u006c\"\u0020\u0068\162\u0065f=\"/\u0077eb\151m\u002f\u0063ha\164\056c\u0073\u0073\"\040\057\076");zs.write("\u003c/h\u0065a\u0064>\074\u0062\u006f\144y \142\147\143\u006f\154\u006f\162\075'\u0023\106F\106\u0046F\106'\u0020t\145x\u0074='\u002300\060\0600\060'\u0020li\156k\u003d'\043C28\u00340\u0030'\040\166li\u006e\u006b='\u0023\103\u0032\070\06400' \141\u006c\151n\153\u003d'\u0023C\062\070\u00340\u0030' \155a\u0072\147\u0069nwid\u0074\150\075'0'\u0020\u006d\u0061\162\147\151\u006e\u0068\145i\147\150t\075'0'\u0020l\u0065ftm\u0061\u0072g\151\u006e\u003d'\u0030'\u0020\162ig\u0068\u0074\u006dar\u0067\u0069n\075'\u0030' top\u006dar\147i\u006e='0'\040\142\157\u0074tom\155\u0061r\147\151\u006e\u003d'0'\u003e");zs.write("<\164\141\142l\u0065 \167\151\u0064\164\u0068\075'1\u0030\u0030%'\040ce\u006clsp\141c\u0069\156g\u003d'\060'\u0020cel\u006cp\141d\u0064ing\075'0' \u0062\157r\u0064\u0065\u0072='\060'\076\u003c\164\u0072\u003e<\u0074\144\040va\154\151\u0067\156='\164\157p' \u0063\u006cass='m\u0065\u0073\u0073\u0061g\u0065'\040id\075'\143\u006f\156\u0074\145n\164'><\u002f\u0074d\u003e<\057\u0074\u0072\u003e\u003c/\164able\076\074\u0061\040\u0069d\075'bo\u0074to\u006d'\u002f>");zs.write("<\u002fbo\u0064\u0079>\074/ht\155\154\076");zs.close();xs.onload=function(){if(xs.$s){vs.ws(xs).getElementById('\u0063o\u006ete\u006e\u0074').innerHTML+=xs.$s;vs._s(xs);} } ;} ,mt:function(xs,nt){var qt=this.ws(xs).getElementById('\143\157\u006e\u0074\145\u006e\u0074');if(qt==null){if(!xs.$s)xs.$s="";xs.$s+=nt;} else{qt.innerHTML+=nt;} } ,_s:function(xs){var rt=this.ws(xs).getElementById('\142\157\164t\157m');if(myAgent=='op\u0065\u0072a'){xs.contentWindow.scrollTo(0,this.ws(xs).getElementById('c\157nten\164').clientHeight);} else if(rt)rt.scrollIntoView(false);} } ;tq.st=mn.nn();mn.sn(tq.st,tq.oq,{qn:function(dq){this.pq(dq);this.dq.onComplete=this.tt.pn(this);this.ut={} ;this.frequency=(this.dq.frequency||2);vs.ys(this.dq.ht);if(this.dq.it){this.dq.it.onkeydown=this.jt.pn(this);this.dq.it.onfocus=(function(){this.kt=true;} ).pn(this);this.dq.it.onblur=(function(){this.kt=false;} ).pn(this)} this.lt();} ,ot:function(pt){this.dq.gq='\u0061c\u0074='+pt+'&\164hre\141d='+(this.dq.threadid||-1)+'\u0026to\153en\u003d'+(this.dq.token||0)+'\046l\141\163ti\u0064='+(this.dq.dt||0);if(this.dq.user)this.dq.gq+="\046u\u0073\145\u0072=\164\u0072\u0075e";} ,et:function(ft){if(this.dq.it)this.dq.it.disabled=!ft;} ,gt:function(){this.et(true);if(this.ut.dq)this.ut.dq.onComplete=undefined;clearTimeout(this.at);} ,lt:function(){this.ot("\u0072efr\u0065sh");this.ut=new tq.vq(this.dq.servl,this.dq);} ,tt:function(iq){this.et(true);var bt=tq.hq(iq);if(bt&&bt.tagName=='t\u0068\u0072e\u0061d'){this.ct(bt);} else{this.vt(iq,bt,'\u0072e\u0066\u0072esh \155\u0065\u0073\163\141\147\145s\u0020\146aile\u0064');} this.at=setTimeout(this.lt.pn(this),this.frequency*(877+123));} ,wt:function(xt){this.gt();this.ot("\u0070\u006fst");var yt={} .hn(this.dq);yt.gq+="\046\u006d\u0065\u0073\u0073a\147\u0065\075"+encodeURIComponent(xt);yt.onComplete=(function(zt){this.tt(zt);if(this.dq.it){this.dq.it.value='';this.dq.it.focus();} } ).pn(this);this.et(false);this.ut=new tq.vq(this.dq.servl,yt);} ,$t:function(_t){new tq.vq(this.dq.servl,{gq:'\u0061\u0063\164\u003d\162\u0065na\u006d\145&t\u0068\u0072ea\144='+(this.dq.threadid||-1)+'\u0026to\u006ben\u003d'+(this.dq.token||0)+'&\u006ea\u006d\145='+encodeURIComponent(_t)} );} ,mu:function(iq){var bt=tq.hq(iq);if(bt&&bt.tagName=='\143lo\u0073\145d'){setTimeout('\u0077ind\157\u0077\056\u0063l\u006fs\u0065\u0028)',03720);} else{this.vt(iq,bt,'\u0063a\u006en\157\u0074 \143l\157\163e');} } ,nu:function(){var qu='a\u0063\164\075\u0063l\u006fs\u0065\u0026\164\u0068\u0072e\141\u0064='+(this.dq.threadid||-1)+'\046\u0074oke\156\075'+(this.dq.token||0);if(this.dq.user)qu+="\u0026\165\163er\u003d\u0074\162ue";new tq.vq(this.dq.servl,{gq:qu,onComplete:this.mu.pn(this)} );} ,ru:function(su,it){var tu=ms.ss(it);vs.mt(su,tu);} ,ct:function(bt){var uu=false;var hu=this.dq.ht;var iu=ms.is(bt,"\u006c\u0061\163tID");if(iu)this.dq.dt=iu;for(var i=0;ithis.dq.zu)_u=this.dq.zu;else if(_u");zs.write("\074l\151\156\153 \u0072e\154\u003d\"\163\u0074\171l\u0065\163heet\"\u0020t\171\160e\075\"\u0074\145x\u0074\u002f\143\u0073s\" m\u0065\u0064ia\075\"\u0061\154\u006c\"\u0020h\u0072\145f\u003d\""+$s._s+"\u002f\143h\141\164\056\143ss\"\u0020\u002f\076");zs.write("\074\u002f\u0068\145\141d><\142ody b\u0067\u0063\u006f\154\157r='#F\u0046F\u0046F\u0046' \164e\170t='\04300\060000'\040li\u006ek='#\u00432\u0038\064\0600' vl\u0069\156\u006b='\043\10328\u003400'\u0020\141l\151\156\u006b='\043\u0043\062\07040\060' \155\u0061\u0072\u0067\u0069\u006ew\u0069\u0064\u0074\150\u003d'\060'\u0020\u006d\u0061rginh\u0065\151\u0067\u0068t\u003d'0'\040\154e\146\164\u006d\u0061\162\147\151n\075'0'\040\u0072\151\147h\164\u006d\141\162g\u0069\u006e\075'\060' \164o\u0070\155\141\u0072\147\u0069n\075'\u0030'\040b\157\164\u0074\u006f\155m\u0061r\u0067i\u006e='\u0030'\076");zs.write("\u003ct\141\142le\040\u0077\151dth='\061\0600\u0025' c\145\u006cls\u0070ac\151n\147\u003d'\u0030' \143e\154\154pa\u0064\144i\156\u0067='0'\u0020bo\u0072de\162\u003d'\u0030'\u003e\u003c\u0074r><\u0074\u0064 \u0076a\154\u0069\147\156='to\u0070'\u0020c\u006c\u0061\u0073\163='mes\163a\147\u0065'\040\u0069d\075'\143o\156\u0074\145nt'\076\074/t\141bl\u0065>\074\u0061\u0020\151\144='b\u006ftt\157\u006d'\u002f>");zs.write("<\057\u0062ody><\057h\u0074m\u006c\076");zs.close();xs.onload=function(){if(xs.mt){vs.ws(xs).getElementById('\143\u006f\u006e\u0074en\u0074').innerHTML+=xs.mt;vs.nt(xs);} } ;} ,qt:function(xs,rt){var st=this.ws(xs).getElementById('\u0063\u006fn\u0074\u0065\u006e\u0074');if(st==null){if(!xs.mt)xs.mt="";xs.mt+=rt;} else{st.innerHTML+=rt;} } ,nt:function(xs){var tt=this.ws(xs).getElementById('\142o\u0074\164o\155');if(myAgent=='o\u0070\145\u0072\u0061'){xs.contentWindow.scrollTo(0,this.ws(xs).getElementById('cont\145nt').clientHeight);} else if(tt)tt.scrollIntoView(false);} } ;tq.ut=mn.nn();mn.sn(tq.ut,tq.oq,{qn:function(dq){this.pq(dq);this.dq.onComplete=this.ht.pn(this);this.it={} ;this.frequency=(this.dq.frequency||2);vs.ys(this.dq.jt);if(this.dq.kt){this.dq.kt.onkeydown=this.lt.pn(this);this.dq.kt.onfocus=(function(){this.ot=true;} ).pn(this);this.dq.kt.onblur=(function(){this.ot=false;} ).pn(this)} this.pt();} ,dt:function(et){this.dq.gq='\u0061c\164\u003d'+et+'&\u0074h\u0072ea\u0064\u003d'+(this.dq.threadid||-1)+'\u0026\u0074\157\153e\u006e\075'+(this.dq.token||0)+'\u0026\u006c\u0061\u0073ti\144\u003d'+(this.dq.ft||0);if(this.dq.user)this.dq.gq+="\u0026user\075\164r\165e";} ,gt:function(at){if(this.dq.kt)this.dq.kt.disabled=!at;} ,bt:function(){this.gt(true);if(this.it.dq)this.it.dq.onComplete=undefined;clearTimeout(this.ct);} ,pt:function(){this.dt("\162\145\u0066r\145sh");this.it=new tq.vq(this.dq.servl,this.dq);} ,ht:function(iq){this.gt(true);var vt=tq.hq(iq);if(vt&&vt.tagName=='t\u0068\162\145\u0061\u0064'){this.wt(vt);} else{this.xt(iq,vt,'ref\162\145s\u0068\040\u006d\u0065\u0073sa\u0067es\040\u0066\u0061i\u006ced');} this.ct=setTimeout(this.pt.pn(this),this.frequency*01750);} ,yt:function(zt){this.bt();this.dt("p\u006f\163\u0074");var $t={} .hn(this.dq);$t.gq+="\046\u006dess\141\147e="+encodeURIComponent(zt);$t.onComplete=(function(_t){this.ht(_t);if(this.dq.kt){this.dq.kt.value='';this.dq.kt.focus();} } ).pn(this);this.gt(false);this.it=new tq.vq(this.dq.servl,$t);} ,mu:function(nu){new tq.vq(this.dq.servl,{gq:'a\u0063\u0074\075ren\u0061me&threa\u0064\u003d'+(this.dq.threadid||-1)+'\046t\u006f\u006be\u006e\u003d'+(this.dq.token||0)+'&na\u006d\145='+encodeURIComponent(nu)} );} ,qu:function(iq){var vt=tq.hq(iq);if(vt&&vt.tagName=='c\u006c\u006f\u0073e\u0064'){setTimeout('\u0077\u0069\u006edow\u002e\143\154\157\163\145(\u0029',(1818+182));} else{this.xt(iq,vt,'\u0063a\156no\u0074\u0020c\u006c\u006f\163e');} } ,ru:function(){var su='a\143t=\u0063l\157se&threa\u0064\u003d'+(this.dq.threadid||-1)+'&\u0074\157k\145\156='+(this.dq.token||0);if(this.dq.user)su+="&\165\u0073e\162\075t\u0072u\145";new tq.vq(this.dq.servl,{gq:su,onComplete:this.qu.pn(this)} );} ,tu:function(uu,kt){var hu=ms.ss(kt);vs.qt(uu,hu);} ,iu:function(ju){var ku=ms.ss(ju);if(this.dq.ju&&this.dq.user){this.dq.ju.innerHTML=ku!=""?"\u003c\u0069\155\u0067\u0020\163\u0072c\075\""+$s._s+"\u002f\u0069mage\163/fr\145\145\056\147\151f\"\u0020\u0077\151dt\u0068\u003d\"7\"\u0020h\u0065\u0069g\150\u0074=\"\u0031\" \142o\162d\u0065\u0072\u003d\"0\" \141lt=\"\"\040\057>":"";} } ,wt:function(vt){var lu=false;var ou=this.dq.jt;var pu=ms.is(vt,"l\141st\151d");if(pu)this.dq.ft=pu;for(var i=0;ithis.dq.qh)sh=this.dq.qh;else if(sh';} ,wh:function(content){return'\u003c\164\141\142\u006ce \u0077\151\u0064\164h\075"10\u0030\045"\040\143\u0065\u006c\u006c\u0073pac\u0069n\147\u003d"\060"\u0020c\145\154\154\u0070ad\144\u0069\u006e\147\u003d"0"\040\u0062\157r\144\u0065r\075"0">\u003ctr\076'+content+'';} ,xh:function(yh,zh,id,$h,_h,mi,it){var ni=2;var link=zh+"?\u0074hr\145\u0061\u0064="+id;var qi=(mi=="\u0066\u0075\154\u006c")?"\u003ci sty\u006ce\075'c\157\u006c\u006f\u0072\072\043\141\141\u0061\u0061aa\u003b'\076"+yh+"\u003c/\151\u003e":((mi=="\157\164\u0068e\162")?"<\u0069\u003e"+yh+"\074\057i>":yh);var ri='\074td \u0063\u006c\141\163\u0073\075"\164\141b\u006c\u0065" \u0073\164\171\154e="p\u0061d\u0064\151n\u0067-le\146t\0720\160x\u003b \u0070\u0061\u0064di\156g-r\u0069\147\u0068\u0074:\u0030px\073">';ri+=ph.bh(_h?link:link+"&v\151\145w\u006f\u006el\171\u003dtru\145",localized[_h?0:1],"I\u006d\u0043e\156t\145\u0072"+id,qi,01130,(288+132));ri+='\u003c\u002f\u0074d\u003e\074\164\u0064\u003e\u003c\151m\u0067\u0020s\u0072\u0063="\057w\u0065\142i\u006d\u002f\u0069m\141g\u0065s\u002f\u0066re\145.\u0067i\u0066"\u0020w\u0069d\u0074h\u003d"\u0035" \u0068\145\u0069ght="1" \u0062o\u0072\u0064\145r\u003d"0"\040\u0061\u006ct\u003d""\076=wi.rowIndex)){ph.eh(this.t,ah.rowIndex+1);this.t.deleteRow(ah.rowIndex);ah=null;} if(ah==null){ah=this.t.insertRow(vi.rowIndex+1);ph.gh(this.t,vi.rowIndex+2);ah.id="t\u0068r"+id;js.insertCell(ah,"\156\141\155\145","\u0074\141\u0062\u006c\145",null,0x1e,ph.xh(ei,this.dq.agentservl,id,$h,_h,mi,it));ph.dh(ah);js.insertCell(ah,"\143\157\u006et\151\144","\u0074a\u0062\154e","\143\145\u006et\145\u0072",null,fi);ph.dh(ah);js.insertCell(ah,"s\u0074at\u0065","tabl\u0065","\143\145nte\u0072",null,li);ph.dh(ah);js.insertCell(ah,"op","\u0074a\142\154e","cent\145r",null,ai);ph.dh(ah);js.insertCell(ah,"t\u0069\u006d\u0065","\164a\142\u006ce","c\145nt\145\u0072",null,this.xi(gi));ph.dh(ah);js.insertCell(ah,"\u0077\u0061\u0069t","t\u0061b\u006c\u0065","\u0063\u0065\156\u0074e\162",null,(ki!='\143h\u0061t'?this.xi(bi):'\055'));ph.dh(ah);js.insertCell(ah,"\145\u0074c","tab\u006c\u0065","\143e\u006e\u0074e\162",null,ci);if(ki=='w\u0061it'||ki=='p\u0072\151\157')return true;} else{pi(this.t,ah,"\156am\u0065",ph.xh(ei,this.dq.agentservl,id,$h,_h,mi,it));pi(this.t,ah,"\143o\156\164\151d",fi);pi(this.t,ah,"\163\164\u0061\164e",li);pi(this.t,ah,"\u006fp",ai);pi(this.t,ah,"\164i\155\145",this.xi(gi));pi(this.t,ah,"wa\u0069t",(ki!='\u0063\u0068\u0061\u0074'?this.xi(bi):'\u002d'));pi(this.t,ah,"e\u0074\u0063",ci);} return false;} ,yi:function(){function zi(t,id,$i){var vi=t.rows[id];var wi=t.rows[id+"e\156\u0064"];if(vi==null||wi==null)return;var _i=wi.cells["\u0073t\141\u0074u\163"];if(_i==null)return;_i.innerHTML=(vi.rowIndex+1==wi.rowIndex)?$i:"";_i.height=(vi.rowIndex+1==wi.rowIndex)?036:012;} zi(this.t,"\u0077\141\151t",this.dq.noclients);zi(this.t,"\u0070ri\u006f",this.dq.noclients);zi(this.t,"\143\u0068\u0061\164",this.dq.noclients);} ,xi:function(mj){var nj=Math.floor(((new Date()).getTime()-mj-this.ui)/0x3e8);var qj=Math.floor(nj/0x3c);var rj="";nj=nj%074;if(nj<(9+1))nj="0"+nj;if(qj>=(47+13)){var sj=Math.floor(qj/(42+18));qj=qj%0x3c;if(qj<(9+1))qj="0"+qj;rj=sj+":";} return rj+qj+"\u003a"+nj;} ,ct:function(tj){var uj=tj.documentElement;var hj=false;if(uj.tagName=='\164\u0068\u0072e\u0061\u0064s'){var ij=ms.is(uj,"ti\u006de");var jj=ms.is(uj,"\u0072\u0065vi\163\151o\156");if(ij)this.ui=(new Date()).getTime()-ij;if(jj)this.dq.ti=jj;for(var i=0;i';vh=os.insertRow(bh);cs=vh.insertCell(-1);cs.colSpan=015;cs.height=2;} ,wh:function(link,title,xh,yh,width,height){return''+yh+'<\u002f\u0061\u003e';} ,zh:function(content){return'<\u0074\u0072>'+content+'<\057\164\162>\u003c\u002ft\u0061\u0062\u006c\145>';} ,$h:function(_h,mi,id,ni,qi,ri,kt){var si=2;var link=mi+"\u003f\u0074\u0068\162e\u0061d\u003d"+id;var ti=(ri=="ful\u006c")?"\074i\u0020\u0073\164y\154\145='c\u006f\154o\162\u003a\043aa\141a\141a\u003b'\u003e"+_h+"\074/\151\076":((ri=="othe\162")?"\u003c\u0069\u003e"+_h+"<\057\151\u003e":_h);var ui='<\164\u0064\040cl\141\163\u0073="ta\142\154\145" st\171\154e\075"p\u0061\144\u0064\u0069ng\055le\u0066\u0074\u003a\u0030p\u0078\073\040pa\u0064d\u0069n\147\055\162i\147h\u0074\u003a\060p\u0078\u003b">';ui+=fh.wh(qi?link:link+"\u0026\u0076ie\167\u006fn\u006c\171\u003d\164r\u0075\u0065",localized[qi?0:1],"I\155\u0043ente\u0072"+id,ti,01130,0x1a4);ui+='\u003c\u002f\164d\076\074\164\144\u003e<\151\u006dg\u0020s\u0072\143\u003d"'+_s+'\u002f\u0069m\u0061g\u0065\u0073/\146\u0072\145e.g\u0069f" \167\u0069\u0064t\u0068="\065" \150e\u0069gh\u0074="\061"\040\142\157rd\u0065r\u003d"0" \u0061\154\164=""\076<\u002f\u0074d\u003e';if(qi){ui+='\074td\u0020wi\u0064t\u0068\075"\0630"\040\u0061\u006ci\u0067\156\u003d"\u0063e\u006e\u0074\u0065\u0072"\u003e';ui+=fh.wh(link,localized[0],"\u0049\155\u0043\u0065\156\164er"+id,'<\151\u006dg\u0020\163\u0072c\075"'+_s+'/\u0069\155\u0061\u0067\u0065\u0073\u002f\u0074\u0062l\151\143l\u0073\u0070\u0065a\153.g\u0069f" w\u0069\144\164\u0068="15" \150\u0065igh\164\075"\u0031\u0035"\u0020\u0062\157r\u0064\u0065r="\u0030" \u0061\154t="'+localized[0]+'">',(424+176),0x1a4);ui+='\u003c/\u0074d>';si++;} return fh.zh(ui);} } ;tq.hi=mn.nn();mn.sn(tq.hi,tq.oq,{qn:function(dq){this.pq(dq);this.dq.eh=this.eh.pn(this);this.dq.xt=this.xt.pn(this);this.dq.wt=this.wt.pn(this);this.dq.ii=0;this.ji=0;this.t=this.dq.ki;this.li=new tq.lh(this.dq);} ,eh:function(){return"\u0063\u006fmp\u0061\u006e\u0079\075"+this.dq.company+"\u0026\163i\u006ece="+this.dq.ii;} ,gu:function(zt){this.dq.status.innerHTML=zt;} ,xt:function(s){this.gu(s);} ,oi:function(du){var id,pi,di,ni=false,qi=false,ri=null;for(var i=0;i=zi.rowIndex)){fh.ah(this.t,vh.rowIndex+1);this.t.deleteRow(vh.rowIndex);vh=null;} if(vh==null){vh=this.t.insertRow(yi.rowIndex+1);fh.ch(this.t,yi.rowIndex+2);vh.id="\164hr"+id;js.insertCell(vh,"\156\u0061\155e","t\141\u0062\154\145",null,036,fh.$h(ai,this.dq.agentservl,id,ni,qi,ri,kt));fh.gh(vh);js.insertCell(vh,"con\164i\u0064","t\141b\154\145","c\145\156\u0074\145\162",null,bi);fh.gh(vh);js.insertCell(vh,"st\141\u0074\145","\u0074\141\142l\u0065","\143\145\156te\162",null,di);fh.gh(vh);js.insertCell(vh,"o\160","\164\141\142le","cen\164e\162",null,vi);fh.gh(vh);js.insertCell(vh,"\u0074\151\u006de","t\141\142l\u0065","c\145\u006e\u0074e\162",null,this.$i(ci));fh.gh(vh);js.insertCell(vh,"\u0077ai\u0074","\164\141\u0062\154e","\u0063en\u0074er",null,(pi!='\u0063h\141\u0074'?this.$i(wi):'-'));fh.gh(vh);js.insertCell(vh,"etc","t\141\142l\u0065","ce\156\164er",null,xi);if(pi=='wait'||pi=='\u0070r\u0069o')return true;} else{fi(this.t,vh,"\u006ea\155\145",fh.$h(ai,this.dq.agentservl,id,ni,qi,ri,kt));fi(this.t,vh,"\u0063o\u006e\u0074id",bi);fi(this.t,vh,"\u0073\u0074at\u0065",di);fi(this.t,vh,"\u006fp",vi);fi(this.t,vh,"\164\151me",this.$i(ci));fi(this.t,vh,"w\u0061\151t",(pi!='\143\u0068\141\u0074'?this.$i(wi):'-'));fi(this.t,vh,"etc",xi);} return false;} ,_i:function(){function mj(t,id,nj){var yi=t.rows[id];var zi=t.rows[id+"e\156\u0064"];if(yi==null||zi==null)return;var qj=zi.cells["\163t\141\u0074us"];if(qj==null)return;qj.innerHTML=(yi.rowIndex+1==zi.rowIndex)?nj:"";qj.height=(yi.rowIndex+1==zi.rowIndex)?036:(7+3);} mj(this.t,"\167\u0061\u0069t",this.dq.noclients);mj(this.t,"\160\u0072i\157",this.dq.noclients);mj(this.t,"c\150a\u0074",this.dq.noclients);} ,$i:function(rj){var sj=Math.floor(((new Date()).getTime()-rj-this.ji)/01750);var tj=Math.floor(sj/0x3c);var uj="";sj=sj%0x3c;if(sj<(7+3))sj="\060"+sj;if(tj>=0x3c){var hj=Math.floor(tj/(54+6));tj=tj%(56+4);if(tj<(9+1))tj="\u0030"+tj;uj=hj+":";} return uj+tj+"\u003a"+sj;} ,wt:function(ij){var jj=ij.documentElement;var kj=false;if(jj.tagName=='t\u0068\u0072\145ad\163'){var lj=ms.is(jj,"t\u0069me");var oj=ms.is(jj,"\162ev\151sio\u006e");if(lj)this.ji=(new Date()).getTime()-lj;if(oj)this.dq.ii=oj;for(var i=0;i"); + print(""); foreach( $output as $msg ) { print "".myiconv($webim_encoding,"utf-8",escape_with_cdata($msg))."\n"; }