
var escapeJSONChar=function()
{var escapeChars=["\b","\t","\n","\f","\r"];return function(c){if(c=="\""||c=="\\")
{return"\\"+c;}
if(c.charCodeAt(0)>=32)
{return c;}
for(var i=0;i<escapeChars.length;i++)
{if(c==escapeChars[i])
{return"\\"+c;}}
return c;};}();function escapeJSONString(s)
{return"\""+s.replace(/([^\u0020-\u007f]|[\\\"])/g,escapeJSONChar)+"\"";}
function toJSON(o)
{var marker="$_$jabsorbed$813492";var markerHead;var fixups=[];function removeMarkers()
{var next;while(markerHead)
{next=markerHead[marker].prev;delete markerHead[marker];markerHead=next;}}
var omitCircRefOrDuplicate={};var json;function subObjToJSON(o,p,ref)
{var v=[],fixup,original,parent,circRef,i;if(o===null||o===undefined)
{return"null";}
else if(typeof o==='string')
{return escapeJSONString(o);}
else if(typeof o==='number')
{return o.toString();}
else if(typeof o==='boolean')
{return o.toString();}
else
{if(o[marker])
{fixup=[ref];parent=p;while(parent)
{if(original)
{original.unshift(parent[marker].ref);}
if(parent===o)
{circRef=parent;original=[circRef[marker].ref];}
fixup.unshift(parent[marker].ref);parent=parent[marker].parent;}
if(circRef)
{if(JSONRpcClient.fixupCircRefs)
{fixup.shift();original.shift();fixups.push([fixup,original]);return omitCircRefOrDuplicate;}
else
{removeMarkers();throw new Error("circular reference detected!");}}
else
{if(JSONRpcClient.fixupDuplicates)
{original=[o[marker].ref];parent=o[marker].parent;while(parent)
{original.unshift(parent[marker].ref);parent=parent[marker].parent;}
fixup.shift();original.shift();fixups.push([fixup,original]);return omitCircRefOrDuplicate;}}}
else
{o[marker]={parent:p,prev:markerHead,ref:ref};markerHead=o;}
if(o.constructor===Date)
{return'{javaClass: "java.util.Date", time: '+o.valueOf()+'}';}
else if(o.constructor===Array)
{for(i=0;i<o.length;i++)
{json=subObjToJSON(o[i],o,i);v.push(json===omitCircRefOrDuplicate?null:json);}
return"["+v.join(", ")+"]";}
else
{for(var attr in o)
{if(attr===marker)
{}
else if(o[attr]===null||o[attr]===undefined)
{v.push("\""+attr+"\": null");}
else if(typeof o[attr]=="function")
{}
else
{json=subObjToJSON(o[attr],o,attr);if(json!==omitCircRefOrDuplicate)
{v.push(escapeJSONString(attr)+": "+json);}}}
return"{"+v.join(", ")+"}";}}}
json=subObjToJSON(o,null,"root");removeMarkers();if(fixups.length)
{return{json:json,fixups:fixups};}
else
{return{json:json};}}
function JSONRpcClient()
{var arg_shift=0,req,_function,methods,self,name,arg0type=(typeof arguments[0]),doListMethods=true;if(arg0type==="function")
{this.readyCB=arguments[0];arg_shift++;}
else if(arguments[0]&&arg0type==="object"&&arguments[0].length)
{this._addMethods(arguments[0]);arg_shift++;doListMethods=false;}
this.serverURL=arguments[arg_shift];if(parent.displayedInIFrame)
{if(!this.serverURL||this.serverURL==null||this.serverURL==='')
{this.serverURL=ctx+"/JSON-RPC";}
this.user=parent.user;this.pass=parent.pass;}
else
{this.user=arguments[arg_shift+1];this.pass=arguments[arg_shift+2];}
this.objectID=0;if(doListMethods)
{this._addMethods(["system.listMethods"]);req=JSONRpcClient._makeRequest(this,"system.listMethods",[]);if(this.readyCB)
{self=this;req.cb=function(result,e)
{if(!e)
{self._addMethods(result);}
self.readyCB(result,e);};}
if(!this.readyCB)
{methods=JSONRpcClient._sendRequest(this,req);this._addMethods(methods);}
else
{JSONRpcClient.async_requests.push(req);JSONRpcClient.kick_async();}}}
JSONRpcClient.prototype.createCallableProxy=function(objectID,javaClass)
{var cp,req,methodNames,name,i;cp=new JSONRPCCallableProxy(objectID,javaClass);for(name in JSONRpcClient.knownClasses[javaClass])
{cp[name]=JSONRpcClient.bind(JSONRpcClient.knownClasses[javaClass][name],cp);}
return cp;};function JSONRPCCallableProxy()
{this.objectID=arguments[0];this.javaClass=arguments[1];this.JSONRPCType="CallableReference";}
JSONRpcClient.knownClasses={};JSONRpcClient.Exception=function(errorObject)
{var m;for(var prop in errorObject)
{if(errorObject.hasOwnProperty(prop))
{this[prop]=errorObject[prop];}}
if(this.trace)
{m=this.trace.match(/^([^:]*)/);if(m)
{this.name=m[0];}}
if(!this.name)
{this.name="JSONRpcClientException";}};JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION=490;JSONRpcClient.Exception.CODE_ERR_CLIENT=550;JSONRpcClient.Exception.CODE_ERR_PARSE=590;JSONRpcClient.Exception.CODE_ERR_NOMETHOD=591;JSONRpcClient.Exception.CODE_ERR_UNMARSHALL=592;JSONRpcClient.Exception.CODE_ERR_MARSHALL=593;JSONRpcClient.Exception.prototype=new Error();JSONRpcClient.Exception.prototype.toString=function(code,msg)
{var str="";if(this.name)
{str+=this.name;}
if(this.message)
{str+=": "+this.message;}
if(str.length==0)
{str="no exception information given";}
return str;};JSONRpcClient.default_ex_handler=function(e)
{var a,str="";for(a in e)
{str+=a+"\t"+e[a]+"\n";}
alert(str);};JSONRpcClient.toplevel_ex_handler=JSONRpcClient.default_ex_handler;JSONRpcClient.profile_async=false;JSONRpcClient.max_req_active=4;JSONRpcClient.requestId=1;JSONRpcClient.fixupCircRefs=true;JSONRpcClient.fixupDuplicates=true;JSONRpcClient.transformDates=false;JSONRpcClient.bind=function(functionName,context)
{return function(){return functionName.apply(context,arguments);};};JSONRpcClient._createMethod=function(client,methodName)
{var serverMethodCaller=function()
{var args=[],callback;for(var i=0;i<arguments.length;i++)
{args.push(arguments[i]);}
if(typeof args[0]=="function")
{callback=args.shift();}
var req=JSONRpcClient._makeRequest(this,methodName,args,this.objectID,callback);if(!callback)
{return JSONRpcClient._sendRequest(client,req);}
else
{JSONRpcClient.async_requests.push(req);JSONRpcClient.kick_async();return req.requestId;}};return serverMethodCaller;};JSONRpcClient.prototype.createObject=function()
{var args=[],callback=null,constructorName,_args,req;for(var i=0;i<arguments.length;i++)
{args.push(arguments[i]);}
if(typeof args[0]=="function")
{callback=args.shift();}
constructorName=args[0]+".$constructor";_args=args[1];req=JSONRpcClient._makeRequest(this,constructorName,_args,0,callback);if(callback===null)
{return JSONRpcClient._sendRequest(this,req);}
else
{JSONRpcClient.async_requests.push(req);JSONRpcClient.kick_async();return req.requestId;}};JSONRpcClient.CALLABLE_REFERENCE_METHOD_PREFIX=".ref";JSONRpcClient.prototype._addMethods=function(methodNames,dontAdd)
{var name,obj,names,n,method,methods=[],javaClass,tmpNames,startIndex,endIndex;if(!parent.displayedInIFrame)
{top.jsonRpcFuncs=methodNames;}
for(var i=0;i<methodNames.length;i++)
{obj=this;names=methodNames[i].split(".");startIndex=methodNames[i].indexOf("[");endIndex=methodNames[i].indexOf("]");if((methodNames[i].substring(0,JSONRpcClient.CALLABLE_REFERENCE_METHOD_PREFIX.length)==JSONRpcClient.CALLABLE_REFERENCE_METHOD_PREFIX)&&(startIndex!=-1)&&(endIndex!=-1)&&(startIndex<endIndex))
{javaClass=methodNames[i].substring(startIndex+1,endIndex);}
else
{for(n=0;n<names.length-1;n++)
{name=names[n];if(obj[name])
{obj=obj[name];}
else
{obj[name]={};obj=obj[name];}}}
name=names[names.length-1];if(javaClass)
{method=JSONRpcClient._createMethod(this,name);if(!JSONRpcClient.knownClasses[javaClass])
{JSONRpcClient.knownClasses[javaClass]={};}
JSONRpcClient.knownClasses[javaClass][name]=method;}
else
{method=JSONRpcClient._createMethod(this,methodNames[i]);if((!obj[name])&&(!dontAdd))
{obj[name]=JSONRpcClient.bind(method,this);}
methods.push(method);}
javaClass=null;}
return methods;};JSONRpcClient._getCharsetFromHeaders=function(http)
{var contentType,parts,i;try
{contentType=http.getResponseHeader("Content-type");parts=contentType.split(/\s*;\s*/);for(i=0;i<parts.length;i++)
{if(parts[i].substring(0,8)=="charset=")
{return parts[i].substring(8,parts[i].length);}}}
catch(e)
{}
return"UTF-8";};JSONRpcClient.async_requests=[];JSONRpcClient.async_inflight={};JSONRpcClient.async_responses=[];JSONRpcClient.async_timeout=null;JSONRpcClient.num_req_active=0;JSONRpcClient._async_handler=function()
{var res,req;JSONRpcClient.async_timeout=null;while(JSONRpcClient.async_responses.length>0)
{res=JSONRpcClient.async_responses.shift();if(res.canceled)
{continue;}
if(res.profile)
{res.profile.dispatch=new Date();}
try
{res.cb(res.result,res.ex,res.profile);}
catch(e)
{JSONRpcClient.toplevel_ex_handler(e);}}
while(JSONRpcClient.async_requests.length>0&&JSONRpcClient.num_req_active<JSONRpcClient.max_req_active)
{req=JSONRpcClient.async_requests.shift();if(req.canceled)
{continue;}
JSONRpcClient._sendRequest(req.client,req);}};JSONRpcClient.kick_async=function()
{if(!JSONRpcClient.async_timeout)
{JSONRpcClient.async_timeout=setTimeout(JSONRpcClient._async_handler,0);}};JSONRpcClient.cancelRequest=function(requestId)
{if(JSONRpcClient.async_inflight[requestId])
{JSONRpcClient.async_inflight[requestId].canceled=true;return true;}
var i;for(i in JSONRpcClient.async_requests)
{if(JSONRpcClient.async_requests[i].requestId==requestId)
{JSONRpcClient.async_requests[i].canceled=true;return true;}}
for(i in JSONRpcClient.async_responses)
{if(JSONRpcClient.async_responses[i].requestId==requestId)
{JSONRpcClient.async_responses[i].canceled=true;return true;}}
return false;};JSONRpcClient._makeRequest=function(client,methodName,args,objectID,cb)
{var req={};req.client=client;req.requestId=JSONRpcClient.requestId++;var obj="{id:"+req.requestId+",method:";if((objectID)&&(objectID>0))
{obj+="\".obj["+objectID+"]."+methodName+"\"";}
else
{obj+="\""+methodName+"\"";}
if(cb)
{req.cb=cb;}
if(JSONRpcClient.profile_async)
{req.profile={submit:new Date()};}
var j=toJSON(args);obj+=",params:"+j.json;if(j.fixups)
{obj+=",fixups:"+toJSON(j.fixups).json;}
req.data=obj+"}";return req;};JSONRpcClient._sendRequest=function(client,req)
{var http;if(req.profile)
{req.profile.start=new Date();}
http=JSONRpcClient.poolGetHTTPRequest();JSONRpcClient.num_req_active++;http.open("POST",client.serverURL,!!req.cb,client.user,client.pass);try
{http.setRequestHeader("Content-type","text/plain");}
catch(e)
{}
if(req.cb)
{http.onreadystatechange=function()
{var res;if(http.readyState==4)
{http.onreadystatechange=function()
{};res={cb:req.cb,result:null,ex:null};if(req.profile)
{res.profile=req.profile;res.profile.end=new Date();}
else
{res.profile=false;}
try
{res.result=client._handleResponse(http);}
catch(e)
{res.ex=e;}
if(!JSONRpcClient.async_inflight[req.requestId].canceled)
{JSONRpcClient.async_responses.push(res);}
delete JSONRpcClient.async_inflight[req.requestId];JSONRpcClient.kick_async();}};}
else
{http.onreadystatechange=function()
{};}
JSONRpcClient.async_inflight[req.requestId]=req;try
{http.send(req.data);}
catch(e)
{JSONRpcClient.poolReturnHTTPRequest(http);JSONRpcClient.num_req_active--;throw new JSONRpcClient.Exception({code:JSONRpcClient.Exception.CODE_ERR_CLIENT,message:"Connection failed"});}
if(!req.cb)
{delete JSONRpcClient.async_inflight[req.requestId];return client._handleResponse(http);}
return null;};JSONRpcClient.prototype._handleResponse=function(http)
{if(!this.charset)
{this.charset=JSONRpcClient._getCharsetFromHeaders(http);}
var status,statusText,data;try
{status=http.status;statusText=http.statusText;data=http.responseText;}
catch(e)
{JSONRpcClient.poolReturnHTTPRequest(http);JSONRpcClient.num_req_active--;JSONRpcClient.kick_async();throw new JSONRpcClient.Exception({code:JSONRpcClient.Exception.CODE_ERR_CLIENT,message:"Connection failed"});}
JSONRpcClient.poolReturnHTTPRequest(http);JSONRpcClient.num_req_active--;if(status!=200)
{throw new JSONRpcClient.Exception({code:status,message:statusText});};return this.unmarshallResponse(data);};JSONRpcClient.prototype.unmarshallResponse=function(data)
{function applyFixups(obj,fixups)
{function findOriginal(ob,original)
{for(var i=0,j=original.length;i<j;i++)
{ob=ob[original[i]];}
return ob;}
function applyFixup(ob,fixups,value)
{var j=fixups.length-1;for(var i=0;i<j;i++)
{ob=ob[fixups[i]];}
ob[fixups[j]]=value;}
for(var i=0,j=fixups.length;i<j;i++)
{applyFixup(obj,fixups[i][0],findOriginal(obj,fixups[i][1]));}}
function transform_date(obj)
{var hint,foo,num,i,jsDate
if(obj&&typeof obj==='object')
{hint=obj.hasOwnProperty('javaClass');foo=hint?obj.javaClass==='java.util.Date':obj.hasOwnProperty('time');num=0;if(!hint&&foo)
{for(i in obj)
{if(obj.hasOwnProperty(i))
{num++;}}}
if(hint&&foo||foo&&num===1)
{jsDate=new Date(obj.time);return jsDate;}
else
{for(i in obj)
{if(obj.hasOwnProperty(i))
{obj[i]=transform_date(obj[i]);}}
return obj;}}
else
{return obj;}}
var obj;try
{eval("obj = "+data);}
catch(e)
{throw new JSONRpcClient.Exception({code:550,message:"error parsing result"});}
if(obj.error)
{throw new JSONRpcClient.Exception(obj.error);}
var r=obj.result;var i,tmp;if(r)
{if(r.objectID&&r.JSONRPCType=="CallableReference")
{return this.createCallableProxy(r.objectID,r.javaClass);}
else
{r=JSONRpcClient.extractCallableReferences(this,JSONRpcClient.transformDates?transform_date(r):r);if(obj.fixups)
{applyFixups(r,obj.fixups);}}}
return r;};JSONRpcClient.extractCallableReferences=function(client,root)
{var i,tmp,value;for(i in root)
{if(typeof(root[i])=="object")
{tmp=JSONRpcClient.makeCallableReference(client,root[i]);if(tmp)
{root[i]=tmp;}
else
{tmp=JSONRpcClient.extractCallableReferences(client,root[i]);root[i]=tmp;}}
if(typeof(i)=="object")
{tmp=JSONRpcClient.makeCallableReference(client,i);if(tmp)
{value=root[i];delete root[i];root[tmp]=value;}
else
{tmp=JSONRpcClient.extractCallableReferences(client,i);value=root[i];delete root[i];root[tmp]=value;}}}
return root;};JSONRpcClient.makeCallableReference=function(client,value)
{if(value&&value.objectID&&value.javaClass&&value.JSONRPCType=="CallableReference")
{return client.createCallableProxy(value.objectID,value.javaClass);}
return null;};JSONRpcClient.http_spare=[];JSONRpcClient.http_max_spare=8;JSONRpcClient.poolGetHTTPRequest=function()
{var http=JSONRpcClient.http_spare.pop();if(http)
{return http;}
return JSONRpcClient.getHTTPRequest();};JSONRpcClient.poolReturnHTTPRequest=function(http)
{if(JSONRpcClient.http_spare.length>=JSONRpcClient.http_max_spare)
{delete http;}
else
{JSONRpcClient.http_spare.push(http);}};JSONRpcClient.msxmlNames=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","Microsoft.XMLHTTP"];JSONRpcClient.getHTTPRequest=function()
{try
{JSONRpcClient.httpObjectName="XMLHttpRequest";return new XMLHttpRequest();}
catch(e)
{}
for(var i=0;i<JSONRpcClient.msxmlNames.length;i++)
{try
{JSONRpcClient.httpObjectName=JSONRpcClient.msxmlNames[i];return new ActiveXObject(JSONRpcClient.msxmlNames[i]);}
catch(e)
{}}
JSONRpcClient.httpObjectName=null;throw new JSONRpcClient.Exception({code:0,message:"Can't create XMLHttpRequest object"});};jsonUtil={};(function(){var indent=function(z){var h='';if(z!==null&&typeof z==='number'){while(z--){h+=' ';}}
return h;};var inc=function(z,i){if(!z||typeof z!=='number'){z=0;}
if(i!==null&&typeof i==='number'){return z+i;}else{return z+2;}};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},s={array:function(x){var a=['['],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a[a.length]=v;b=true;}}}
a[a.length]=']';return a.join('');},prettyarray:function(x,z,y){var a=['\n',indent(z),'['],b,f,i,l=x.length,v,c;for(i=0;i<l;i++){v=x[i];c=(typeof v=='array'||typeof v=='object');f=s[(c?'pretty':'')+typeof v];if(f){v=f(v,inc(z,y),y);if(typeof v=='string'){if(b){a[a.length]=',';}
a.push(c?'':'\n',indent(inc(z,y)),v);b=true;}}}
a.push('\n',indent(z),']');return a.join('');},'boolean':function(x){return String(x);},'null':function(x){return"null";},number:function(x){return isFinite(x)?String(x):'null';},object:function(x){if(x){if(x instanceof Array){return s.array(x);}
var a=['{'],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
a.push(s.string(i),':',v);b=true;}}}
a[a.length]='}';return a.join('');}
return'null';},prettyobject:function(x,z,y){if(x){if(x instanceof Array){return s.prettyarray(x,z,y);}
var a=['\n',indent(z),'{'],b,f,i,v,c;for(i in x){v=x[i];c=(typeof v=='array'||typeof v=='object');f=s[(c?'pretty':'')+typeof v];if(f){v=f(v,inc(z,y),y);if(typeof v=='string'){if(b){a[a.length]=',';}
a.push('\n',indent(inc(z,y)),s.string(i),' : ',v);b=true;}}}
a.push('\n',indent(z),'}');return a.join('');}
return'null';},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
c=b.charCodeAt();return'\\u00'+
Math.floor(c/16).toString(16)+
(c%16).toString(16);});}
return'"'+x+'"';}};jsonUtil.ObjectToJSONString=function(o){return s.object(o);};jsonUtil.ArraytoJSONString=function(a){return s.array(a);};jsonUtil.ObjectToPrettyJSONString=function(o,z,y){return s.prettyobject(o,z,y);};jsonUtil.ArrayToPrettyJSONString=function(a,z,y){return s.prettyarray(a,z,y);};})();jsonUtil.parseJSON=function(){try{return!(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,'')))&&eval('('+this+')');}catch(e){return false;}};var allowJsonRpcExceptionAlert=true;function handleExceptionGenerically(e){function strStartsWith(s,a)
{if(s===null||s===undefined||a===null||a===undefined)
{return false;}
else
{if(!s.slice)
{s=String(s);}
return a===s||a===s.slice(0,a.length);}}
function prettyJavaStackTrace(e)
{var n,a=e.javaStack.split('\r\n\t',10);for(var i=1,j=a.length;i<j;i++)
{n='\n   '+a[i];a[i]='';while(n.length>80)
{a[i]+=n.substring(0,80);n=n.substring(80);if(n.length>0)
{a[i]+='\n';}}
if(n.length>0)
{a[i]+=n;}}
return a.join();}
function prettyClientExceptionDump(e)
{var a,str="";for(a in e)
{str+=a+"\t"+e[a]+"\n";}
return str;}
var msg;var ext=!!(window.Ext&&window.Ext.Msg);if(!e)
{return false;}
else if(e.name&&e.name=="JSONRpcClientException")
{msg=$$('POINT_LOG_RESOURCES.exception.JSONRpcClientException')+
(ext?'<br>':'\n')+e.message;}
else if(strStartsWith(e.name,"com.cpcus.jaru.ui.jsonrpc.InsufficientPrivilegesException"))
{msg=$$('POINT_LOG_RESOURCES.exception.InsufficientPrivileges');}
else if(e.message)
{msg=e.message;}
else if(e.msg)
{msg=e.msg;}
else if(e.javaStack)
{if(ext)
{msg='<pre>'+prettyJavaStackTrace(e)+'</pre>';}
else
{msg=prettyJavaStackTrace(e);}}
else
{if(ext)
{msg='<pre>'+prettyClientExceptionDump(e)+'</pre>';}
else
{msg=prettyClientExceptionDump(e);}}
if(allowJsonRpcExceptionAlert)
{if(ext)
{Ext.Msg.alert($$('POINT_LOG_RESOURCES.exception.header'),msg);}
else
{alert(msg);}}
return true;}
var jsonrpc;if(parent.displayedInIFrame)
{try{if(parent.jsonRpcFuncs)
{jsonrpc=new JSONRpcClient(parent.jsonRpcFuncs,ctx+"/JSON-RPC");}
else
{jsonrpc=new JSONRpcClient(ctx+"/JSON-RPC");}}catch(e){handleExceptionGenerically(e);}}
else
{try{if(top.jsonRpcFuncs)
{jsonrpc=new JSONRpcClient(top.jsonRpcFuncs,ctx+"/JSON-RPC");}
else
{jsonrpc=new JSONRpcClient(ctx+"/JSON-RPC");}}catch(e){handleExceptionGenerically(e);}}
var __dbgQueue=[];var __dbgTimer=null;function debug()
{var s=[];for(var i=0,j=arguments.length;i<j;i++)
{if(i>0)
{s.push(", ");}
if(arguments[i]===null)
{s.push('null');}
else if(arguments[i]===undefined)
{s.push('undefined');}
else if(typeof arguments[i]==='object')
{if(arguments[i].constructor===Array)
{s.push(jsonUtil.ArrayToPrettyJSONString(arguments[i]));}
else
{s.push(jsonUtil.ObjectToPrettyJSONString(arguments[i]));}}
else
{s.push(String(arguments[i]));}}
__dbgQueue.push({msg:s.join(''),tstamp:new Date(),javaClass:'com.cpcus.jaru.domainobjects.jsonrpc.BrowserLogMessage'});if(__dbgQueue.length===1)
{__dbgTimer=setTimeout(__sendDbgMessages,150);}}
function __sendDbgMessages()
{jsonrpc.log.debugMulti(__debugCb,__dbgQueue);__dbgQueue=[];}
function __debugCb(){}
function message(s){alert("ERROR\n"+s);}