JENERIC_BUILD=54;
var console,_RETURN_AS_JSON=2,_RETURN_AS_TEXT=1,_RETURN_AS_DOM=0,_POST=0,_GET=1,_CACHE=0,_NO_CACHE=1;
function DataRequestor(){var a=this;this.getXMLHTTP=function(){var c=null;try{c=new XMLHttpRequest}catch(b){try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){for(var d=false,g=Array("Microsoft.XMLHTTP","MSXML2.XMLHTTP","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0"),k=0;k<g.length&&!d;k++)try{c=new ActiveXObject(g[k]);d=true}catch(h){c=null}}}a._XML_REQ=c;return a._XML_REQ};this.getURL=function(c,b){if(a.onLoad)a.onload=a.onLoad;if(a.onReplace)a.onreplace=a.onReplace;if(a.onProgress)a.onprogress=
a.onProgress;if(a.onFail)a.onfail=a.onFail;a.userModifiedData="";switch(b){case _RETURN_AS_DOM:case _RETURN_AS_TEXT:case _RETURN_AS_JSON:a.returnType=b;break;default:a.returnType=_RETURN_AS_TEXT}typeof a._XML_REQ.abort!="undefined"&&a._XML_REQ.readyState!=0&&a._XML_REQ.abort();a._XML_REQ.onreadystatechange=a.callback;var f="GET",d=c.indexOf("?")!=-1?"&":"?";for(i=0;i<a.argArray[_GET].length;i++)d+=a.argArray[_GET][i][0]+"="+a.argArray[_GET][i][1]+"&";var g="";for(i=0;i<a.argArray[_POST].length;i++)g+=
a.argArray[_POST][i][0]+"="+a.argArray[_POST][i][1]+"&";if(g!="")f="POST";try{a._XML_REQ.open(f,c+d,true);if(typeof a._XML_REQ.setRequestHeader!="undefined"){a.returnType==_RETURN_AS_DOM&&typeof a._XML_REQ.overrideMimeType=="function"&&a._XML_REQ.overrideMimeType("text/xml");a._XML_REQ.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}a._XML_REQ.send(g)}catch(k){a.error=k}if(a.error)if(a.onfail)a.onfail(-1,a.error);else throw Error("DataRequester encountered an unexpected exception: '"+
a.error+"'");return true};this.callback=function(){var c=0,b=0;try{c=a._XML_REQ.readyState}catch(f){c=0}try{b=a._XML_REQ.status}catch(d){b=-1}if(c==4&&b==200||c==4&&b==0){c=a.getObjToReplace();if(a.onload)switch(a.returnType){case _RETURN_AS_TEXT:a.onload(a._XML_REQ.responseText,c);break;case _RETURN_AS_DOM:a.onload(a.normalizeWhitespace(a._XML_REQ.responseXML),c);break;case _RETURN_AS_JSON:a.onload(eval("("+a._XML_REQ.responseText+")"),c);break}if(c){if(c.nodeName=="TEXTAREA"||c.nodeName=="INPUT"){a.objOldContent=
c.value;c.value=a.userModifiedData?a.userModifiedData:a._XML_REQ.responseText;a.objNewContent=c.value}else{a.objOldContent=c.innerHTML;c.innerHTML=a.userModifiedData?a.userModifiedData:a._XML_REQ.responseText;a.objNewContent=c.innerHTML}a.onreplace&&a.onreplace(c,a.objOldContent,a.objNewContent)}}else if(c==3){if(a.onprogress&&!document.all){c=0;try{c=a._XML_REQ.getResponseHeader("Content-Length")}catch(g){c=-1}a.onprogress(a._XML_REQ.responseText.length,c)}}else if(c==4)if(a.onfail)a.onfail(b,a.error);
else throw Error("DataRequester encountered an unexpected exception: '"+a.error+"'.\nThe status code is: "+b);};this.normalizeWhitespace=function(c){if(document.createTreeWalker)for(var b=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:function(f){if(/\S/.test(f.nodeValue))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT}},true);b.nextNode();){b.currentNode.parentNode.removeChild(b.currentNode);b.currentNode=c}return c};this.commitData=function(c){a.userModifiedData=c};this.setObjToReplace=
function(c){if(typeof c=="object")a.objToReplace=c;else if(typeof c=="string")a.objToReplaceID=c};this.getObjToReplace=function(){if(a.objToReplaceID!=""){a.objToReplace=document.getElementById(a.objToReplaceID);a.objToReplaceID=""}return a.objToReplace};this.addArg=function(c,b,f){a.argArray[c].push([b,escape(f)])};this.clearArgs=function(){a.argArray[_POST]=[];a.argArray[_GET]=[]};this.addArgsFromForm=function(c){c=document.getElementById(c);for(var b=c.getAttribute("method").toLowerCase()=="post"?
_POST:_GET,f=0;f<c.elements.length;f++){theNode=c.elements[f];switch(theNode.nodeName.toLowerCase()){case "input":case "select":case "textarea":this.addArg(b,theNode.id,theNode.value);break}}};this.clear=function(){a.returnType=_RETURN_AS_TEXT;a.argArray=[];a.objToReplace=null;a.objToReplaceID="";a.onload=null;a.onfail=null;a.onprogress=null;a.cache=[];this.clearArgs()};if(!this.getXMLHTTP())throw Error("Could not load XMLHttpRequest object");this.clear()}if(!this.JSON)this.JSON={};
(function(){function a(s){return s<10?"0"+s:s}function c(s){d.lastIndex=0;return d.test(s)?'"'+s.replace(d,function(o){var p=h[o];return typeof p==="string"?p:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'}function b(s,o){var p,n,r,w,u=g,y,x=o[s];if(x&&typeof x==="object"&&typeof x.toJSON==="function")x=x.toJSON(s);if(typeof l==="function")x=l.call(o,s,x);switch(typeof x){case "string":return c(x);case "number":return isFinite(x)?String(x):"null";case "boolean":case "null":return String(x);
case "object":if(!x)return"null";g+=k;y=[];if(Object.prototype.toString.apply(x)==="[object Array]"){w=x.length;for(p=0;p<w;p+=1)y[p]=b(p,x)||"null";r=y.length===0?"[]":g?"[\n"+g+y.join(",\n"+g)+"\n"+u+"]":"["+y.join(",")+"]";g=u;return r}if(l&&typeof l==="object"){w=l.length;for(p=0;p<w;p+=1){n=l[p];if(typeof n==="string")if(r=b(n,x))y.push(c(n)+(g?": ":":")+r)}}else for(n in x)if(Object.hasOwnProperty.call(x,n))if(r=b(n,x))y.push(c(n)+(g?": ":":")+r);r=y.length===0?"{}":g?"{\n"+g+y.join(",\n"+g)+
"\n"+u+"}":"{"+y.join(",")+"}";g=u;return r}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,k,h={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l;if(typeof JSON.stringify==="function")JSON.native_stringify=JSON.stringify;Function.prototype.test1=function(){};Array.prototype.test2=function(){};try{JSON.parse('{ "foo": [1,2,3] }',function(s,o){return o});var m=false}catch(q){m=true}delete Function.prototype.test1;delete Array.prototype.test2;
if(typeof JSON.stringify!=="function"||navigator.product=="Gecko")JSON.stringify=function(s,o,p){var n;k=g="";if(typeof p==="number")for(n=0;n<p;n+=1)k+=" ";else if(typeof p==="string")k=p;if((l=o)&&typeof o!=="function"&&(typeof o!=="object"||typeof o.length!=="number"))throw Error("JSON.stringify");return b("",{"":s})};if(typeof JSON.parse!=="function"||m)JSON.parse=function(s,o){function p(r,w){var u,y,x=r[w];if(x&&typeof x==="object")for(u in x)if(Object.hasOwnProperty.call(x,u)){y=p(x,u);if(y!==
undefined)x[u]=y;else delete x[u]}return o.call(r,w,x)}var n;f.lastIndex=0;if(f.test(s))s=s.replace(f,function(r){return"\\u"+("0000"+r.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(s.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){n=eval("("+s+")");return typeof o==="function"?p({"":n},""):n}throw new SyntaxError("JSON.parse");}})();
window.Range||function(){function a(l){this._document=l;this.startContainer=this.endContainer=l.body;this.endOffset=f.getNodeLength(l.body)}function c(l){this.range=l;if(!l.collapsed){var m=l.commonAncestorContainer;this._next=l.startContainer==m&&!f.isDataNode(l.startContainer)?l.startContainer.childNodes[l.startOffset]:f.findClosestAncestor(m,l.startContainer);this._end=l.endContainer==m&&!f.isDataNode(l.endContainer)?l.endContainer.childNodes[l.endOffset]:f.findClosestAncestor(m,l.endContainer).nextSibling}}
function b(l){this._document=l;var m=this;l.attachEvent("onselectionchange",function(){m._selectionChangeHandler()})}var f={findChildPosition:function(l){for(var m=0;l=l.previousSibling;m++);return m},isDataNode:function(l){return l&&l.nodeValue!==null&&l.data!==null},isAncestorOf:function(l,m){return!f.isDataNode(l)&&(l.contains(f.isDataNode(m)?m.parentNode:m)||m.parentNode==l)},isAncestorOrSelf:function(l,m){return f.isAncestorOf(l,m)||l==m},findClosestAncestor:function(l,m){if(f.isAncestorOf(l,
m))for(;m&&m.parentNode!=l;)m=m.parentNode;return m},getNodeLength:function(l){return f.isDataNode(l)?l.length:l.childNodes.length},splitDataNode:function(l,m){if(!f.isDataNode(l))return false;var q=l.cloneNode(false);l.deleteData(m,l.length);q.deleteData(0,m);l.parentNode.insertBefore(q,l.nextSibling)}},d={convertToDOMRange:function(l,m){function q(o,p,n){var r=m.createElement("a"),w=p.duplicate();w.collapse(n);var u=w.parentElement();do{u.insertBefore(r,r.previousSibling);w.moveToElementText(r)}while(w.compareEndPoints(n?
"StartToStart":"StartToEnd",p)>0&&r.previousSibling);if(w.compareEndPoints(n?"StartToStart":"StartToEnd",p)==-1&&r.nextSibling){w.setEndPoint(n?"EndToStart":"EndToEnd",p);o[n?"setStart":"setEnd"](r.nextSibling,w.text.length)}else o[n?"setStartBefore":"setEndBefore"](r);r.parentNode.removeChild(r)}var s=new a(m);q(s,l,true);q(s,l,false);return s},convertFromDOMRange:function(l){function m(s,o,p){var n=o[p?"startContainer":"endContainer"],r=o[p?"startOffset":"endOffset"],w=0,u=f.isDataNode(n)?n:n.childNodes[r],
y=f.isDataNode(n)?n.parentNode:n;if(n.nodeType==3||n.nodeType==4)w=r;n=o._document.createElement("a");y.insertBefore(n,u);o=o._document.body.createTextRange();o.moveToElementText(n);n.parentNode.removeChild(n);s.setEndPoint(p?"StartToStart":"EndToStart",o);s[p?"moveStart":"moveEnd"]("character",w)}var q=l._document.body.createTextRange();m(q,l,true);m(q,l,false);return q}};a.START_TO_START=0;a.START_TO_END=1;a.END_TO_END=2;a.END_TO_START=3;a.prototype={startContainer:null,startOffset:0,endContainer:null,
endOffset:0,commonAncestorContainer:null,collapsed:false,_document:null,_refreshProperties:function(){this.collapsed=this.startContainer==this.endContainer&&this.startOffset==this.endOffset;for(var l=this.startContainer;l&&l!=this.endContainer&&!f.isAncestorOf(l,this.endContainer);)l=l.parentNode;this.commonAncestorContainer=l},setStart:function(l,m){this.startContainer=l;this.startOffset=m;this._refreshProperties()},setEnd:function(l,m){this.endContainer=l;this.endOffset=m;this._refreshProperties()},
setStartBefore:function(l){this.setStart(l.parentNode,f.findChildPosition(l))},setStartAfter:function(l){this.setStart(l.parentNode,f.findChildPosition(l)+1)},setEndBefore:function(l){this.setEnd(l.parentNode,f.findChildPosition(l))},setEndAfter:function(l){this.setEnd(l.parentNode,f.findChildPosition(l)+1)},selectNode:function(l){this.setStartBefore(l);this.setEndAfter(l)},selectNodeContents:function(l){this.setStart(l,0);this.setEnd(l,f.getNodeLength(l))},collapse:function(l){l?this.setEnd(this.startContainer,
this.startOffset):this.setStart(this.endContainer,this.endOffset)},cloneContents:function(){return function l(m){for(var q,s=document.createDocumentFragment();q=m.next();){q=q.cloneNode(!m.hasPartialSubtree());m.hasPartialSubtree()&&q.appendChild(l(m.getSubtreeIterator()));s.appendChild(q)}return s}(new c(this))},extractContents:function(){var l=this.cloneRange();this.startContainer!=this.commonAncestorContainer&&this.setStartAfter(f.findClosestAncestor(this.commonAncestorContainer,this.startContainer));
this.collapse(true);return function m(q){for(var s,o=document.createDocumentFragment();s=q.next();){q.hasPartialSubtree()?s=s.cloneNode(false):q.remove();q.hasPartialSubtree()&&s.appendChild(m(q.getSubtreeIterator()));o.appendChild(s)}return o}(new c(l))},deleteContents:function(){var l=this.cloneRange();this.startContainer!=this.commonAncestorContainer&&this.setStartAfter(f.findClosestAncestor(this.commonAncestorContainer,this.startContainer));this.collapse(true);(function m(q){for(;q.next();)q.hasPartialSubtree()?
m(q.getSubtreeIterator()):q.remove()})(new c(l))},insertNode:function(l){if(f.isDataNode(this.startContainer)){f.splitDataNode(this.startContainer,this.startOffset);this.startContainer.parentNode.insertBefore(l,this.startContainer.nextSibling)}else this.startContainer.insertBefore(l,this.startContainer.childNodes[this.startOffset]);this.setStart(this.startContainer,this.startOffset)},surroundContents:function(l){var m=this.extractContents();this.insertNode(l);l.appendChild(m);this.selectNode(l)},
compareBoundaryPoints:function(l,m){var q,s,o,p;switch(l){case a.START_TO_START:case a.START_TO_END:q=this.startContainer;s=this.startOffset;break;case a.END_TO_END:case a.END_TO_START:q=this.endContainer;s=this.endOffset;break}switch(l){case a.START_TO_START:case a.END_TO_START:o=m.startContainer;p=m.startOffset;break;case a.START_TO_END:case a.END_TO_END:o=m.endContainer;p=m.endOffset;break}return q.sourceIndex<o.sourceIndex?-1:q.sourceIndex==o.sourceIndex?s<p?-1:s==p?0:1:1},cloneRange:function(){var l=
new a(this._document);l.setStart(this.startContainer,this.startOffset);l.setEnd(this.endContainer,this.endOffset);return l},detach:function(){},toString:function(){return d.convertFromDOMRange(this).text},createContextualFragment:function(l){var m=(f.isDataNode(this.startContainer)?this.startContainer.parentNode:this.startContainer).cloneNode(false);m.innerHTML=l;for(l=this._document.createDocumentFragment();m.firstChild;)l.appendChild(m.firstChild);return l}};c.prototype={range:null,_current:null,
_next:null,_end:null,hasNext:function(){return!!this._next},next:function(){var l=this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;if(f.isDataNode(this._current)){if(this.range.endContainer==this._current)(l=l.cloneNode(true)).deleteData(this.range.endOffset,l.length-this.range.endOffset);if(this.range.startContainer==this._current)(l=l.cloneNode(true)).deleteData(0,this.range.startOffset)}return l},remove:function(){if(f.isDataNode(this._current)&&
(this.range.startContainer==this._current||this.range.endContainer==this._current)){var l=this.range.startContainer==this._current?this.range.startOffset:0;this._current.deleteData(l,(this.range.endContainer==this._current?this.range.endOffset:this._current.length)-l)}else this._current.parentNode.removeChild(this._current)},hasPartialSubtree:function(){return!f.isDataNode(this._current)&&(f.isAncestorOrSelf(this._current,this.range.startContainer)||f.isAncestorOrSelf(this._current,this.range.endContainer))},
getSubtreeIterator:function(){var l=new a(this.range._document);l.selectNodeContents(this._current);f.isAncestorOrSelf(this._current,this.range.startContainer)&&l.setStart(this.range.startContainer,this.range.startOffset);f.isAncestorOrSelf(this._current,this.range.endContainer)&&l.setEnd(this.range.endContainer,this.range.endOffset);return new c(l)}};b.prototype={rangeCount:0,_document:null,_selectionChangeHandler:function(){this.rangeCount=this._selectionExists(this._document.selection.createRange())?
1:0},_selectionExists:function(l){return l.compareEndPoints("StartToEnd",l)!=0||l.parentElement().isContentEditable},addRange:function(l){var m=this._document.selection.createRange();l=d.convertFromDOMRange(l);if(this._selectionExists(m)){if(l.compareEndPoints("StartToStart",m)==-1)if(l.compareEndPoints("StartToEnd",m)>-1&&l.compareEndPoints("EndToEnd",m)==-1)m.setEndPoint("StartToStart",l);else l.compareEndPoints("EndToStart",m)<1&&l.compareEndPoints("EndToEnd",m)>-1&&m.setEndPoint("EndToEnd",l);
m.select()}else l.select()},removeAllRanges:function(){this._document.selection.empty()},getRangeAt:function(){var l=this._document.selection.createRange();if(this._selectionExists(l))return d.convertToDOMRange(l,this._document);return null},toString:function(){return this._document.selection.createRange().text}};document.createRange=function(){return new a(document)};var g=new b(document);window.getSelection=function(){return g};window.Range=a;if(navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>
-1){__error_tostring=function(){return this.name+": "+(this.message?this.message:this.description)};Error.prototype.toString=__error_tostring;var k=function(l){eval("Native"+l+"="+l+";");eval(l+"= function(m,a,f) { if(typeof a == 'string' || a instanceof String) { var x = new Native"+l+"(0,a); x.message=a; x.toString=__error_tostring; return x; } else { var x = new Native"+l+"(); x.message=m; x.lineno = a; x.filename=f; x.toString=__error_tostring; return x;} };")},h={Error:Error,EvalError:EvalError,
RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError};for(ob in h)k(ob,h[ob]);k=document.getElementsByTagName("head")[0];h=document.createElement("script");h.type="text/javascript";h.src="/os/csshover3.js";k.appendChild(h)}}();
if(navigator.userAgent.indexOf("MSIE")!=-1)window.CSSHover=function(){function a(o,p,n){this.node=o;this.type=p;var r=RegExp("(^|\\s)"+n+"(\\s|$)","g");this.activator=function(){o.className+=" "+n};this.deactivator=function(){o.className=o.className.replace(r," ")};o.attachEvent(s[p].activator,this.activator);o.attachEvent(s[p].deactivator,this.deactivator)}var c=/(^|\s)((([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active|focus))/i,b=/(.*?)\:(hover|active|focus)/i,f=/[^:]+:([a-z\-]+).*/i,d=/(\.([a-z0-9_\-]+):[a-z]+)|(:[a-z]+)/gi,
g=/\.([a-z0-9_\-]*on(hover|active|focus))/i,k=/msie (5|6|7)/i,h=/backcompat/i,l={index:0,list:["text-kashida","text-kashida-space","text-justify"],get:function(){return this.list[this.index++%this.list.length]}},m=function(o){return o.replace(/-(.)/mg,function(p,n){return n.toUpperCase()})},q={elements:[],callbacks:{},init:function(){if(k.test(navigator.userAgent)||h.test(window.document.compatMode))for(var o=window.document.styleSheets,p=o.length,n=0;n<p;n++)this.parseStylesheet(o[n])},parseStylesheet:function(o){if(o.imports)try{for(var p=
o.imports.length,n=0;n<p;n++)this.parseStylesheet(o.imports[n])}catch(r){}try{var w=o.rules,u=w.length;for(p=0;p<u;p++)this.parseCSSRule(w[p],o)}catch(y){}},parseCSSRule:function(o,p){var n=o.selectorText;if(c.test(n)){var r=o.style.cssText,w=b.exec(n)[1],u=n.replace(f,"on$1");n=n.replace(d,".$2"+u);var y=g.exec(n)[1],x=w+y;if(!this.callbacks[x]){var A=l.get(),z=m(A);p.addRule(w,A+':expression(CSSHover(this, "'+u+'", "'+y+'", "'+z+'"))');this.callbacks[x]=true}p.addRule(n,r)}},patch:function(o,p,
n,r){try{o.style[r]=o.parentNode.currentStyle[r]}catch(w){o.runtimeStyle[r]=""}if(!o.csshover)o.csshover=[];if(!o.csshover[n]){o.csshover[n]=true;this.elements.push(new a(o,p,n))}return p},unload:function(){try{for(var o=this.elements.length,p=0;p<o;p++)this.elements[p].unload();this.elements=[];this.callbacks={}}catch(n){}}},s={onhover:{activator:"onmouseenter",deactivator:"onmouseleave"},onactive:{activator:"onmousedown",deactivator:"onmouseup"},onfocus:{activator:"onfocus",deactivator:"onblur"}};
a.prototype={unload:function(){this.node.detachEvent(s[this.type].activator,this.activator);this.node.detachEvent(s[this.type].deactivator,this.deactivator);this.type=this.node=this.deactivator=this.activator=null}};window.attachEvent("onbeforeunload",function(){q.unload()});return function(o,p,n,r){if(o)return q.patch(o,p,n,r);else q.init()}}();
function md5cycle(a,c){var b=a[0],f=a[1],d=a[2],g=a[3];b=ff(b,f,d,g,c[0],7,-680876936);g=ff(g,b,f,d,c[1],12,-389564586);d=ff(d,g,b,f,c[2],17,606105819);f=ff(f,d,g,b,c[3],22,-1044525330);b=ff(b,f,d,g,c[4],7,-176418897);g=ff(g,b,f,d,c[5],12,1200080426);d=ff(d,g,b,f,c[6],17,-1473231341);f=ff(f,d,g,b,c[7],22,-45705983);b=ff(b,f,d,g,c[8],7,1770035416);g=ff(g,b,f,d,c[9],12,-1958414417);d=ff(d,g,b,f,c[10],17,-42063);f=ff(f,d,g,b,c[11],22,-1990404162);b=ff(b,f,d,g,c[12],7,1804603682);g=ff(g,b,f,d,c[13],12,
-40341101);d=ff(d,g,b,f,c[14],17,-1502002290);f=ff(f,d,g,b,c[15],22,1236535329);b=gg(b,f,d,g,c[1],5,-165796510);g=gg(g,b,f,d,c[6],9,-1069501632);d=gg(d,g,b,f,c[11],14,643717713);f=gg(f,d,g,b,c[0],20,-373897302);b=gg(b,f,d,g,c[5],5,-701558691);g=gg(g,b,f,d,c[10],9,38016083);d=gg(d,g,b,f,c[15],14,-660478335);f=gg(f,d,g,b,c[4],20,-405537848);b=gg(b,f,d,g,c[9],5,568446438);g=gg(g,b,f,d,c[14],9,-1019803690);d=gg(d,g,b,f,c[3],14,-187363961);f=gg(f,d,g,b,c[8],20,1163531501);b=gg(b,f,d,g,c[13],5,-1444681467);
g=gg(g,b,f,d,c[2],9,-51403784);d=gg(d,g,b,f,c[7],14,1735328473);f=gg(f,d,g,b,c[12],20,-1926607734);b=hh(b,f,d,g,c[5],4,-378558);g=hh(g,b,f,d,c[8],11,-2022574463);d=hh(d,g,b,f,c[11],16,1839030562);f=hh(f,d,g,b,c[14],23,-35309556);b=hh(b,f,d,g,c[1],4,-1530992060);g=hh(g,b,f,d,c[4],11,1272893353);d=hh(d,g,b,f,c[7],16,-155497632);f=hh(f,d,g,b,c[10],23,-1094730640);b=hh(b,f,d,g,c[13],4,681279174);g=hh(g,b,f,d,c[0],11,-358537222);d=hh(d,g,b,f,c[3],16,-722521979);f=hh(f,d,g,b,c[6],23,76029189);b=hh(b,f,
d,g,c[9],4,-640364487);g=hh(g,b,f,d,c[12],11,-421815835);d=hh(d,g,b,f,c[15],16,530742520);f=hh(f,d,g,b,c[2],23,-995338651);b=ii(b,f,d,g,c[0],6,-198630844);g=ii(g,b,f,d,c[7],10,1126891415);d=ii(d,g,b,f,c[14],15,-1416354905);f=ii(f,d,g,b,c[5],21,-57434055);b=ii(b,f,d,g,c[12],6,1700485571);g=ii(g,b,f,d,c[3],10,-1894986606);d=ii(d,g,b,f,c[10],15,-1051523);f=ii(f,d,g,b,c[1],21,-2054922799);b=ii(b,f,d,g,c[8],6,1873313359);g=ii(g,b,f,d,c[15],10,-30611744);d=ii(d,g,b,f,c[6],15,-1560198380);f=ii(f,d,g,b,c[13],
21,1309151649);b=ii(b,f,d,g,c[4],6,-145523070);g=ii(g,b,f,d,c[11],10,-1120210379);d=ii(d,g,b,f,c[2],15,718787259);f=ii(f,d,g,b,c[9],21,-343485551);a[0]=add32(b,a[0]);a[1]=add32(f,a[1]);a[2]=add32(d,a[2]);a[3]=add32(g,a[3])}function cmn(a,c,b,f,d,g){c=add32(add32(c,a),add32(f,g));return add32(c<<d|c>>>32-d,b)}function ff(a,c,b,f,d,g,k){return cmn(c&b|~c&f,a,c,d,g,k)}function gg(a,c,b,f,d,g,k){return cmn(c&f|b&~f,a,c,d,g,k)}function hh(a,c,b,f,d,g,k){return cmn(c^b^f,a,c,d,g,k)}
function ii(a,c,b,f,d,g,k){return cmn(b^(c|~f),a,c,d,g,k)}function md51(a){txt="";var c=a.length,b=[1732584193,-271733879,-1732584194,271733878],f;for(f=64;f<=a.length;f+=64)md5cycle(b,md5blk(a.substring(f-64,f)));a=a.substring(f-64);var d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<a.length;f++)d[f>>2]|=a.charCodeAt(f)<<(f%4<<3);d[f>>2]|=128<<(f%4<<3);if(f>55){md5cycle(b,d);for(f=0;f<16;f++)d[f]=0}d[14]=c*8;md5cycle(b,d);return b}
function md5blk(a){var c=[],b;for(b=0;b<64;b+=4)c[b>>2]=a.charCodeAt(b)+(a.charCodeAt(b+1)<<8)+(a.charCodeAt(b+2)<<16)+(a.charCodeAt(b+3)<<24);return c}var hex_chr="0123456789abcdef".split("");function rhex(a){for(var c="",b=0;b<4;b++)c+=hex_chr[a>>b*8+4&15]+hex_chr[a>>b*8&15];return c}function hex(a){for(var c=0;c<a.length;c++)a[c]=rhex(a[c]);return a.join("")}function md5(a){return hex(md51(a))}function add32(a,c){return a+c&4294967295}
if(md5("hello")!="5d41402abc4b2a76b9719d911017c592")add32=function(a,c){var b=(a&65535)+(c&65535);return(a>>16)+(c>>16)+(b>>16)<<16|b&65535};GLOBAL=this;
for(var tokens=["END","\n",";",",","=","?",":","CONDITIONAL","||","&&","|","^","&","==","!=","===","!==","<","<=",">=",">","<<",">>",">>>","+","-","*","/","%","!","~","UNARY_PLUS","UNARY_MINUS","++","--",".","[","]","{","}","(",")","SCRIPT","BLOCK","LABEL","FOR_IN","CALL","NEW_WITH_ARGS","INDEX","ARRAY_INIT","OBJECT_INIT","PROPERTY_INIT","GETTER","SETTER","GROUP","LIST","IDENTIFIER","NUMBER","STRING","REGEXP","break","case","catch","const","continue","debugger","default","delete","do","else","enum",
"false","finally","for","function","if","in","instanceof","new","null","return","switch","this","throw","true","try","typeof","var","void","while","with"],opTypeNames={"\n":"NEWLINE",";":"SEMICOLON",",":"COMMA","?":"HOOK",":":"COLON","||":"OR","&&":"AND","|":"BITWISE_OR","^":"BITWISE_XOR","&":"BITWISE_AND","===":"STRICT_EQ","==":"EQ","=":"ASSIGN","!==":"STRICT_NE","!=":"NE","<<":"LSH","<=":"LE","<":"LT",">>>":"URSH",">>":"RSH",">=":"GE",">":"GT","++":"INCREMENT","--":"DECREMENT","+":"PLUS","-":"MINUS",
"*":"MUL","/":"DIV","%":"MOD","!":"NOT","~":"BITWISE_NOT",".":"DOT","[":"LEFT_BRACKET","]":"RIGHT_BRACKET","{":"LEFT_CURLY","}":"RIGHT_CURLY","(":"LEFT_PAREN",")":"RIGHT_PAREN"},keywords={__proto__:null},consts="var ",i=0,j=tokens.length;i<j;i++){if(i>0)consts+=", ";var t=tokens[i];if(/^[a-z]/.test(t)){consts+=t.toUpperCase();keywords[t]=i}else consts+=/^\W/.test(t)?opTypeNames[t]:t;consts+=" = "+i;tokens[t]=i}eval(consts+";");var assignOps=["|","^","&","<<",">>",">>>","+","-","*","/","%"];i=0;
for(j=assignOps.length;i<j;i++){t=assignOps[i];assignOps[t]=tokens[t]}var opRegExpSrc="^";for(i in opTypeNames)if(i!="\n"){if(opRegExpSrc!="^")opRegExpSrc+="|^";opRegExpSrc+=i.replace(/[?|^&(){}\[\]+\-*\/\.]/g,"\\$&")}var opRegExp=RegExp(opRegExpSrc),fpRegExp=/^\d+\.\d*(?:[eE][-+]?\d+)?|^\d+(?:\.\d*)?[eE][-+]?\d+|^\.\d+(?:[eE][-+]?\d+)?/;fpRegExp=/^(?:\d+\.\d*(?:[eE][-+]?\d+)?|\d+(?:\.\d*)?[eE][-+]?\d+|\.\d+(?:[eE][-+]?\d+)?)/;
var opRegExp2=RegExp(opRegExp.source.substr(1),"g"),fpRegExp2=/(?:\d+\.\d*(?:[eE][-+]?\d+)?|\d+(?:\.\d*)?[eE][-+]?\d+|\.\d+(?:[eE][-+]?\d+)?)/g,qrNumber2=/(?:0[xX][\da-fA-F]+|0[0-7]*|\d+)/g,qrString2=/(?:'[^'\\]*(?:\\.[^'\\]*)*'|"[^"\\]*(?:\\.[^"\\]*)*")/g,qrRegExp2=/\/((?:\\.|[^\/])+)\/([gimy]*)/g,qrComment2=/\/(?:\*(?:.|\n|\r)*?\*\/|\/.*)/g,qrIdentifier2=/[$\w]+/g,reRegExp=/^\/((?:\\.|\[(?:\\.|[^\]])*\]|[^\/])+)\/([gimy]*)/;
function Tokenizer(a,c,b){this.cursor=0;this.source=String(a);this.tokens=[];this.lookahead=this.tokenIndex=0;this.scanNewlines=false;this.scanOperand=true;this.filename=c||"";this.lineno=b||1;this.MARK=43431352}
Tokenizer.prototype={input:function(){return this.source.substring(this.cursor)},done:function(){return this.peek()==END},token:function(){return this.tokens[this.tokenIndex]},match:function(a){return this.get()==a||this.unget()},mustMatch:function(a){if(!this.match(a)){a=this.newSyntaxError("Missing "+tokens[a].toLowerCase()+" at line "+this.lineno,this.filename,this.lineno);a.___jeneric_err=true;a.lineNumber=this.lineno;a.fileName=this.filename;throw a;}return this.token()},peek:function(){var a;
if(this.lookahead){a=this.tokens[this.tokenIndex+this.lookahead&3];a=this.scanNewlines&&a.lineno!=this.lineno?NEWLINE:a.type}else{a=this.get();this.unget()}return a},peekOnSameLine:function(){this.scanNewlines=true;var a=this.peek();this.scanNewlines=false;return a},get:function(){for(var a;this.lookahead;){--this.lookahead;this.tokenIndex=this.tokenIndex+1&3;a=this.tokens[this.tokenIndex];if(a.type!=NEWLINE||this.scanNewlines)return a.type}for(;;){var c=this.input(),b=c.charCodeAt(0);if(b==32||b>=
9&&b<=13){var f=c.match(this.scanNewlines?/^[ \t]+/:/^\s+/);if(f){c=f[0];this.cursor+=c.length;if(a=c.match(/\n/g))this.lineno+=a.length;c=this.input()}}if(c.charCodeAt(0)!=47||!(f=c.match(/^\/(?:\*(?:.|\n|\r)*?\*\/|\/.*)/)))break;a=f[0];this.cursor+=a.length;if(a=a.match(/\n/g))this.lineno+=a.length}this.tokenIndex=this.tokenIndex+1&3;(a=this.tokens[this.tokenIndex])||(this.tokens[this.tokenIndex]=a={});if(!c)return a.type=END;b=c.charCodeAt(0);try{if((b==46||b>47&&b<58)&&(f=c.match(fpRegExp))){a.type=
NUMBER;a.v=parseFloat(f[0])}else if(b>47&&b<58&&(f=c.match(/^(?:0[xX][\da-fA-F]+|0[0-7]*|\d+)/))){a.type=NUMBER;a.v=parseInt(f[0])}else if((b>47&&b<58||b>64&&b<91||b>96&&b<123||b==36||b==95)&&(f=c.match(/^[$\w]+/))){var d=f[0];a.type=keywords[d]?typeof keywords[d]=="number"?keywords[d]:IDENTIFIER:IDENTIFIER;a.v=d}else if((b==34||b==39)&&(f=c.match(/^(?:"(?:\\.|[^"])*"|'(?:[^']|\\.)*')/))){a.type=STRING;if(f)a.v=eval(f[0])}else if(this.scanOperand&&b==47&&(f=c.match(reRegExp))){a.type=REGEXP;a.v=RegExp(f[1],
f[2])}else if(f=c.match(opRegExp)){var g=f[0];if(assignOps[g]&&c.charAt(g.length)=="="){a.type=ASSIGN;a.assignOp=GLOBAL[opTypeNames[g]];f[0]+="="}else{a.type=GLOBAL[opTypeNames[g]];if(this.scanOperand&&(a.type==PLUS||a.type==MINUS))a.type+=UNARY_PLUS-PLUS;a.assignOp=null}a.v=g}else if(this.scanNewlines&&(f=c.match(/^\n/)))a.type=NEWLINE;else{var k=this.newSyntaxError("Illegal token");k.___jeneric_err=true;throw k;}}catch(h){if(h instanceof SyntaxError)h.___jeneric_err=true;throw h;}a.start=this.cursor;
this.cursor+=f[0].length;a.end=this.cursor;a.lineno=this.lineno;return a.type},unget:function(){if(++this.lookahead==4){var a=new SyntaxError("PANIC: too much lookahead!");a.___jeneric_err=true;throw a;}this.tokenIndex=this.tokenIndex-1&3},newSyntaxError:function(a){a=new SyntaxError(a,this.filename,this.lineno);a.lineNumber=this.lineno;a.fileName=this.filename;a.source=this.source;a.cursor=this.cursor;return a}};
function CompilerContext(a){this.inFunction=a;this.stmtStack=[];this.fD=[];this.vD=[]}var CCp=CompilerContext.prototype;CCp.bracketLevel=CCp.curlyLevel=CCp.parenLevel=CCp.hookLevel=0;CCp.ecmaStrictMode=CCp.inForLoopInit=false;function Script(a,c){var b=Statements(a,c);b.type=SCRIPT;b.fD=c.fD;b.vD=c.vD;return b}Array.prototype.top=function(){return this.length&&this[this.length-1]};
function Node(a,c){var b=[];for(var f in Node.prototype)b[f]=Node.prototype[f];b.constructor=Node;if(f=a.token()){b.type=c||f.type;b.v=f.v;b.lineno=f.lineno;b.start=f.start;b.end=f.end}else{b.type=c;b.lineno=a.lineno}b.tokenizer=a;b.filename=a.filename;for(f=2;f<arguments.length;f++)b.push(arguments[f]);return b}var Np=Node.prototype;Np.toSource=Object.prototype.toSource;Np.push=function(a){if(a!==null){if(a.start<this.start)this.start=a.start;if(this.end<a.end)this.end=a.end}this[this.length]=a};
Node.indentLevel=0;function tokenstr(a){a=tokens[a];return/^\W/.test(a)?opTypeNames[a]:a.toUpperCase()}
Np.toString=function(){var a=[];for(var c in this)if(this.hasOwnProperty(c)&&c!="type"&&c!="parent"&&typeof this[c]!="function")c!="target"?a.push({id:c,v:this[c]}):a.push({id:c,v:"[token: "+this[c].v+"]"});a.sort(function(d,g){return d.id<g.id?-1:1});INDENTATION="    ";var b=++Node.indentLevel,f="{\n"+INDENTATION.repeat(b)+"type: "+tokenstr(this.type);for(c=0;c<a.length;c++)f+=",\n"+INDENTATION.repeat(b)+a[c].id+": "+a[c].v;b=--Node.indentLevel;f+="\n"+INDENTATION.repeat(b)+"}";return f};
Np.getSource=function(){return this.tokenizer.source.slice(this.start,this.end)};String.prototype.repeat=function(a){for(var c="",b=this+c;--a>=0;)c+=b;return c};function nest(a,c,b,f,d){c.stmtStack.push(b);b=f(a,c);c.stmtStack.pop();d&&a.mustMatch(d);return b}function Statements(a,c){var b=Node(a,BLOCK);for(c.stmtStack.push(b);!a.done()&&a.peek()!=RIGHT_CURLY;)b.push(Statement(a,c));c.stmtStack.pop();return b}
function Block(a,c){a.mustMatch(LEFT_CURLY);var b=Statements(a,c);a.mustMatch(RIGHT_CURLY);return b}DECLARED_FORM=0;EXPRESSED_FORM=1;STATEMENT_FORM=2;
function Statement(a,c){var b,f,d,g,k=a.get();switch(k){case FUNCTION:return FunctionDefinition(a,c,true,c.stmtStack.length>1?STATEMENT_FORM:DECLARED_FORM);case LEFT_CURLY:d=Statements(a,c);a.mustMatch(RIGHT_CURLY);return d;case IF:d=Node(a);d.c=ParenExpression(a,c);c.stmtStack.push(d);d.tP=Statement(a,c);d.elsePart=a.match(ELSE)?Statement(a,c):null;c.stmtStack.pop();return d;case SWITCH:d=Node(a);a.mustMatch(LEFT_PAREN);d.discriminant=Expression(a,c);a.mustMatch(RIGHT_PAREN);d.cases=[];d.defaultIndex=
-1;c.stmtStack.push(d);for(a.mustMatch(LEFT_CURLY);(k=a.get())!=RIGHT_CURLY;){switch(k){case DEFAULT:if(d.defaultIndex>=0){d=a.newSyntaxError("More than one switch default");d.___jeneric_err=true;throw d;}case CASE:b=Node(a);if(k==DEFAULT)d.defaultIndex=d.cases.length;else b.caseLabel=Expression(a,c,COLON);break;default:d=a.newSyntaxError("Invalid switch case");d.___jeneric_err=true;throw d;}a.mustMatch(COLON);for(b.statements=Node(a,BLOCK);(k=a.peek())!=CASE&&k!=DEFAULT&&k!=RIGHT_CURLY;)b.statements.push(Statement(a,
c));d.cases.push(b)}c.stmtStack.pop();return d;case FOR:d=Node(a);d.isLoop=true;a.mustMatch(LEFT_PAREN);if((k=a.peek())!=SEMICOLON){c.inForLoopInit=true;if(k==VAR||k==CONST){a.get();b=Variables(a,c)}else b=Expression(a,c);c.inForLoopInit=false}if(b&&a.match(IN)){d.type=FOR_IN;if(b.type==VAR){if(b.length!=1){d=new SyntaxError("Invalid for..in left-hand side",a.filename,b.lineno);d.___jeneric_err=true;throw d;}d.iterator=b[0];d.varDecl=b}else{d.iterator=b;d.varDecl=null}d.object=Expression(a,c)}else{d.setup=
b||null;a.mustMatch(SEMICOLON);d.c=a.peek()==SEMICOLON?null:Expression(a,c);a.mustMatch(SEMICOLON);d.update=a.peek()==RIGHT_PAREN?null:Expression(a,c)}a.mustMatch(RIGHT_PAREN);d.body=nest(a,c,d,Statement);return d;case WHILE:d=Node(a);d.isLoop=true;d.c=ParenExpression(a,c);d.body=nest(a,c,d,Statement);return d;case DO:d=Node(a);d.isLoop=true;d.body=nest(a,c,d,Statement,WHILE);d.c=ParenExpression(a,c);if(!c.ecmaStrictMode){a.match(SEMICOLON);return d}break;case BREAK:case CONTINUE:d=Node(a);if(a.peekOnSameLine()==
IDENTIFIER){a.get();d.label=a.token().v}g=c.stmtStack;b=g.length;if(f=d.label){do if(--b<0){d=a.newSyntaxError("Label not found");d.___jeneric_err=true;throw d;}while(g[b].label!=f)}else{do if(--b<0){d=a.newSyntaxError("Invalid "+(k==BREAK?"break":"continue"));d.___jeneric_err=true;throw d;}while(!g[b].isLoop&&(k!=BREAK||g[b].type!=SWITCH))}d.target=g[b];break;case TRY:d=Node(a);d.tryBlock=Block(a,c);for(d.catchClauses=[];a.match(CATCH);){b=Node(a);a.mustMatch(LEFT_PAREN);b.varName=a.mustMatch(IDENTIFIER).v;
if(a.match(IF)){if(c.ecmaStrictMode){d=a.newSyntaxError("Illegal catch guard");d.___jeneric_err=true;throw d;}if(d.catchClauses.length&&!d.catchClauses.top().guard){d=a.newSyntaxError("Guarded catch after unguarded");d.___jeneric_err=true;throw d;}b.guard=Expression(a,c)}else b.guard=null;a.mustMatch(RIGHT_PAREN);b.block=Block(a,c);d.catchClauses.push(b)}if(a.match(FINALLY))d.finallyBlock=Block(a,c);if(!d.catchClauses.length&&!d.finallyBlock){d=a.newSyntaxError("Invalid try statement");d.___jeneric_err=
true;throw d;}return d;case CATCH:case FINALLY:d=a.newSyntaxError(tokens[k]+" without preceding try");d.___jeneric_err=true;throw d;case THROW:d=Node(a);d.exception=Expression(a,c);break;case RETURN:if(!c.inFunction){d=a.newSyntaxError("Invalid return");d.___jeneric_err=true;throw d;}d=Node(a);k=a.peekOnSameLine();if(k!=END&&k!=NEWLINE&&k!=SEMICOLON&&k!=RIGHT_CURLY)d.v=Expression(a,c);break;case WITH:d=Node(a);d.object=ParenExpression(a,c);d.body=nest(a,c,d,Statement);return d;case VAR:case CONST:d=
Variables(a,c);break;case DEBUGGER:d=Node(a);break;case NEWLINE:case SEMICOLON:d=Node(a,SEMICOLON);d.e=null;return d;default:if(k==IDENTIFIER){a.scanOperand=false;k=a.peek();a.scanOperand=true;if(k==COLON){f=a.token().v;g=c.stmtStack;for(b=g.length-1;b>=0;--b)if(g[b].label==f){d=a.newSyntaxError("Duplicate label");d.___jeneric_err=true;throw d;}a.get();d=Node(a,LABEL);d.label=f;d.statement=nest(a,c,d,Statement);return d}}d=Node(a,SEMICOLON);a.unget();d.e=Expression(a,c);d.end=d.e.end;break}if(a.lineno==
a.token().lineno){k=a.peekOnSameLine();if(k!=END&&k!=NEWLINE&&k!=SEMICOLON&&k!=RIGHT_CURLY){d=a.newSyntaxError("Missing ; before statement");d.___jeneric_err=true;throw d;}}a.match(SEMICOLON);return d}
function FunctionDefinition(a,c,b,f){var d=Node(a);if(d.type!=FUNCTION)d.type=d.v=="get"?GETTER:SETTER;if(a.match(IDENTIFIER))d.name=a.token().v;else if(b){a=a.newSyntaxError("Missing function identifier");a.___jeneric_err=true;throw a;}a.mustMatch(LEFT_PAREN);for(d.params=[];(b=a.get())!=RIGHT_PAREN;){if(b!=IDENTIFIER){a=a.newSyntaxError("Missing formal parameter");a.___jeneric_err=true;throw a;}d.params.push(a.token().v);a.peek()!=RIGHT_PAREN&&a.mustMatch(COMMA)}a.mustMatch(LEFT_CURLY);b=new CompilerContext(true);
d.body=Script(a,b);a.mustMatch(RIGHT_CURLY);d.end=a.token().end;d.functionForm=f;f==DECLARED_FORM&&c.fD.push(d);return d}function Variables(a,c){var b=Node(a);do{a.mustMatch(IDENTIFIER);var f=Node(a);f.name=f.v;if(a.match(ASSIGN)){if(a.token().assignOp){b=a.newSyntaxError("Invalid variable initialization");b.___jeneric_err=true;throw b;}f.iz=Expression(a,c,COMMA)}f.readOnly=b.type==CONST;b.push(f);c.vD.push(f)}while(a.match(COMMA));return b}
function ParenExpression(a,c){a.mustMatch(LEFT_PAREN);var b=Expression(a,c);a.mustMatch(RIGHT_PAREN);return b}var opPrecedence={SEMICOLON:0,COMMA:1,ASSIGN:2,HOOK:2,COLON:2,OR:4,AND:5,BITWISE_OR:6,BITWISE_XOR:7,BITWISE_AND:8,EQ:9,NE:9,STRICT_EQ:9,STRICT_NE:9,LT:10,LE:10,GE:10,GT:10,IN:10,INSTANCEOF:10,LSH:11,RSH:11,URSH:11,PLUS:12,MINUS:12,MUL:13,DIV:13,MOD:13,DELETE:14,VOID:14,TYPEOF:14,NOT:14,BITWISE_NOT:14,UNARY_PLUS:14,UNARY_MINUS:14,INCREMENT:15,DECREMENT:15,NEW:16,DOT:17},opPrecedenceItems=[];
for(i in opPrecedence)opPrecedenceItems.push(i);for(i=0;i<opPrecedenceItems.length;i++){var item=opPrecedenceItems[i];opPrecedence[eval(item)]=opPrecedence[item]}
var opArity={COMMA:-2,ASSIGN:2,HOOK:3,OR:2,AND:2,BITWISE_OR:2,BITWISE_XOR:2,BITWISE_AND:2,EQ:2,NE:2,STRICT_EQ:2,STRICT_NE:2,LT:2,LE:2,GE:2,GT:2,IN:2,INSTANCEOF:2,LSH:2,RSH:2,URSH:2,PLUS:2,MINUS:2,MUL:2,DIV:2,MOD:2,DELETE:1,VOID:1,TYPEOF:1,NOT:1,BITWISE_NOT:1,UNARY_PLUS:1,UNARY_MINUS:1,INCREMENT:1,DECREMENT:1,NEW:1,NEW_WITH_ARGS:2,DOT:2,INDEX:2,CALL:2,ARRAY_INIT:1,OBJECT_INIT:1,GROUP:1},opArityItems=[];for(i in opArity)opArityItems.push(i);
for(i=0;i<opArityItems.length;i++){item=opArityItems[i];opArity[eval(item)]=opArity[item]}
function Expression(a,c,b){function f(){var o=k.pop(),p=o.type,n=opArity[p];if(n==-2){n=h.length>=2&&h[h.length-2];if(n.type==p){o=h.pop();n.push(o);return n}n=2}p=h.length-n;p=h.splice(p,h.length-p);for(var r=0;r<n;r++)o.push(p[r]);if(o.end<a.token().end)o.end=a.token().end;h.push(o);return o}var d,g,k=[],h=[],l=c.bracketLevel,m=c.curlyLevel,q=c.parenLevel,s=c.hookLevel;a:for(;(g=a.get())!=END;){if(g==b&&c.bracketLevel==l&&c.curlyLevel==m&&c.parenLevel==q&&c.hookLevel==s)break;switch(g){case SEMICOLON:break a;
case ASSIGN:case HOOK:case COLON:if(a.scanOperand)break a;for(;opPrecedence[k.top().type]>opPrecedence[g]||g==COLON&&k.top().type==ASSIGN;)f();if(g==COLON){d=k.top();if(d.type!=HOOK){c=a.newSyntaxError("Invalid label");c.___jeneric_err=true;throw c;}--c.hookLevel}else{k.push(Node(a));if(g==ASSIGN)h.top().assignOp=a.token().assignOp;else++c.hookLevel}a.scanOperand=true;break;case IN:if(c.inForLoopInit&&!c.hookLevel&&!c.bracketLevel&&!c.curlyLevel&&!c.parenLevel)break a;case COMMA:case OR:case AND:case BITWISE_OR:case BITWISE_XOR:case BITWISE_AND:case EQ:case NE:case STRICT_EQ:case STRICT_NE:case LT:case LE:case GE:case GT:case INSTANCEOF:case LSH:case RSH:case URSH:case PLUS:case MINUS:case MUL:case DIV:case MOD:case DOT:if(a.scanOperand)break a;
for(;opPrecedence[k.top().type]>=opPrecedence[g];)f();if(g==DOT){a.mustMatch(IDENTIFIER);h.push(Node(a,DOT,h.pop(),Node(a)))}else{k.push(Node(a));a.scanOperand=true}break;case DELETE:case VOID:case TYPEOF:case NOT:case BITWISE_NOT:case UNARY_PLUS:case UNARY_MINUS:case NEW:if(!a.scanOperand)break a;k.push(Node(a));break;case INCREMENT:case DECREMENT:if(a.scanOperand)k.push(Node(a));else{if(a.tokens[a.tokenIndex+a.lookahead-1&3].lineno!=a.lineno)break a;for(;opPrecedence[k.top().type]>opPrecedence[g];)f();
d=Node(a,g,h.pop());d.postfix=true;h.push(d)}break;case FUNCTION:if(!a.scanOperand)break a;h.push(FunctionDefinition(a,c,false,EXPRESSED_FORM));a.scanOperand=false;break;case NULL:case THIS:case TRUE:case FALSE:case IDENTIFIER:case NUMBER:case STRING:case REGEXP:if(!a.scanOperand)break a;h.push(Node(a));a.scanOperand=false;break;case LEFT_BRACKET:if(a.scanOperand){for(d=Node(a,ARRAY_INIT);(g=a.peek())!=RIGHT_BRACKET;)if(g==COMMA){a.get();d.push(null)}else{d.push(Expression(a,c,COMMA));if(!a.match(COMMA))break}a.mustMatch(RIGHT_BRACKET);
h.push(d);a.scanOperand=false}else{k.push(Node(a,INDEX));a.scanOperand=true;++c.bracketLevel}break;case RIGHT_BRACKET:if(a.scanOperand||c.bracketLevel==l)break a;for(;f().type!=INDEX;);--c.bracketLevel;break;case LEFT_CURLY:if(!a.scanOperand)break a;++c.curlyLevel;d=Node(a,OBJECT_INIT);b:if(!a.match(RIGHT_CURLY)){do{g=a.get();if((a.token().v=="get"||a.token().v=="set")&&a.peek()==IDENTIFIER){if(c.ecmaStrictMode){c=a.newSyntaxError("Illegal property accessor");c.___jeneric_err=true;throw c;}d.push(FunctionDefinition(a,
c,true,EXPRESSED_FORM))}else{switch(g){case IDENTIFIER:case NUMBER:case STRING:g=Node(a);break;case RIGHT_CURLY:if(c.ecmaStrictMode){c=a.newSyntaxError("Illegal trailing ,");c.___jeneric_err=true;throw c;}break b;default:c=a.newSyntaxError("Invalid property name");c.___jeneric_err=true;throw c;}a.mustMatch(COLON);d.push(Node(a,PROPERTY_INIT,g,Expression(a,c,COMMA)))}}while(a.match(COMMA));a.mustMatch(RIGHT_CURLY)}h.push(d);a.scanOperand=false;--c.curlyLevel;break;case RIGHT_CURLY:if(!a.scanOperand&&
c.curlyLevel!=m){c=new SyntaxError("PANIC: right curly botch");c.___jeneric_err=true;throw c;}break a;case LEFT_PAREN:if(a.scanOperand)k.push(Node(a,GROUP));else{for(;opPrecedence[k.top().type]>opPrecedence[NEW];)f();d=k.top();a.scanOperand=true;if(a.match(RIGHT_PAREN)){if(d.type==NEW){--k.length;d.push(h.pop())}else d=Node(a,CALL,h.pop(),Node(a,LIST));h.push(d);a.scanOperand=false;break}if(d.type==NEW)d.type=NEW_WITH_ARGS;else k.push(Node(a,CALL))}++c.parenLevel;break;case RIGHT_PAREN:if(a.scanOperand||
c.parenLevel==q)break a;for(;(g=f().type)!=GROUP&&g!=CALL&&g!=NEW_WITH_ARGS;);if(g!=GROUP){d=h.top();if(d[1].type!=COMMA)d[1]=Node(a,LIST,d[1]);else d[1].type=LIST}--c.parenLevel;break;default:break a}}if(c.hookLevel!=s){c=a.newSyntaxError("Missing : after ?");c.___jeneric_err=true;throw c;}if(c.parenLevel!=q){c=a.newSyntaxError("Missing ) in parenthetical");c.___jeneric_err=true;throw c;}if(c.bracketLevel!=l){c=a.newSyntaxError("Missing ] in index expression");c.___jeneric_err=true;throw c;}if(a.scanOperand){c=
a.newSyntaxError("Missing operand");c.___jeneric_err=true;throw c;}a.scanOperand=true;for(a.unget();k.length;)f();return h.pop()}function parse(a,c,b){if(a.charAt(0)==="{"&&a.charAt(a.length-1)==="}")return JSON.parse(a);a=new Tokenizer(a,c,b);c=new CompilerContext(false);c=Script(a,c);if(!a.done()){a=a.newSyntaxError("Syntax error");a.___jeneric_err=true;throw a;}return c}
(function(){_P_COMPILER={DEEP:5E3};objj=function(a,c,b){var f={};f.parsed=a;f.targ={};f.path_desc=[{name:0,value:a[0],idx:0}];f.STOP=false;f._TS=(new Date).getTime();setTimeout(function(){for(var d=(new Date).getTime();f.path_desc.length&&(new Date).getTime()-d<100;)a:{var g=f,k=g.path_desc,h=k[k.length-1];if(h){var l=void 0;b:{l=g.parsed;for(var m=void 0,q=0;q<k.length-1;q++){m=k[q];m.accessCount+=1;l=l[m.name];if(!l){l=null;break b}}if(l instanceof Array&&h.idx<l.length){h.name=h.idx;l={value:l[h.idx],
name:h.idx,idx:0,accessCount:0}}else{q=l.length||0;for(var s in l){if(h.idx==q){h.name=s;l={value:l[s],name:s,idx:0,accessCount:0};break b}q++}l=null}}m=void 0;m=g.targ;q=void 0;for(var o=0;o<k.length-1;o++){q=k[o];q.accessCount+=1;m[q.name]||(m[q.name]={});m=m[q.name]}if(typeof h.name==="number")m.length=h.name+1;m=m[h.name]?{value:m[h.name],name:h.name,idx:0,accessCount:0}:{value:m,name:h.name,idx:0,accessCount:0};g.targ_current=m;if(l){h.idx+=1;h.name=l.name;if((h.value=l.value)&&l.value.exec&&
l.value.test&&l.value.source)g.STOP="Cannot compile inline regex's; consider using RegExp() prototype";else if(!(l.name==="toSource"||l.name==="tokenizer"||l.name==="lineno"||l.name==="filename"||l.name==="start"||l.name==="end"))if(typeof l.value!=="function")if(typeof l.value!=="object"){if(typeof l.value!=="function")g.targ_current.value[l.name]=l.value}else if(l.value===null)g.targ_current.value[l.name]=null;else if(k.length>_P_COMPILER.DEEP)g.STOP="Max stack DEEPness reached";else if(l.value instanceof
Array)k.push({name:0,idx:0,value:l.value,accessCount:0});else if(typeof l.value==="object")for(var p in l.value){k.push({name:p,idx:0,value:l.value,accessCount:0});break a}}else k.pop()}}if(f.STOP)b(f.STOP);else f.path_desc.length?setTimeout(arguments.callee,50):c(f.targ,f)},50)}})();
function test_objj(){objj(parse(BUNDLED_FILES["os/st.jn"],"st.jn",0),function(a,c){OUT=a;PROC=c;console.log("Finished processing");var b=JSON.parse(JSON.stringify(a)),f=new Jnaric;f.global.object={ipc:{}};f.global.security={};f.g_stack.stack.unshift({n:b,x:f.g_stack.exc,pmy:{}});__jn_stacks.add_task(f,f.g_stack,f.nice,f.throttle);PROC.vm=f},function(a){console.log("Compile failed: "+a)})}DEBUG=5;TRACE_DEPTH=100;
__jn_stacks={BURST_TOTAL:45,BURST_MIN:10,SET_TIMEOUT:50,min_runtime:(new Date).getTime(),pid_counter:1,timer_id:null,idsource:0,stacks_running:[],stacks_sleeping:[],newId:function(){return++this.idsource},add_task:function(a,c,b,f){var d,g=0;for(d=0;d<this.stacks_sleeping.length;d++)this.stacks_sleeping[d].vm==a&&g++;for(d=0;d<this.stacks_running.length;d++)this.stacks_running[d].vm==a&&g++;if(g>a.MAX_THREADS){a.ErrorConsole.log("KERNEL Error: maximum amount of threads per this ("+a.uri+") VM exceeded ("+
g+"); dropping thread creation");c=new a.global.InternalError("maximum amount of threads per this VM exceeded; dropping thread creation");c.___jeneric_err=true;throw c;}c.pid=this.pid_counter++;c.nice=b;if(typeof b=="undefined")b=0;if(typeof f=="undefined")f=1;this.stacks_running.unshift({pid:c.pid,rt:this.min_runtime,rt_s:this.min_runtime+"",vm:a,stack:c,nice:b,throttle:f});if(this.stacks_running.length==1){var k=this;clearInterval(this.timer_id);this.timer_id=setInterval(function(){k.tick()},this.SET_TIMEOUT)}else{var h=
this.min_runtime;k=this;setTimeout(function(){if(k.min_timeout==h){clearInterval(k.timer_id);k.timer_id=setInterval(function(){k.tick()},k.SET_TIMEOUT)}},this.SET_TIMEOUT*3)}if(b<-10){if(this.stacks_running.length==2)this.stacks_running[1].rt>this.stacks_running[0].rt&&this.stacks_running.reverse();else if(this.stacks_running.length>2){a=Object.prototype.toString;Object.prototype.toString=this.fast_sort_ret;this.stacks_running.sort();Object.prototype.toString=a}this.min_runtime=this.stacks_running[0].rt;
this.tick()}return c.pid},start:function(a){var c,b=this.stacks_sleeping.length;for(c=0;c<b;c++)if(this.stacks_sleeping[c].pid==a)break;if(c<b){this.stacks_running.unshift(this.stacks_sleeping[c]);this.stacks_running[0].rt=this.min_runtime;this.stacks_running[0].rts=this.min_runtime+"";this.stacks_sleeping.splice(c,1)}if(c<b&&this.stacks_running.length==1&&this.timer_id==null){var f=this;this.timer_id=setInterval(function(){f.tick()},this.SET_TIMEOUT)}else{var d=this.min_runtime;f=this;setTimeout(function(){if(f.min_runtime==
d){clearInterval(f.timer_id);f.timer_id=setInterval(function(){f.tick()},f.SET_TIMEOUT)}},this.SET_TIMEOUT*3)}return c==this.stacks_sleeping.length?-1:a},tick:function(){if((new Date).getTime()-this.last_tick<this.SET_TIMEOUT/4)console.log("fast ticking!");else{var a=this.BURST_TOTAL/this.stacks_running.length;a=a<this.BURST_MIN?this.BURST_MIN:a;for(var c=(new Date).getTime(),b=0,f=(new Date).getTime(),d,g,k,h,l,m=[].concat(this.stacks_running);(new Date).getTime()-c<=this.BURST_TOTAL&&m[b];){g=m[b];
d=(new Date).getTime();k=a*g.throttle;g.vm.ExecutionContext.current=g.stack.exc;ObjectProto=Object.prototype;Object.prototype=g.stack.object_prototype;g.vm.cur_stack=g.stack;if(g.stack.global_scope)g.vm.global=g.stack.global_scope;for(;f-d<=k;){if(g.stack.STOP){this.stacks_sleeping.push(g);for(h=0;h<this.stacks_running.length;h++)if(this.stacks_running[h]==g){this.stacks_running.splice(h,1);break}break}try{l=g.vm.step_next(g.stack)}catch(q){if(window.console){console.log("TICK: Error exeuting next step:");
console.log(q+" "+q.stack+" f:"+q.fileName+" l:"+q.lineNumber);EXCEPTION=q}l=false}if(!l){for(h=0;h<this.stacks_running.length;h++)if(this.stacks_running[h]==g){this.stacks_running.splice(h,1);break}break}f=(new Date).getTime()}g.stack.exc=g.vm.ExecutionContext.current;g.stack.object_prototype=Object.prototype;Object.prototype=ObjectProto;if(g.stack.global_scope)g.vm.global=g.vm.global_bak;d=f-d;if(d>k){if(g.throttle!=1)d=parseInt(d/g.throttle);g.rt=g.nice==0?g.rt+d:g.rt+parseInt(d*(1+g.nice/27));
g.rts=g.rt+""}b++}if(this.stacks_running.length==0){clearInterval(this.timer_id);this.timer_id=null}else{if(this.stacks_running.length==2)this.stacks_running[1].rt>this.stacks_running[0].rt&&this.stacks_running.reverse();else if(this.stacks_running.length>2){a=Object.prototype.toString;Object.prototype.toString=this.fast_sort_ret;this.stacks_running.sort();Object.prototype.toString=a}this.min_runtime=this.stacks_running[0].rt}}},fast_sort_ret:function(){return this.rts},__nice:function(a,c){var b;
for(b=0;b<this.stacks_sleeping.length;b++)if(this.stacks_sleeping[b].pid==a)break;if(b>=this.stacks_sleeping.length){for(b=0;b<this.stacks_running.length;b++)if(this.stacks_running[b].pid==a)break;if(b>=this.stacks_running.length)return null;else b=this.stacks_running[b]}else b=this.stacks_sleeping[b];if(typeof c=="undefined")return b.nice;else{if(c>19)c=19;if(c<-19)c=-19;b.nice=c}},__throttle:function(a,c){var b;for(b=0;b<this.stacks_sleeping.length;b++)if(this.stacks_sleeping[b].pid==a)break;if(b>=
this.stacks_sleeping.length){for(b=0;b<this.stacks_running.length;b++)if(this.stacks_running[b].pid==a)break;if(b>=this.stacks_running.length)return null;else b=this.stacks_running[b]}else b=this.stacks_sleeping[b];if(typeof c=="undefined")return b.throttle;else{if(c>1.4)c=1.4;if(c<0.2)c=0.2;b.throttle=c}}};var __jn_old_min_rt=__jn_stacks.min_runtime;
function __jn_wd(){if(__jn_stacks.stacks_running.length>0&&__jn_old_min_rt==__jn_stacks.min_runtime){clearInterval(__jn_stacks.timer_id);__jn_stacks.timer_id=setInterval(function(){__jn_stacks.tick()},__jn_stacks.SET_TIMEOUT)}__jn_old_min_rt=__jn_stacks.min_runtime}
function __ErrorConsole(a){this.id=a?a+": ":"";this.messages=[];this.size=100;var c=this;if(typeof console!="undefined"){if(console.log)this.log2=function(b){console.log(c.id+b)};this.log(this.id+"Registered firebug console as supplementary logging tool; If this is not intended behaviour - change .log2 method ")}}__ErrorConsole.prototype.log=function(a){this.messages.push(a);this.messages.length>this.size&&this.messages.shift();this.log2&&this.log2(a)};
__ErrorConsole.prototype.read=function(){for(var a="",c;c<this.messages.length;c++)a+=this.messages[c];return a};GLOBAL_CODE=0;EVAL_CODE=1;FUNCTION_CODE=2;S_EXEC=3;__MAXARLEN=Math.pow(2,16)+1;
GLOBAL_METHODS={eval:function(a){if(typeof a!="string"){this.cur_stack.my.v0=a;return this.ExecutionContext.current.result=a}var c=this,b=this.ExecutionContext.current,f=new this.ExecutionContext(EVAL_CODE);f.thisObject=b.thisObject;f.caller=b.caller;f.callee=b.callee;f.scope=b.scope;this.ExecutionContext.current=f;this.cur_stack.push(S_EXEC,{v:"v0",n:parse(a),x:f,pmy:this.cur_stack.my.myObj,finally_exec:function(){b.result=f.result;c.ExecutionContext.current=b},throw_exec:function(){b.result=f.result;
c.ExecutionContext.current=b}});b.result=undefined;this.cur_stack.my.v0=undefined},sleep:function(a){var c=__jn_stacks.newId();this.cur_stack.STOP=c;var b=this.cur_stack;setTimeout(function(){if(b.STOP==c){b.STOP=false;__jn_stacks.start(b.pid)}},a)},setTimeout:function(a,c,b){var f=new this.ExecutionContext(FUNCTION_CODE);f.thisObject=this.global;f.caller=null;f.callee=a;var d=this;b=typeof b!="undefined"?Array.prototype.splice.call(b,0,b.length):[];b.callee=a;var g=a.node;f.scope={object:new Activation(g,
b),parent:a.scope};var k=new __Stack(f);k.push(S_EXEC,{n:g.body,x:f,pmy:{}});var h=__jn_stacks.__nice(this.cur_stack.pid);a=setTimeout(function(){__jn_stacks.add_task(d,k,h,d.throttle)},c);this.timeouts[a]=null;this.timeouts.length++;if(this.timeouts.length>5E3){this.ErrorConsole.log("timeouts cache overflow; restart required!!");for(ob in this.timeouts){delete this.timeouts[ob];this.timeouts.length--;break}}return a},start_new_thread:function(a,c){var b=new this.ExecutionContext(FUNCTION_CODE);b.thisObject=
this.global;b.caller=null;b.callee=a;var f=typeof c!="undefined"?Array.prototype.splice.call(c,0,c.length):[];f.callee=a;var d=a.node;b.scope={object:new Activation(d,f),parent:a.scope};f=new __Stack(b);f.push(S_EXEC,{n:d.body,x:b,pmy:{}});b=__jn_stacks.__nice(this.cur_stack.pid);return __jn_stacks.add_task(this,f,b,this.throttle)},clearTimeout:function(a){a in this.timeouts&&clearTimeout(parseInt(a))},setInterval:function(a,c,b){var f=new this.ExecutionContext(FUNCTION_CODE);f.thisObject=this.global;
f.caller=null;f.callee=a;var d=a.node,g=this,k=__jn_stacks.__nice(this.cur_stack.pid);c=setInterval(function(){var h=typeof b!="undefined"?Array.prototype.splice.call(b,0,b.length):[];h.callee=a;f.scope={object:new Activation(d,h),parent:a.scope};h=new __Stack(f);h.push(S_EXEC,{n:d.body,x:f,pmy:{}});__jn_stacks.add_task(g,h,k,g.throttle)},c);this.timeouts[c]=null;this.timeouts.length++;if(this.timeouts.length>5E3){this.ErrorConsole.log("timeouts cache overflow; restart required!!");for(ob in this.timeouts){delete this.timeouts[ob];
this.timeouts.length--;break}}return c},clearInterval:function(a){a in this.timeouts&&clearInterval(a)},load:function(a){this.cur_stack.EXCEPTION=false;this.cur_stack.my.v0=undefined;var c=__jn_stacks.newId();this.cur_stack.STOP=c;var b=this.cur_stack,f=this;setTimeout(function(){if(b.STOP==c){b.EXCEPTION=THROW;var g=new f.global.InternalError("load( '"+a+"' ): fetch failed with timeout");g.status="timeout";b.exc.result=g;b.STOP=false;__jn_stacks.start(b.pid)}},this.AJAX_TIMEOUT);var d=new DataRequestor;
d.onload=function(g){if(b.STOP==c){try{var k=parse(g,a,0);b.push(S_EXEC,{n:k,x:b.exc,pmy:{}})}catch(h){b.EXCEPTION=THROW;b.exc.result=h}b.STOP=false;__jn_stacks.start(b.pid)}};d.onfail=function(g){if(b.STOP==c){b.EXCEPTION=THROW;var k=new f.global.InternalError("load('"+a+"') failed with status: "+g);k.status=g;b.exc.result=k;b.STOP=false;__jn_stacks.start(b.pid)}};d.getURL(a)},compile:function(a,c){this.cur_stack.my.v0=undefined;var b=this.cur_stack,f=b.my.x2;this.cur_stack.EXCEPTION=false;var d=
__jn_stacks.newId();this.cur_stack.STOP=d;var g=function(l){if(b.STOP==d){b.EXCEPTION=THROW;b.EXCEPTION_OBJ=l;b.exc.result=l;b.STOP=false;__jn_stacks.start(b.pid)}};try{var k=parse(a,c,0)}catch(h){g(h)}objj(k,function(l){if(b.STOP==d){f.result=JSON.stringify(l);b.EXCEPTION=RETURN;b.STOP=false;__jn_stacks.start(b.pid)}},g)},fetchUrl:function(a,c,b,f){this.cur_stack.my.v0=undefined;var d=this.cur_stack,g=d.my.x2,k=this;if(typeof f=="undefined")f=_POST;if(typeof b=="undefined"||b==null||!(b instanceof
this.FunctionObject)){this.cur_stack.EXCEPTION=false;var h=__jn_stacks.newId();this.cur_stack.STOP=h;var l=function(){if(d.STOP==h){d.EXCEPTION=THROW;var p=new k.global.InternalError("url fetch ("+a+") failed with timeout");p.status="timeout";d.exc.result=p;d.STOP=false;__jn_stacks.start(d.pid)}},m=setTimeout(l,this.AJAX_TIMEOUT);l=function(p){clearTimeout(m);if(d.STOP==h){g.result=p;d.EXCEPTION=RETURN;d.STOP=false;__jn_stacks.start(d.pid)}};var q=function(p){clearTimeout(m);if(d.STOP==h){d.EXCEPTION=
THROW;var n=new k.global.InternalError("url fetch ("+a+") failed with status: "+p);n.status=p;d.exc.result=n;d.STOP=false;__jn_stacks.start(d.pid)}}}else{l=function(){this.ErrorConsole.log("url fetch ("+a+") failed with timeout")};m=setTimeout(l,this.AJAX_TIMEOUT);l=function(p){clearTimeout(m);this.global.start_new_thread(b,[p])};q=function(p,n){this.ErrorConsole.log("url fetch ("+a+") failed with status: "+p);clearTimeout(m);this.global.start_new_thread(b,[null,p,n])}}var s=new DataRequestor,o;if(typeof c!=
"undefined")for(o in c)o.substr(0,3)!="___"&&s.addArg(f,o,c[o]);s.onload=l;s.onfail=q;s.getURL(a)},nice:function(a){if(typeof a=="undefined")return __jn_stacks.__nice(this.cur_stack.pid);a=parseInt(a);if(isNaN(a))throw new this.global.InternalError("nice() argument must be a number");if(a<0&&!this.GRANTED)throw new this.global.SecurityError("setting negative nice increment is not allowed");var c=__jn_stacks.__nice(this.cur_stack.pid);__jn_stacks.__nice(this.cur_stack.pid,c+a)},throttle:function(a){if(typeof a==
"undefined")return __jn_stacks.__throttle(this.cur_stack.pid);a=parseFloat(a);if(isNaN(a))throw new this.global.InternalError("throttle() argument must be a number");if(a>1&&!this.GRANTED)throw new this.global.SecurityError("setting process throttle > 1 is not allowed");__jn_stacks.__throttle(this.cur_stack.pid,a)}};
LOCK_PROTOTYPE={acquire:function(a,c){c=c||true;if(this.goflag>0){--this.goflag;return true}else if(c){var b=__jn_stacks.newId();a.cur_stack.STOP=b;var f=a.cur_stack;f.EXCEPTION=false;this.___wait_queue.push({cs:f,stop:b})}else return false},release:function(a,c){if(!c&&this.goflag>0){a.cur_stack.EXCEPTION=THROW;a.cur_stack.exc.result=new a.global.Error("release unlocked lock")}var b=this.___wait_queue.shift();if(b){if(b.cs){if(b.cs.STOP!=b.stop){a.ErrorConsole.log("Lock: ASSERT! tried to release stack with foregin block!");
return}b.cs.STOP=false;b.cs.EXCEPTION=RETURN;b.cs.my.x2.result=true;__jn_stacks.start(b.cs.pid)}b.callback&&b.callback()}else this.goflag=1},check:function(){if(this.goflag>0)return false;return true}};
FUNCTIONOBJECT_PROTOTYPE={_call:function(a,c,b,f,d){var g=new a.ExecutionContext(FUNCTION_CODE);g.thisObject=c||a.global;g.caller=f;g.callee=this;b.callee=this;c=this.node;g.scope={object:new Activation(c,b),parent:this.scope};a.ExecutionContext.current=g;d.my.oldx=f;d.my.x2=g;d.push(S_EXEC,{v:"v0",n:c.body,x:g,oldx:f,pmy:d.my.myObj})},construct:function(a,c,b){if(isObject(this.prototype)){__F.prototype=this.prototype;var f=new __F}else f={};b.my.o=f;this.___call___(f,a,c,b)},hasInstance:function(a){if(isPrimitive(a))return false;
var c=this.prototype;if(isPrimitive(c)){c=new TypeError("'prototype' property is not an object",this.node.filename,this.node.lineno);c.___jeneric_err=true;c.lineNumber=this.node.lineno;c.fileName=this.node.filename;throw c;}for(;a=a.__proto__;){if(a==c)return true;a=a}return false},apply:function(a,c,b){if(typeof this.___call___!="function"){a=new TypeError("Function.prototype.apply called on uncallable object");a.___jeneric_err=true;throw a;}if(c===undefined||c===null)c=a.global;else if(typeof c!=
"object")c=a.toObject(c,c);if(b===undefined||b===null){b={};b.length=0}else if(b instanceof Array){for(var f={},d=0,g=b.length;d<g;d++)f[d]=b[d];f.length=d;b=f}else if(!(b instanceof Object)){a=new TypeError("Second argument to Function.prototype.apply must be an array or arguments object",this.node.filename,this.node.lineno);a.___jeneric_err=true;a.lineNumber=this.node.lineno;a.fileName=this.node.filename;throw a;}a.cur_stack.EXCEPTION&&a.cur_stack.EXCEPTION==RETURN&&delete a.cur_stack.EXCEPTION;
return this.___call___(c,b,a.ExecutionContext.current,a.cur_stack)}};
function Jnaric(){this.STEP_TIMEOUT=1;this.STACKSIZE=1E4;this.MAX_THREADS=50;this.GRANTED=false;this.ErrorConsole=new __ErrorConsole;this._load_stack=[];this.ERROR_ONFINISH=false;this.AJAX_TIMEOUT=2E4;this.nice=0;this.throttle=1;this.idsource=0;this.timeouts={length:0};var a=this;this.VERSION="ratbird kernel 0.1 alpha";if(window.JENERIC_BUILD)this.VERSION+=" BUILD "+JENERIC_BUILD;this.FunctionObject=function(c,b){this.node=c;this.scope=b;this.length=c.params.length;var f={};this.prototype=f;f.constructor=
this};this.FOp=this.FunctionObject.prototype={___call___:function(c,b,f,d){return FUNCTIONOBJECT_PROTOTYPE._call.call(this,a,c,b,f,d)},___construct___:FUNCTIONOBJECT_PROTOTYPE.construct,___hasInstance___:FUNCTIONOBJECT_PROTOTYPE.hasInstance,toString:function(){return this.node.getSource?this.node.getSource():"[jeneric compiled FunctionObject]"},apply:function(c,b){return FUNCTIONOBJECT_PROTOTYPE.apply.call(this,a,c,b)},call:function(c){var b=Array.prototype.splice.call(arguments,1,arguments.length);
return this.apply(c,b)}};this.global_bak=this.global=this.createGlobal();this.ExecutionContext=function(c){this.type=c;this.MARK=43431353};this.XCp=this.ExecutionContext.prototype;this.ExecutionContext.current=this.XCp.caller=this.XCp.callee=null;this.XCp.scope={object:this.global,parent:null};this.XCp.thisObject=this.global;this.XCp.result=undefined;this.XCp.target=null;this.XCp.ecmaStrictMode=false;this.glo_exc=new this.ExecutionContext(GLOBAL_CODE);this.ExecutionContext.current=this.glo_exc;this.g_stack=
new __Stack(this.ExecutionContext.current)}
Jnaric.prototype.createGlobal=function(){var a=this,c={ErrorConsole:a.ErrorConsole,console:a.ErrorConsole,_FETCH_GET:1,_FETCH_POST:0,NaN:NaN,Infinity:Infinity,undefined:undefined,parseInt:parseInt,parseFloat:parseFloat,isNaN:isNaN,isFinite:isFinite,decodeURI:decodeURI,encodeURI:encodeURI,decodeURIComponent:decodeURIComponent,encodeURIComponent:encodeURIComponent,escape:escape,unescape:unescape,Object:Object,Function:function(){var f="",d="",g=arguments.length;if(g){if(g=g-1){f+=arguments[0];for(var k=
1;k<g;k++)f+=","+arguments[k]}d+=arguments[g]}f=new Tokenizer("anonymous("+f+") {"+d+"}");f=FunctionDefinition(f,null,false,STATEMENT_FORM);return new a.FunctionObject(f,{object:a.global,parent:null})},Array:function(){if(arguments.length>__MAXARLEN)throw new a.global.InternalError("script stack space quota is exhausted");return GLOBAL.Array.apply(this,arguments)},String:function f(d){d=arguments.length?""+d:"";if(this instanceof f){this.value=d;return this}return d},Boolean:Boolean,Number:Number,
Date:Date,RegExp:RegExp,Error:Error,EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError,InternalError:function(f){this.message=f;this.name="InternalError";this.toString=function(){return"InternalError: "+this.message}},SecurityError:function(f){this.message=f;this.name="SecurityError";this.toString=function(){return"SecurityError: "+this.message}},Math:{LN2:Math.LN2,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,
LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,toSource:Math.toSource},Lock:function(){this.goflag=1;this.___wait_queue=[]},eval:function(f){return GLOBAL_METHODS.eval.call(a,f)},sleep:function(f){return GLOBAL_METHODS.sleep.call(a,
f)},setTimeout:function(f,d,g){return GLOBAL_METHODS.setTimeout.call(a,f,d,g)},start_new_thread:function(f,d){return GLOBAL_METHODS.start_new_thread.call(a,f,d)},clearTimeout:function(f){return GLOBAL_METHODS.clearTimeout.call(a,f)},setInterval:function(f,d,g){return GLOBAL_METHODS.setInterval.call(a,f,d,g)},clearInterval:function(f){return GLOBAL_METHODS.clearInterval.call(a,f)},load:function(f){return GLOBAL_METHODS.load.call(a,f)},fetchUrl:function(f,d,g,k){return GLOBAL_METHODS.fetchUrl.call(a,
f,d,g,k)},compile:function(f,d){return GLOBAL_METHODS.compile.call(a,f,d)},nice:function(f){return GLOBAL_METHODS.nice.call(a,f)},throttle:function(f){return GLOBAL_METHODS.throttle.call(a,f)},__get_max_threads:function(){return a.MAX_THREADS},version:a.VERSION};c.Lock.prototype.acquire=function(f){return LOCK_PROTOTYPE.acquire.call(this,a,f)};c.Lock.prototype.release=function(f){return LOCK_PROTOTYPE.release.call(this,a,f)};c.Lock.prototype.check=function(){return LOCK_PROTOTYPE.check.call(this)};
this.reflectClass2(c,"Array",[]);var b=this.reflectClass2(c,"String",new String);b.toSource=function(){return this.value.toSource()};b.toString=function(){return this.value};b.valueOf=function(){return this.value};c.String.fromCharCode=String.fromCharCode;this.reflectClass2(c,"Function",this.FOp);return c};Jnaric.prototype.reflectClass=function(a,c){var b=this.global[a];b.prototype=c;c.constructor=b;return c};Jnaric.prototype.reflectClass2=function(a,c,b){a=a[c];a.prototype=b;b.constructor=a;return b};
Jnaric.prototype.bind_scope=function(a){a={object:a,parent:null};this.ExecutionContext.prototype.scope.parent=a;this.glo_exc.scope.parent=a;this.global.alert=function(c){alert(c)}};
Jnaric.prototype.putValue=function(a,c,b){if(a instanceof Reference){if(a.base&&a.base.___call___&&a.propertyName=="__proto__"){a=new this.global.InternalError("Setting of __proto__ on functionObject is not supported");a.___jeneric_err=true;throw a;}if(a.propertyName.substr(0,3)=="___")throw new this.global.InternalError("triple underscore is reserved");if(a.base&&a.base.___setters&&a.base.___setters.hasOwnProperty(a.propertyName)){if(a.base.___setters[a.propertyName]==1){a=new TypeError("setting a property that has only a getter",
b.filename,b.lineno);a.lineNumber=b.lineno;a.fileName=b.filename;a.___jeneric_err=true;throw a;}return a.base.___setters[a.propertyName].apply(a.base,[a.propertyName,c])}return(a.base||this.global)[a.propertyName]=c}a=new ReferenceError("Invalid assignment left-hand side",b.filename,b.lineno);a.___jeneric_err=true;throw a;};
Jnaric.prototype.getValue=function(a){if(a instanceof Reference){if(!a.base){var c=new ReferenceError(a.propertyName+" is not defined",a.node.filename,a.node.lineno);c.___jeneric_err=true;c.lineNumber=a.node.lineno;c.fileName=a.node.filename;throw c;}if(a.propertyName.substr(0,3)=="___")throw new this.global.InternalError("triple underscore is reserved");if(a.base.___getters&&a.base.___getters.hasOwnProperty(a.propertyName))return a.base.___getters[a.propertyName].apply(a.base,[a.propertyName]);return a.base[a.propertyName]}return a};
Jnaric.prototype.toObject=function(a,c,b){switch(typeof a){case "boolean":return new this.global.Boolean(a);case "number":return new this.global.Number(a);case "string":if(_isFF)return new this.global.String(a);b=new this.global.String(a);a=new String(a);for(var f in b)a[f]=b[f];return a;case "function":return a;case "object":if(a!==null)return a}f=c+" (type "+typeof a+") has no properties";f=b?new TypeError(f,b.filename,b.lineno):new TypeError(f);f.___jeneric_err=true;f.lineNumber=b.lineno;f.fileName=
b.filename;throw f;};Jnaric.prototype.__abort=function(){this._load_stack=[];this.g_stack.stack=[];this.onfinish=null;for(var a in this.timeouts){clearTimeout(parseInt(a));clearInterval(parseInt(a))}};Jnaric.prototype.load=function(a){this._load_stack.unshift(a);this._load_stack.length==1&&this.__load_next()};
Jnaric.prototype.__load_next=function(){var a=new DataRequestor,c=this._load_stack[this._load_stack.length-1],b=this;a.onload=function(f){DEBUG>2&&b.ErrorConsole.log(".load(): evaluating text of length "+f.length);try{b.evaluate(f,c)}catch(d){b.ErrorConsole.log("Parse of file "+c+" failed: "+d+" Line: "+d.lineNumber+" File: "+d.fileName);try{b.onerror&&b.onerror(d)}catch(g){b.ErrorConsole.log(".onerror event failed to execute with exception: "+g)}}finally{b._load_stack.pop();b._load_stack.length&&
b.__load_next()}};a.onfail=function(f){b.ErrorConsole.log(".load('"+c+"') failed with status: "+f);b._load_stack.pop();b._load_stack.length&&b.__load_next()};DEBUG>2&&this.ErrorConsole.log(".load(): requesting url: "+c);a.getURL(c)};function hasDirectProperty(a,c){return Object.prototype.hasOwnProperty.call(a,c)}function Reference(a,c,b){this.base=a;this.propertyName=c;this.node=b}Reference.prototype.toString=function(){return this.node.getSource?this.node.getSource():"[ jeneric compiled Reference ]"};
function isPrimitive(a){var c=typeof a;return c=="object"?a===null:c!="function"}function isObject(a){var c=typeof a;return c=="object"?a!==null:c=="function"}
function say_type(a){switch(a){case FUNCTION:v="FUNCTION";break;case SCRIPT:return"SCRIPT";case BLOCK:return"BLOCK";case IF:return"IF";case SWITCH:return"SWITCH";case FOR:return"FOR";case WHILE:return"WHILE";case FOR_IN:return"FOR_IN";case DO:return"DO";case BREAK:return"BREAK";case CONTINUE:return"CONTINUE";case TRY:return"TRY";case THROW:return"THROW";case RETURN:return"RETURN";case WITH:return"WITH";case VAR:return"VAR";case CONST:return"CONST";case DEBUGGER:return"DEBUG";case SEMICOLON:return"SEMICOLON";
case LABEL:return"LABEL";case COMMA:return"COMMA";case ASSIGN:return"ASSIGN";case HOOK:return"HOOK";case OR:return"OR";case AND:return"AND";case BITWISE_OR:return"BITWISE_OR";case BITWISE_XOR:return"BITWISE_XOR";case BITWISE_AND:return"BITWISE_AND";case EQ:return"EQ";case NE:return"NE";case STRICT_EQ:return"STRICT_EQ";case STRICT_NE:return"STRICT_NE";case LT:return"LT";case LE:return"LE";case GE:return"GE";case GT:return"GT";case IN:return"IN";case INSTANCEOF:return"INSTANCEOF";case LSH:return"LSH";
case RSH:return"RSH";case URSH:return"URSH";case PLUS:return"PLUS";case MINUS:return"MINUS";case MUL:return"MUL";case DIV:return"DIV";case MOD:return"MOD";case DELETE:return"DELETE";case VOID:return"VOID";case TYPEOF:return"TYPEOF";case NOT:return"NOT";case BITWISE_NOT:return"BITWISE_NOT";case UNARY_PLUS:return"UNARY_PLUS";case UNARY_MINUS:return"UNARY_MINUS";case INCREMENT:return"INCREMENT";case DECREMENT:return"DECREMENT";case DOT:return"DOT";case INDEX:return"INDEX";case LIST:return"LIST";case CALL:return"CALL";
case NEW:return"NEW";case NEW_WITH_ARGS:return"NEW_WITH_ARGS";case ARRAY_INIT:return"ARRAY_INIT";case OBJECT_INIT:return"OBJECT_INIT";case NULL:return"NULL";case THIS:return"THIS";case TRUE:return"TRUE";case FALSE:return"FALSE";case IDENTIFIER:return"IDENTIFIER";case NUMBER:return"NUMBER";case STRING:return"STRING";case REGEXP:return"REGEXP";case GROUP:return"GROUP";default:return"PANIC: unknown operation "+a}return v}
__Stack=function(a){this.my={};this.stack=[];this.exc=a;this.e_stack=[];this.object_prototype={}};__Stack.prototype.push=function(a,c){this.stack.push(c)};
Jnaric.prototype.step_next=function(a){var c,b;c=a.stack[a.stack.length-1];if(!c)return false;var f=a.e_stack;a.my=c;for(a.my.myObj=c;c.done;){if(DEBUG>5){for(var d="",g=0;g<a.stack.length;g++)d+="x";this.ErrorConsole.log(d+"  -- done, popping: "+say_type(a.stack[a.stack.length-1].n.type)+" "+(a.stack[a.stack.length-1].TRY_WAIT?"TRY_WAIT":""))}a.EXCEPTION||a.stack.pop();if(a.stack.length==0){if(this.onfinish&&a===this.g_stack){if(this._load_stack.length==0){DEBUG&&DEBUG>3&&this.ErrorConsole.log("Firing onfinish event!");
try{this.onfinish(c.x.result)}catch(k){this.ErrorConsole.log(".onfinish event failed to execute with exception: "+k)}}}else if(a.onfinish){this.DEBUG&&this.DEBUG>3&&this.ErrorConsole.log("Firing onfinish event on stack!");try{a.onfinish(c.x.result)}catch(h){this.ErrorConsole.log("stack .onfinish event failed to execute with exception: "+h)}}return false}c=a.stack[a.stack.length-1];a.my=c;a.my.myObj=c}if(DEBUG>5){d="";for(g=0;g<a.stack.length;g++)d+="x";this.ErrorConsole.log(d+" Diving in: "+say_type(c.n.type)+
" Executor:"+(c.Nodes?say_type(c.Nodes.type):"--")+(a.EXCEPTION?" Exception: "+a.EXCEPTION:"")+(a.EXCEPTION_OBJ&&a.EXCEPTION?" obj: "+a.EXCEPTION_OBJ:""))}try{b=this.step_execute(c.n,c.x,a)}catch(l){if(l.message&&(l.message.toString().indexOf("JNARIC")>=0||l.message.toString()=="allocation size overflow")||l instanceof this.global.InternalError||l.___jeneric_err){c.x.result=l;a.EXCEPTION=THROW;a.EXCEPTION_OBJ=l}else{this.ErrorConsole.log("vm error: throwing exception '"+l.toString()+"' "+(l.message?
l.message+": ":"")+(l.message?l.message:"")+"' Stack trace: "+__print_strace(a)+" Browser .lineNumber:"+l.lineNumber+" .fileName: "+l.fileName+" .stack: "+l.stack);if(l.toString()=="[object Object]"){this.ErrorConsole.log("dumb exception obect found; inspecting object to get more information:");c="";for(var m in l)c=c+m+"="+l[m]+"; ";this.ErrorConsole.log(c)}delete a.EXCEPTION;do f.push(a.stack.pop());while(a.stack.length!=0);try{this.onerror&&this.onerror(l)}catch(q){this.ErrorConsole.log(".onerror event failed to execute with exception: "+
q)}try{a.onerror&&a.onerror(l)}catch(s){this.ErrorConsole.log("stack .onerror event failed to execute with exception: "+s)}if(this.ERROR_ONFINISH&&a===this.g_stack)try{this.onfinish&&this.onfinish()}catch(o){this.ErrorConsole.log(".onfinish(error) event failed to execute with exception: "+o)}throw l;}}if(a.stack.length>this.STACKSIZE){m=new this.global.InternalError("too much recursion");c.x.result=m;a.EXCEPTION=THROW}if(c.done){if("e"in c){if(DEBUG>4)try{this.ErrorConsole.log(d+"  -- setting exec: "+
c.e+"("+b+") on "+(c.Nodes?say_type(c.Nodes.type):"--"))}catch(p){this.ErrorConsole.log(d+"  -- setting exec: "+c.e+"(can't convert) on "+(c.Nodes?say_type(c.Nodes.type):"--"))}c.pmy[c.e]=b}if("v"in c){if(DEBUG>4)try{this.ErrorConsole.log(d+"  -- setting exec(v): "+c.v+"("+this.getValue(b)+") on "+(c.Nodes?say_type(c.Nodes.type):"--"))}catch(n){this.ErrorConsole.log(d+"  -- setting exec(v): "+c.v+"(can't convert) on "+(c.Nodes?say_type(c.Nodes.type):"--"))}try{c.pmy[c.v]=this.getValue(b)}catch(r){if(r instanceof
ReferenceError){c.x.result=r;a.EXCEPTION=THROW;a.EXCEPTION_OBJ=r}else throw r;}}c.finally_exec&&c.finally_exec()}if(a.EXCEPTION){c.finally_exec&&c.finally_exec();c.EXCEPTION==THROW&&c.throw_exec&&c.throw_exec();DEBUG>4&&this.ErrorConsole.log("-- catch procedure started, next dive into TRY_WAIT or break the stack;");do{b=a.stack.pop();b.finally_exec&&b.finally_exec();b.EXCEPTION==THROW&&b.throw_exec&&b.throw_exec();b.n.type!=TRUE&&f.push(b)}while(!(a.stack.length==0||a.stack[a.stack.length-1].TRY_WAIT))}else f=
[];if(a.stack.length>0)return true;else{if(a.EXCEPTION&&a.EXCEPTION!=RETURN){delete a.EXCEPTION;if(a.EXCEPTION_OBJ){c=a.EXCEPTION_OBJ;delete a.EXCEPTION_OBJ}else c=c.x.result;if(c&&c.name)this.ErrorConsole.log("Exception in "+this.uri+" ... "+c.name+" '"+c.message+" ("+c.result+") Line: "+c.lineNumber+" File: "+c.fileName+"' Stack trace: "+__print_strace(f));else if(c&&c.toString instanceof this.FunctionObject){var w=null;if(this.onfinish&&a===this.g_stack&&this._load_stack.length==0){w=this.onfinish;
this.onfinish=null}var u=this,y=f;this.global.__jn_exception_obj=c;f=parse(' try { __jn_exception_string = __jn_exception_obj.toString(); } catch (e) { __jn_exception_string = "uncaught exception (could not convert to String, an exception occurred: "+e+")"; } ',"uncaught_exception_parser",0);a.stack.push({n:f,x:a.exc,pmy:{},finally_exec:function(){u.ErrorConsole.log("DEBG: exception conversion finished");u.ErrorConsole.log("Parsed exception ... "+u.global.__jn_exception_string+" Stack trace: "+__print_strace(y));
w&&w(u.global.__jn_exception_string)}});this.ErrorConsole.log("DEBG: doing exception conversion...");__jn_stacks.add_task(this,a)}else this.ErrorConsole.log("Uncaught exception in "+this.uri+" ... "+c+"' Stack trace: "+__print_strace(f));try{this.onerror&&this.onerror(c)}catch(x){this.ErrorConsole.log(".onerror event failed to execute with exception: "+x)}try{a.onerror&&a.onerror(c)}catch(A){this.ErrorConsole.log("stack .onerror event failed to execute with exception: "+A)}if(this.ERROR_ONFINISH&&
a===this.g_stack)try{this.onfinish&&this.onfinish(c)}catch(z){this.ErrorConsole.log(".onfinish(error) event failed to execute with exception: "+z)}}else if(this.onfinish&&a===this.g_stack){if(this._load_stack.length==0){DEBUG&&DEBUG>3&&this.ErrorConsole.log("Firing onfinish event!");try{this.onfinish(c.x.result)}catch(C){this.ErrorConsole.log(".onfinish event failed to execute with exception: "+C)}}}else if(a.onfinish){this.DEBUG&&this.DEBUG>3&&this.ErrorConsole.log("Firing onfinish event!");try{a.onfinish(c.x.result)}catch(E){this.ErrorConsole.log("stack .onfinish event failed to execute with exception: "+
E+" Message: "+E.message+" file: "+E.fileName+" line: "+E.lineNumber)}}return false}};
function __print_strace(a){var c="",b;if(a.stack)for(var f=a.stack.length-TRACE_DEPTH<0?0:a.stack.length-TRACE_DEPTH;f<a.stack.length;f++){b=a.stack[f];c=b.n?c+" >"+say_type(b.n.type)+"("+(b.n.type!=RETURN?b.n.v:"?")+") File: "+b.n.filename+" Line: "+b.n.lineno+";":c+" INTERNAL ERROR: node not defined at "+f+";"}else for(f=a.length-1>TRACE_DEPTH?TRACE_DEPTH:a.length-1;f>=0;f--){b=a[f];c=b.n?c+" >"+say_type(b.n.type)+"("+(b.n.type!=RETURN?b.n.v:"?")+") File: "+b.n.filename+" Line: "+b.n.lineno+";":
c+" INTERNAL ERROR: node not defined at "+f+";"}return c}
Jnaric.prototype.step_execute=function(a,c,b){var f,d,g,k,h,l,m;switch(a.type){case FUNCTION:if(a.functionForm!=DECLARED_FORM)if(!a.name||a.functionForm==STATEMENT_FORM){m=new this.FunctionObject(a,c.scope);if(a.functionForm==STATEMENT_FORM)c.scope.object[a.name]=m}else{g={};c.scope={object:g,parent:c.scope};try{m=new this.FunctionObject(a,c.scope);g[a.name]=m}finally{c.scope=c.scope.parent}}b.my.done=true;break;case SCRIPT:if(!("t"in b.my)){b.my.t=c.scope.object;f=a.fD;g=0;for(k=f.length;g<k;g++){l=
f[g].name;d=new this.FunctionObject(f[g],c.scope);b.my.t[l]=d}f=a.vD;g=0;for(k=f.length;g<k;g++){h=f[g];l=h.name;if(h.readOnly&&hasDirectProperty(b.my.t,l)){c.result=TypeError("Redeclaration of const "+l,h.filename,h.lineno);b.EXCEPTION=THROW;break}if(h.readOnly||!hasDirectProperty(b.my.t,l))b.my.t[l]=undefined}}case BLOCK:if(!("i"in b.my))b.my.i=0;b.my.j=a.length||0;if(b.my.i<b.my.j){b.push(S_EXEC,{n:a[b.my.i],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.i+=1}else b.my.done=true;break;case IF:if("v1"in
b.my)if(b.my.v1){b.push(S_EXEC,{n:a.tP,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.done=true}else{if(a.elsePart){b.push(S_EXEC,{n:a.elsePart,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.done=true}}else{b.push(S_EXEC,{v:"v1",n:a.c,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case SWITCH:if(!("s"in b.my)){b.push(S_EXEC,{v:"s",n:a.discriminant,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.looping=false;b.my.matchDefault=false;break}l=b.my.s;f=
a.cases;if(!("i"in b.my))b.my.i=0;k=f.length;if(b.my.i==k&&!b.my.looping){if(a.defaultIndex>=0){b.my.i=a.defaultIndex-1;b.my.matchDefault=true;b.my.i++;delete b.my.u;break}b.my.done=true;break}if(!b.my.looping){b.my.t=f[b.my.i];if(b.my.t.type==CASE){if(!("u"in b.my)){b.push(S_EXEC,{v:"u",n:b.my.t.caseLabel,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}}else{if(!b.my.matchDefault){b.my.i++;delete b.my.u;break}b.my.u=l}}if(b.my.u===l||b.my.looping){b.my.looping=true;if(b.my.t.statements.length)if("v2"in
b.my||b.EXCEPTION){if(b.EXCEPTION){if(b.EXCEPTION==BREAK&&c.target==a){b.EXCEPTION=false;b.my.TRY_WAIT=false;b.my.i=0;b.my.looping=false;delete b.my.u;"v2"in b.my&&delete b.my.v2;b.my.done=true}break}delete b.my.v2}else{b.push(S_EXEC,{v:"v2",n:b.my.t.statements,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;break}if(++b.my.i==k){b.my.i=0;b.my.looping=false;delete b.my.u;if(b.my.matchDefault)b.my.done=true;break}b.my.t=f[b.my.i];break}b.my.i++;delete b.my.u;break;case FOR:if(a.setup&&
!("uu"in b.my)){b.push(S_EXEC,{v:"uu",n:a.setup,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}case WHILE:if(!("lastnc"in b.my))b.my.lastnc=0;if(!("get0_step"in b.my))b.my.get0_step=true;if(b.my.get0_step)if(a.c){b.push(S_EXEC,{v:"wv",n:a.c,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.get0_step=false;break}else b.my.wv=true;if(a.c&&!b.my.wv){b.my.done=true;break}if("v2"in b.my||b.EXCEPTION){if(b.EXCEPTION)if(b.EXCEPTION==CONTINUE&&c.target==a){b.EXCEPTION=false;b.my.TRY_WAIT=false;
delete b.my.v2}else{if(b.EXCEPTION==BREAK&&c.target==a){b.EXCEPTION=false;b.my.TRY_WAIT=false;b.my.done=true}break}delete b.my.v2;delete b.my.wv;b.my.get0_step=true}else{b.push(S_EXEC,{v:"v2",n:a.body,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;break}a.update&&b.push(S_EXEC,{n:a.update,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break;case FOR_IN:h=a.varDecl;if(!("uu"in b.my)&&h){b.push(S_EXEC,{v:"uu",n:h,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}h=a.iterator;
if(!("v0"in b.my)){b.push(S_EXEC,{v:"v0",e:"s",n:a.object,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.i=0;break}if(!("t"in b.my))b.my.t=b.my.v0==null&&!c.ecmaStrictMode?b.my.v0:this.toObject(b.my.v0,b.my.s,a.object);if(!("a"in b.my)){b.my.a=[];for(g in b.my.t)g.substr(0,3)!="___"&&b.my.a.push(g)}k=b.my.a.length;if(b.my.i>=k){b.my.done=true;break}if(!("sres"in b.my)){b.push(S_EXEC,{e:"sres",n:h,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.vput=false;break}if(!b.my.vput){this.putValue(b.my.sres,
b.my.a[b.my.i],h);b.my.vput=true}if("v2"in b.my||b.EXCEPTION){if(b.EXCEPTION){if(b.EXCEPTION==CONTINUE&&c.target==a){b.EXCEPTION=false;b.my.TRY_WAIT=false;delete b.my.v2;delete b.my.sres;b.my.i++}else if(b.EXCEPTION==BREAK&&c.target==a){b.EXCEPTION=false;b.my.TRY_WAIT=false;b.my.done=true}break}b.my.i++;delete b.my.sres;delete b.my.v2}else{b.push(S_EXEC,{v:"v2",n:a.body,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;break}break;case DO:if("v2"in b.my||b.EXCEPTION){if(b.EXCEPTION){if(b.EXCEPTION==
CONTINUE&&c.target==a){b.EXCEPTION=false;b.my.TRY_WAIT=false;delete b.my.v2}else if(b.EXCEPTION==BREAK&&c.target==a){b.EXCEPTION=false;b.my.TRY_WAIT=false;b.my.done=true}break}}else{b.push(S_EXEC,{v:"v2",n:a.body,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;break}if(!("condx"in b.my)){b.push(S_EXEC,{v:"condx",n:a.c,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}if(!b.my.condx)b.my.done=true;delete b.my.condx;delete b.my.v2;break;case BREAK:case CONTINUE:c.target=a.target;
b.EXCEPTION=a.type;b.my.done=true;break;case TRY:if("v2"in b.my||b.my.loop||b.EXCEPTION){if(!b.my.v2)b.my.v2="shit";this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+"value okay or loop or ex");if(b.EXCEPTION||b.my.loop){this.DEBUG>3&&this.ErrorConsole.log("ex or loop: ex: "+b.EXCEPTION+" e: "+c.result);if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}if(b.EXCEPTION==THROW&&(k=a.catchClauses.length)||b.my.loop&&(k=a.catchClauses.length)){this.DEBUG>3&&this.ErrorConsole.log("ex = throw!!:"+
b.EXCEPTION+":"+(b.EXCEPTION==THROW));if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}if(!("i"in b.my))b.my.i=0;g=a.catchClauses[b.my.i];if(!b.my.reach2try){if(!("eee"in b.my)){b.my.eee=c.result;this.DEBUG>3&&this.ErrorConsole.log("x.result done")}c.result=undefined;if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}if(!b.my.ex1caught){this.DEBUG>3&&this.ErrorConsole.log("EX=false; caught1 true");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}b.my.ex1caught=
true;b.EXCEPTION=false;b.my.TRY_WAIT=false}if(b.my.i==k){this.DEBUG>3&&this.ErrorConsole.log("i = j!! throw again!!! blin!!!");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}b.my.loop=false;delete b.EXCEPTION;b.my.savedException=THROW;b.my.savedResult=b.my.eee;break}b.my.loop=true;this.DEBUG>3&&this.ErrorConsole.log("loop setup ok; scope setup done");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}c.scope={object:{},parent:c.scope};c.scope.object[g.varName]=
b.my.eee}if(g.guard&&!b.my.ex2caught){b.my.ex2caught=true;this.DEBUG>3&&this.ErrorConsole.log("t guard");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}if("v3"in b.my||b.EXCEPTION){DEBUG=0;this.DEBUG>3&&this.ErrorConsole.log("v3 there or ex");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}if(!b.my.ex2caught){b.my.ex2caught=true;b.my.TRY_WAIT=false;this.DEBUG>3&&this.ErrorConsole.log("ex2 caught (not caught!)");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);
this.ErrorConsole.log(h)}}if(!b.my.v3&&!b.EXCEPTION){this.DEBUG>3&&this.ErrorConsole.log("emulating continue! scope back...");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}delete b.my.v3;b.my.ex2caught=false;b.my.reach2try=false;b.my.i++;c.scope=c.scope.parent;break}if(b.EXCEPTION){this.DEBUG>3&&this.ErrorConsole.log("finally in t.guard... scope back");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}c.scope=c.scope.parent;b.my.savedException=b.EXCEPTION;
b.my.savedResult=c.result;delete b.EXCEPTION;b.my.loop=false;break}}else{b.push(S_EXEC,{v:"v3",n:g.guard,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;b.my.reach2try=true;b.my.ex2caught=false;this.DEBUG>3&&this.ErrorConsole.log("requesting v3");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}break}}if("v4"in b.my||b.EXCEPTION){this.DEBUG>3&&this.ErrorConsole.log("v4 there or ex, ex: "+b.EXCEPTION);if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}if(!b.my.ex3caught){this.DEBUG>
3&&this.ErrorConsole.log(b.stack.length+"ex3caught yo");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}b.my.ex3caught=true;b.my.TRY_WAIT=false}if(b.EXCEPTION){this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+"finally in v4... scope back");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}c.scope=c.scope.parent;b.my.savedException=b.EXCEPTION;b.my.savedResult=c.result;delete b.EXCEPTION;b.my.loop=false}else{this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+
"break the loop and exit (BREAK)");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}b.my.loop=false;b.my.i=0;b.my.reach2try=false;this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+"... scope back");c.scope=c.scope.parent}}else{this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+"requesting v4 (last try block)");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}b.push(S_EXEC,{v:"v4",n:g.block,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=
true;b.my.reach2try=true;b.my.ex3caught=false}break}}if(b.my.loop){this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+"looping again");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}b.my.i++;b.my.reach2try=false;break}if(a.finallyBlock){this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+"in finally block!");if(!("ve"in b.my)){this.DEBUG>3&&this.ErrorConsole.log(b.stack.length+"finallyblock - requesting ve");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}if(b.EXCEPTION){b.my.exc=
b.EXCEPTION;b.my.result=c.result;b.my.exobj=b.EXCEPTION_OBJ;this.DEBUG>3&&this.ErrorConsole.log("storing exception for later rethrow: "+b.my.result);delete b.EXCEPTION}b.push(S_EXEC,{v:"ve",n:a.finallyBlock,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}if(!b.EXCEPTION){if(b.my.exc){this.DEBUG>3&&this.ErrorConsole.log("okay, stack.my.exc, exiting");b.EXCEPTION=b.my.exc;c.result=b.my.result;b.EXCEPTION_OBJ=b.my.exobj}if(b.my.savedException){b.EXCEPTION=b.my.savedException;c.result=b.my.savedResult}}}else if(b.my.savedException){b.EXCEPTION=
b.my.savedException;c.result=b.my.savedResult}b.my.done=true}else{this.DEBUG>3&&this.ErrorConsole.log("requesting  v2");if(!("v2"in b.my)){this.DEBUG>3&&this.ErrorConsole.log("!!!!!!!!!! v2 is not in stack.my");if(this.DEBUG>3){h=[];for(d in b.my)h.push(d);this.ErrorConsole.log(h)}}b.push(S_EXEC,{v:"v2",n:a.tryBlock,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;break}break;case THROW:if("v2"in b.my){c.result=b.my.v2;b.EXCEPTION=THROW}else{b.push(S_EXEC,{v:"v2",n:a.exception,
x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case RETURN:if(typeof a.v=="string"){c.result=undefined;b.EXCEPTION=RETURN}else if("v2"in b.my){c.result=b.my.v2;b.EXCEPTION=RETURN}else{b.push(S_EXEC,{v:"v2",n:a.v,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case WITH:if("r"in b.my){if(!("t"in b.my)){b.my.tt=this.getValue(b.my.r);b.my.t=this.toObject(b.my.tt,b.my.r,a.object);if(b.my.t===b.my.tt){b.my.t={};for(f in b.my.tt)b.my.t[f]=b.my.tt[f]}if(b.EXCEPTION&&
c.result instanceof ReferenceError)return;c.scope={object:b.my.t,parent:c.scope}}if(!("v2"in b.my)&&!b.EXCEPTION){b.push(S_EXEC,{v:"v2",n:a.body,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;break}b.my.TRY_WAIT=false;for(l in c.scope.object)if(c.scope.object[l]instanceof this.FunctionObject&&c.scope.object[l].node.functionForm==STATEMENT_FORM)c.scope.parent.object[l]=c.scope.object[l];else if(c.scope.object[l]!==b.my.tt[l])b.my.tt[l]=c.scope.object[l];c.scope=c.scope.parent;
b.my.done=true}else b.push(S_EXEC,{e:"r",n:a.object,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break;case VAR:case CONST:if(!("i"in b.my)){b.my.i=0;b.my.j=a.length||0}if(b.my.i>=b.my.j){b.my.done=true;break}if("u"in b.my){b.my.s.object[b.my.t]=b.my.u;delete b.my.u}else{b.my.u=a[b.my.i].iz;if(!b.my.u){delete b.my.u;b.my.i++;break}b.my.t=a[b.my.i].name;for(b.my.s=c.scope;b.my.s;b.my.s=b.my.s.parent)if(hasDirectProperty(b.my.s.object,b.my.t))break;b.push(S_EXEC,{v:"u",n:b.my.u,x:c,Nodes:a,Context:c,
NodeNum:0,pmy:b.my.myObj});break}b.my.i++;break;case DEBUGGER:b.EXCEPTION="NYI: "+tokens[a.type];break;case SEMICOLON:if(a.e)if("v2"in b.my){c.result=b.my.v2;delete b.my.v2}else{b.push(S_EXEC,{v:"v2",n:a.e,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case LABEL:if(!("v2"in b.my)&&!b.EXCEPTION){b.push(S_EXEC,{v:"v2",n:a.statement,x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.TRY_WAIT=true;break}if(b.EXCEPTION){if(b.EXCEPTION==BREAK&&c.target==a){b.EXCEPTION=false;
b.my.TRY_WAIT=false;delete b.my.v2;b.my.done=true}break}delete b.my.v2;b.my.done=true;break;case COMMA:if(!("i"in b.my)){b.my.i=0;b.my.j=a.length||0}if(b.my.i>=b.my.j){b.my.done=true;break}b.push(S_EXEC,{v:"v2",n:a[b.my.i],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.i++;break;case ASSIGN:if("r"in b.my)if("v0"in b.my){g=a[0].assignOp;m=b.my.v0;if(g)switch(g){case BITWISE_OR:m=b.my.u|m;break;case BITWISE_XOR:m=b.my.u^m;break;case BITWISE_AND:m=b.my.u&m;break;case LSH:m=b.my.u<<m;break;case RSH:m=
b.my.u>>m;break;case URSH:m=b.my.u>>>m;break;case PLUS:m=b.my.u+m;break;case MINUS:m=b.my.u-m;break;case MUL:m=b.my.u*m;break;case DIV:m=b.my.u/m;break;case MOD:m=b.my.u%m;break}this.putValue(b.my.r,m,a[0])}else{if(a[0].assignOp)b.my.u=this.getValue(b.my.r);if(b.EXCEPTION&&c.result instanceof ReferenceError)return;b.push(S_EXEC,{v:"v0",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}else{b.push(S_EXEC,{e:"r",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj,iwana:"ASSIGN"});break}b.my.done=
true;break;case HOOK:if("r"in b.my)if(b.my.r)if("v0"in b.my)m=b.my.v0;else{b.push(S_EXEC,{v:"v0",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}else if("v1"in b.my)m=b.my.v1;else{b.push(S_EXEC,{v:"v1",n:a[2],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}else{b.push(S_EXEC,{v:"r",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case OR:if("r1"in b.my)if(b.my.r1)m=b.my.r1;else if("r2"in b.my)m=b.my.r1||b.my.r2;else{b.push(S_EXEC,{v:"r2",n:a[1],
x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case AND:if("r1"in b.my)if(b.my.r1)if("r2"in b.my)m=b.my.r1&&b.my.r2;else{b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}else m=false;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case BITWISE_OR:if("r1"in b.my)m=b.my.r1|b.my.r2;else{b.push(S_EXEC,
{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case BITWISE_XOR:if("r1"in b.my)m=b.my.r1^b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case BITWISE_AND:if("r1"in b.my)m=b.my.r1&b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,
Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case EQ:if("r1"in b.my)m=b.my.r1==b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case NE:if("r1"in b.my)m=b.my.r1!=b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,
{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case STRICT_EQ:if("r1"in b.my)m=b.my.r1===b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case STRICT_NE:if("r1"in b.my)m=b.my.r1!==b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,
Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case LT:if("r1"in b.my)m=b.my.r1<b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case LE:if("r1"in b.my)m=b.my.r1<=b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=
true;break;case GE:if("r1"in b.my)m=b.my.r1>=b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case GT:if("r1"in b.my)m=b.my.r1>b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case LSH:if("r1"in b.my)m=b.my.r1<<
b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case RSH:if("r1"in b.my)m=b.my.r1>>b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case URSH:if("r1"in b.my)m=b.my.r1>>>b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],
x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case PLUS:if("r1"in b.my)m=b.my.r1+b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case MINUS:if("r1"in b.my)m=b.my.r1-b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});
b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case MUL:if("r1"in b.my)m=b.my.r1*b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case DIV:if("r1"in b.my)m=b.my.r1/b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,
Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case MOD:if("r1"in b.my)m=b.my.r1%b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case NOT:if("r1"in b.my)m=!b.my.r1;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case BITWISE_NOT:if("r1"in b.my)m=~b.my.r1;else{b.push(S_EXEC,
{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case UNARY_PLUS:if("r1"in b.my)m=+b.my.r1;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case UNARY_MINUS:if("r1"in b.my)m=-b.my.r1;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case IN:if("r1"in b.my)m=b.my.r1 in b.my.r2;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,
pmy:b.my.myObj});b.push(S_EXEC,{v:"r2",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case INSTANCEOF:if("t"in b.my)m=isObject(b.my.u)&&typeof b.my.u.___hasInstance___=="function"?b.my.u.___hasInstance___(b.my.t,this):b.my.t instanceof b.my.u;else{b.push(S_EXEC,{v:"t",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"u",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case DELETE:if("t"in b.my)m=!(b.my.t instanceof
Reference)||delete b.my.t.base[b.my.t.propertyName];else{b.push(S_EXEC,{e:"t",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case VOID:if(!("t"in b.my)){b.push(S_EXEC,{e:"t",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case TYPEOF:if("t"in b.my){if(b.my.t instanceof Reference)b.my.t=b.my.t.base?b.my.t.base[b.my.t.propertyName]:undefined;m=b.my.t instanceof this.FunctionObject?"function":typeof b.my.t}else{b.push(S_EXEC,{e:"t",
n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case INCREMENT:case DECREMENT:if("t"in b.my){h=Number(this.getValue(b.my.t));if(b.EXCEPTION&&c.result instanceof ReferenceError)return;if(a.postfix)m=h;this.putValue(b.my.t,a.type==INCREMENT?++h:--h,a[0]);a.postfix||(m=h)}else{b.push(S_EXEC,{e:"t",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case DOT:if("r"in b.my){g=this.getValue(b.my.r);if(b.EXCEPTION&&c.result instanceof ReferenceError)return;
h=a[1].v;m=new Reference(this.toObject(g,b.my.r,a[0]),h,a)}else{b.push(S_EXEC,{e:"r",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;case INDEX:if("r"in b.my){g=this.getValue(b.my.r);if(b.EXCEPTION&&c.result instanceof ReferenceError)return;m=new Reference(this.toObject(g,b.my.r,a[0]),String(b.my.u),a)}else{b.push(S_EXEC,{e:"r",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{v:"u",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=
true;break;case LIST:if(!("i"in b.my)){b.my.i=0;b.my.j=a.length||0;b.my.vcc={}}if(b.my.i>=b.my.j){b.my.done=true;b.my.vcc.length=b.my.i;m=b.my.vcc;break}if("u"in b.my){b.my.vcc[b.my.i]=b.my.u;delete b.my.u}else{b.push(S_EXEC,{v:"u",n:a[b.my.i],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.i++;break;case CALL:if("r"in b.my){d=this.getValue(b.my.r);if(b.EXCEPTION&&c.result instanceof ReferenceError)return;if(isPrimitive(d)||typeof d.___call___!="function"){b.EXCEPTION_OBJ=new TypeError(b.my.r+
" is not callable",a[0].filename,a[0].lineno);b.EXCEPTION=THROW;break}g=b.my.r instanceof Reference?b.my.r.base:null;if(g instanceof Activation)g=null;if(!("v0"in b.my)&&!b.EXCEPTION){if(d===this.global.eval){bb=Array.prototype.splice.call(b.my.a,0,b.my.a.length);this.DEBUG>3&&this.ErrorConsole.log("requesting v0 from eval with "+bb);this.ExecutionContext.current=c;this.global.eval.apply(this,bb)}else d.___call___(g,b.my.a,c,b,this);b.my.TRY_WAIT=true;break}b.my.TRY_WAIT=false;if(b.EXCEPTION){if(b.EXCEPTION==
RETURN){m=b.my.x2.result;b.EXCEPTION=false;this.ExecutionContext.current=b.my.oldxx;b.my.done=true;break}else if(b.EXCEPTION==THROW){if(b.my.x2&&b.my.x2.result)c.result=b.my.x2.result;else DEBUG&&this.ErrorConsole.log("NOT Setting CALL result to UNDEFINED");this.ExecutionContext.current=b.my.oldxx;b.my.done=true;break}this.ErrorConsole.log("kernel: strange behaviour at CALL exception")}if(d===this.global.eval){m=c.result;if(this.DEBUG>3)try{this.ErrorConsole.log("setting EVAL result to "+m)}catch(q){this.ErrorConsole.log("setting EVAL result to [Object: cannot convert to string]")}}else{m=
undefined;this.ExecutionContext.current=b.my.oldxx;DEBUG>3&&this.ErrorConsole.log("WARNING! Setting CALL to DONE in an unexpected SCRIPT END")}b.my.done=true}else{b.push(S_EXEC,{e:"r",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.push(S_EXEC,{e:"a",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});b.my.oldxx=c;break}break;case NEW:case NEW_WITH_ARGS:if("r"in b.my){if(!("f"in b.my))b.my.f=this.getValue(b.my.r);if(b.EXCEPTION&&c.result instanceof ReferenceError)return;if(a.type==NEW){b.my.a=
{};b.my.a.length=0}else if(!("a"in b.my)){b.push(S_EXEC,{e:"a",n:a[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}if(isPrimitive(b.my.f)||typeof b.my.f.___construct___!="function"){b.EXCEPTION_OBJ=new TypeError(h+" is not a constructor",a[0].filename,a[0].lineno);b.EXCEPTION=THROW;break}if(!("v0"in b.my)&&!b.EXCEPTION){b.my.f.___construct___(b.my.a,c,b);b.my.TRY_WAIT=true;break}b.my.TRY_WAIT=false;if(b.EXCEPTION)if(b.EXCEPTION==RETURN){m=b.my.x2.result;if(!isObject(m))m=b.my.o;b.EXCEPTION=
false;this.ExecutionContext.current=b.my.oldx;b.my.done=true;break}else if(b.EXCEPTION==THROW){c.result=b.my.x2.result;this.ExecutionContext.current=b.my.oldx;b.my.done=true;break}m=b.my.v0;if(!isObject(m))m=b.my.o;this.ExecutionContext.current=b.my.oldx;b.my.done=true}else{b.push(S_EXEC,{e:"r",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}break;case ARRAY_INIT:if(!("i"in b.my)){b.my.i=0;b.my.j=a.length||0;b.my.vcc=[]}if(b.my.i>=b.my.j){b.my.done=true;m=b.my.vcc;m.length=b.my.j;break}if("v2"in
b.my){b.my.vcc[b.my.i]=b.my.v2;delete b.my.v2}else{b.push(S_EXEC,{v:"v2",n:a[b.my.i],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.i++;break;case OBJECT_INIT:if(!("i"in b.my)){b.my.i=0;b.my.j=a.length||0;b.my.vcc={}}if(b.my.i>=b.my.j){b.my.done=true;m=b.my.vcc;break}b.my.t=a[b.my.i];if(b.my.t.type==PROPERTY_INIT)if("v2"in b.my){b.my.vcc[b.my.t[0].v]=b.my.v2;delete b.my.v2}else{b.push(S_EXEC,{v:"v2",n:b.my.t[1],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}else{d=new this.FunctionObject(b.my.t,
c.scope);h=b.my.t.type==GETTER?"__defineGetter__":"__defineSetter__";b.my.vcc[h](b.my.t.name,thunk(d,c,b))}b.my.i++;break;case NULL:m=null;b.my.done=true;break;case THIS:m=c.thisObject;b.my.done=true;break;case TRUE:m=true;b.my.done=true;break;case FALSE:m=false;b.my.done=true;break;case IDENTIFIER:for(l=c.scope;l;l=l.parent)if(a.v in l.object)break;if(!l&&window.console)if(a.v.toString()==="[object Object]"){console.log("!!!IDENTIFIER:: "+a.v+" t "+typeof a.v+" n "+(a.v===null));AAAA=a.v}m=new Reference(l&&
l.object,a.v,a);b.my.done=true;break;case NUMBER:case STRING:case REGEXP:m=a.v;b.my.done=true;break;case GROUP:if("r1"in b.my)m=b.my.r1;else{b.push(S_EXEC,{v:"r1",n:a[0],x:c,Nodes:a,Context:c,NodeNum:0,pmy:b.my.myObj});break}b.my.done=true;break;default:throw"PANIC: unknown operation "+a.type+": "+a;}return m};
Jnaric.prototype.evaluate_thread=function(a,c,b,f,d){if(typeof a!="string")a=a.toString();if(DEBUG&&DEBUG>2)this.STEP_TIMEOUT=50;var g=new this.ExecutionContext(GLOBAL_CODE),k=new __Stack(g);k.onok=f;k.onerr=d;k.stack.unshift({n:parse(a,c,b),x:g,pmy:{}});__jn_stacks.add_task(this,k,this.nice,this.throttle);return g.result};
Jnaric.prototype.execf_thread=function(a,c,b,f,d,g){if(window.__eos_objects&&!__eos_objects[this.uri])this.ErrorConsole.log("WARNING! denied creating stack for nonexistent object; heap fouled");else{if(typeof d=="undefined")d=this.nice;var k=new this.ExecutionContext(GLOBAL_CODE);k.thisObject=typeof g=="undefined"?this.global:g;g=typeof c!="undefined"?Array.prototype.splice.call(c,0,c.length):[];g.callee=a;var h=a.node;c=h.body;k.scope={object:new Activation(h,g),parent:a.scope};a=new __Stack(k);
a.stack.unshift({n:c,x:k,pmy:{}});a.onfinish=b;a.onerror=f;__jn_stacks.add_task(this,a,d,this.throttle);return a}};
Jnaric.prototype.execf_stack=function(a,c,b,f){if(window.__eos_objects&&!__eos_objects[this.uri])this.ErrorConsole.log("WARNING! denied modifying stack for nonexistent object; heap fouled");else{var d=new this.ExecutionContext(GLOBAL_CODE);d.thisObject=typeof f=="undefined"?this.global:f;b=typeof b!="undefined"?Array.prototype.splice.call(b,0,b.length):[];b.callee=c;f=c.node;var g=f.body;d.scope={object:new Activation(f,b),parent:c.scope};a.stack.unshift({n:g,x:d,pmy:{}});return a}};
Jnaric.prototype.evaluate=function(a,c,b){if(typeof a!="string")a=a.toString();if(DEBUG&&DEBUG>4)this.STEP_TIMEOUT=50;if(DEBUG&&DEBUG>3)this.STACKSIZE=150;var f=this.g_stack,d=f.stack.length>0;a=parse(a,c,b);f.stack.unshift({n:a,x:f.exc,pmy:{}});d||__jn_stacks.add_task(this,f,this.nice,this.throttle)};function Activation(a,c){for(var b=0,f=a.params.length;b<f;b++)this[a.params[b]]=c[b];this.arguments=c}Activation.prototype.__proto__=null;delete Activation.prototype.constructor;
var Fp=Function.prototype,REp=RegExp.prototype,__F=function(){};
if(!("___call___"in Fp)){Fp.___call___=function(a,c,b,f){c=Array.prototype.splice.call(c,0,c.length);f.my.x2={};var d=f.my;f.EXCEPTION=RETURN;try{d.x2.result=this.apply(a,c)}catch(g){if(g instanceof SyntaxError){f.EXCEPTION=THROW;b.result=g}else{f.EXCEPTION=THROW;a="";if(!g.lineNumber)for(var k in g)a=a+k+":"+g[k];b.result="InternalError: native call to "+this+" failed with exception: "+g+" Line: "+g.lineNumber+" File: "+g.fileName+" "+a}return}f.EXCEPTION&&f.EXCEPTION==RETURN&&f.push(S_EXEC,{n:{type:TRUE},
x:{},Nodes:{},Context:b,NodeNum:0,pmy:f.my.myObj});return d.x2.result};REp.___call___=function(a,c,b,f){c=Array.prototype.splice.call(c,0,c.length);f.my.x2={};try{f.my.x2.result=this.exec.apply(this,c)}catch(d){f.EXCEPTION=THROW;b.result="InternalError: native call to "+this+" failed with exception: "+d+" Line: "+d.lineNumber+" File: "+d.fileName}return f.my.x2.result};Fp.___construct___=function(a,c,b){args=Array.prototype.splice.call(a,0,a.length);b.my.oldx=c;if(this===Object||this===Boolean||this===
String||this===Number||this===Date){if(args.length===0)b.my.v0=new this;if(args.length===1)b.my.v0=new this(args[0]);if(args.length===2)b.my.v0=new this(args[0],args[1]);if(args.length===3)b.my.v0=new this(args[0],args[1],args[2]);if(args.length===4)b.my.v0=new this(args[0],args[1],args[2],args[3]);if(args.length===5)b.my.v0=new this(args[0],args[1],args[2],args[3],args[4]);if(args.length===6)b.my.v0=new this(args[0],args[1],args[2],args[3],args[4],args[5]);if(args.length===7)b.my.v0=new this(args[0],
args[1],args[2],args[3],args[4],args[5],args[6])}else{__F.prototype=this.prototype;a=new __F;try{var f=this.apply(a,args)}catch(d){if(d instanceof SyntaxError){b.EXCEPTION=THROW;c.result=d}else{b.EXCEPTION=THROW;c.result="InternalError: native call to "+this+" failed with exception: "+d+" Line: "+d.lineNumber+" File: "+d.fileName}return}if(f!==undefined)a=f;b.my.v0=a}return b.my.v0};Fp.___hasInstance___=function(a,c){if(this==c.global.Array)return a instanceof Array;return a instanceof Function||
a instanceof c.global.Function||a instanceof this};Array.prototype.sort.___call_fop=Array.prototype.sort.___call___;Array.prototype.sort.___call___=function(a,c,b,f,d){if(typeof d.global.Array.prototype.sort!="function")return d.global.Array.prototype.sort.___call___(a,c,b,f);this.___call_fop(a,c,b,f)}}function thunk(a,c,b){return function(){return a.___call___(this,arguments,c,b)}}
(function(){if(!(window.google&&google.gears)){var a=null;if(typeof GearsFactory!="undefined")a=new GearsFactory;else try{a=new ActiveXObject("Gears.Factory");a.getBuildInfo().indexOf("ie_mobile")!=-1&&a.privateSetGlobalObject(this)}catch(c){if(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}if(a){window.google||
(google={});if(!google.gears)google.gears={factory:a}}}})();document.domain=document.domain;__eos_requests={};__eos_objects={};__eos_comet={getID:function(){return 1}};__eos_serial=[];__eos_serial_weak=[];__SERIALIZER={};function fakeerr(a){window.console&&console.log("Generic error: "+a)}function fake(){}function BlobBuilder(){if(window.google&&google.gears)this.___builder=google.gears.factory.create("beta.blobbuilder");else this.___bloblist=[]}
BlobBuilder.prototype.getAsBlob=function(){if(this.___builder){var a=new BlobObject;a.___blob=this.___builder.getAsBlob();return a}a=new BlobObject;a.wrappedString=this.___bloblist.join("");return a};
BlobBuilder.prototype.append=function(a){if(this.___builder)return a.___blob?this.___builder.append(a.___blob):this.___builder.append(a);if(a.wrappedString)this.___bloblist.push(a.wrappedString);else if(typeof a=="string"||a instanceof String){for(var c=[],b,f=0;f<a.length;f++){b=a.charAt(f);b=encodeURI(b);b=b.length>1?b.split("%"):[b.charCodeAt(0).toString(16).toUpperCase()];c=c.concat(b)}this.___bloblist.push(c.join(""))}else if(a instanceof Array){c="";for(f=0;f<a.length;f++){if(typeof a[f]=="number")b=
a[f].toString(16).toUpperCase();else throw new TypeError("array does not consist of numbers");if(b.length==0)b="0"+b;c+=b}this.___bloblist.push(c)}};function BlobObject(){this.isBlob=true}BlobObject.prototype.toString=function(){return"[object GearsBlob]"};BlobObject.prototype.getLength=function(){if(this.___blob)return this.___blob.length;return this.wrappedString.length/2};
BlobObject.prototype.getBytes=function(a,c){c=c||this.getLength();a=a||0;if(this.___blob)return this.___blob.getBytes(a,c);for(var b=[],f=a;f<c;f++)b.push(parseInt(this.wrappedString.charAt(f*2)+this.wrappedString.charAt(f*2+1),16));return b};
BlobObject.prototype.slice=function(a,c){if(this.___blob){var b=new this.constructor;if(typeof a=="undefined")b.___blob=this.___blob.slice();else if(typeof c!="undefined"){var f=this.___blob.length-a;if(c>f)c=f;if(c<0)c=0;b.___blob=this.___blob.slice(a,c)}else b.___blob=this.___blob.slice(a)}else{b=new this.constructor;c=c||this.wrappedString.length;b.wrappedString=c?this.wrappedString.slice(a*2,c*2):this.wrappedString.slice(a*2)}return b};
BlobObject.prototype.getAsBase64=function(){var a=this.getBytes(),c=[],b=a.length,f=b%3;b=b-f;for(var d=0;d<b;){var g=a[d++]<<16|a[d++]<<8|a[d++];c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>18&63));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>12&63));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>6&63));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&
63))}switch(f){case 2:g=a[d++]<<16|a[d++]<<8;c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>18&63));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>12&63));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>6&63));c.push("=");break;case 1:g=a[d++]<<16;c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>18&63));c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g>>>
12&63));c.push("=");c.push("=");break}return c.join("")};
function eos_execURI(a,c,b,f,d){var g=a.cur_stack,k=g.my.x2;g.EXCEPTION=false;var h=__jn_stacks.newId();g.STOP=h;a.DEBUG&&a.ErrorConsole.log("in execURI... stopped stack!");if(typeof c!="string"&&!(c instanceof String)){g.EXCEPTION=THROW;g.exc.result=new a.global.TypeError("First execURI argument must be a string, got: "+typeof c);g.EXCEPTION_OBJ=g.exc.result;g.STOP=false}else if(typeof b!="string"&&!(b instanceof String)){g.EXCEPTION=THROW;g.exc.result=new a.global.TypeError("Second execURI argument must be a string, got: "+
typeof b);g.EXCEPTION_OBJ=g.exc.result;g.STOP=false}else if(f instanceof Array)if(typeof d!="undefined"&&!(d>=0)){g.EXCEPTION=THROW;g.exc.result=new a.global.TypeError("timeout execURI argument must be a number >= 0");g.EXCEPTION_OBJ=g.exc.result;g.STOP=false}else{var l=function(m){if(g.STOP==h){if(m.status=="OK"){k.result=m.result;g.EXCEPTION=RETURN}else{g.EXCEPTION=THROW;if(m.status=="EEXCP"){var q=new a.global.InternalError("execURI failed with exception: "+m.result);q.result=m.result}else if(m.status==
"ECONN"){q=new a.global.InternalError("connection failed: "+m.result);q.result=m.result}else if(m.status=="EPERM"){q=new a.global.SecurityError(m.result);q.result=m.result}else if(m.status=="EDROP"){q=new new a.global.InternalError("connection failed: "+m.result);q.result=m.result}else q=new a.global.InternalError("execURI failed with UNKNOWN status: "+m.status);g.exc.result=q}g.STOP=false;__jn_stacks.start(g.pid)}};kIPC(a,c,b,f,l,l,d)}else{g.EXCEPTION=THROW;g.exc.result=new a.global.TypeError("Args execURI argument must be an Array object");
g.EXCEPTION_OBJ=g.exc.result;g.STOP=false}}
function eos_rcvEvent(a){if(a.result||a.status){if(a.id in __eos_requests)if(__eos_requests[a.id].onok){if(a.status=="OK")__eos_requests[a.id].onok(a);else __eos_requests[a.id].onerror?__eos_requests[a.id].onerror(a):__eos_requests[a.id].onok(a);delete __eos_requests[a.id]}else{var c=__eos_requests[a.id].context,b=__eos_requests[a.id].stack,f=__eos_requests[a.id].vm;delete __eos_requests[a.id];if(a.status=="OK")if(f.security.validateResponse){var d=function(k){if(k){c.result=a.result;b.EXCEPTION=
RETURN}else{b.EXCEPTION=THROW;k=new f.global.SecurityError("failed to validate RESPONSE that was received");k.result=a.result;b.exc.result=k}b.STOP=false;__jn_stacks.start(b.pid)};f.execf_thread(f.security.validateResponse,[a],d,function(k){b.EXCEPTION=THROW;k=new f.global.InternalError("validateResponse failed with exception: "+k);k.result=rs.result;b.exc.result=k;b.STOP=false;__jn_stacks.start(b.pid)},undefined,f.security)}else{c.result=a.result;b.EXCEPTION=RETURN;b.STOP=false;__jn_stacks.start(b.pid)}else{b.EXCEPTION=
THROW;if(a.status=="EEXCP"){d=new f.global.InternalError("execURL failed with exception: "+a.result);d.result=a.result}else if(a.status=="ECONN"){b.EXCEPTION=THROW;d=new f.global.InternalError("connection failed: "+a.result);d.result=a.result}else if(a.status=="EPERM"){b.EXCEPTION=THROW;d=new f.global.SecurityError(a.result);d.result=a.result}else if(a.status=="EDROP"){b.EXCEPTION=THROW;d=new new f.global.InternalError("connection failed: "+a.result);d.result=a.result}else{b.EXCEPTION=THROW;d=new f.global.InternalError("execURL failed with UNKNOWN status: "+
a.status)}b.exc.result=d;b.STOP=false;__jn_stacks.start(b.pid)}}}else if(!(a.status&&a.status=="EDROP")){d=__eos_objects.terminal;var g=a.uri.split("/");g=d.getChild(g);if(g==null){a.result="object not found by URI "+a.uri;a.status="EEXCP";delete a.args;hubConnection.send(a)}else if(typeof g=="string")if(g.charAt(0)=="/"){a.uri=g;a.status="REDIR";delete a.args;hubConnection.send(a)}else if(g.charAt(0)=="~"){a.uri=g;eos_rcvEvent(a)}else{delete a.args;a.result="Redirection failed";a.status="EEXCP";
hubConnection.send(a)}else{d=function(k){a.broadcast||hubConnection.send(k)};g.execIPC(a,d,d)}}}
Jnaric.prototype.execIPC=function(a,c,b){this.DEBUG&&this.ErrorConsole.log("in execIPC... ");var f=this,d=function(k){f.DEBUG&&f.ErrorConsole.log("in execIPC... validate done");if(k!==true)b({id:a.id,status:"EPERM",result:typeof k=="string"?k:"permission denied"});else{f.DEBUG&&f.ErrorConsole.log("in execIPC... validateOK");if((k=f.global.object.ipc.hasOwnProperty(a.method))||f.security.ipc&&f.security.ipc.hasOwnProperty(a.method)){var h=function(m){f.security.signResponse?f.execf_thread(f.security.signResponse,
[a],function(q){c({id:a.id,status:"OK",result:q})},function(q){b({id:a.id,status:"EEXCP",result:"signResponse failed with exception: "+q})},undefined,f.security):c({id:a.id,status:"OK",result:m})},l=function(m){f.DEBUG&&f.ErrorConsole.log("method IPC call failed with exception: "+m);b({id:a.id,status:"EEXCP",result:"method failed with exception: "+m})};k?f.execf_thread(f.global.object.ipc[a.method],[a].concat(a.args),h,l):f.execf_thread(f.security.ipc[a.method],[a].concat(a.args),h,l,undefined,f.security)}else{f.DEBUG&&
f.ErrorConsole.log("method IPC call failed with NO SUCH METHOD");b({id:a.id,status:"EEXCP",result:"no such method: "+a.method})}}},g=function(k){f.ErrorConsole.log("request validation failed with exception: "+k);b({id:a.id,status:"EEXCP",result:"request validation failed with exception: "+k})};if(this.global.initIPCLock)if(f.global.initIPCLock.goflag<1){d=function(){f.global.initIPCLock.release(true);f.execIPC(a,c,b)};f.global.initIPCLock.___wait_queue.push({callback:d});return}if(this.global.wakeupIPCLock)if(f.global.wakeupIPCLock.goflag<
1){d=function(){f.global.wakeupIPCLock.release(true);f.execIPC(a,c,b)};f.global.wakeupIPCLock.___wait_queue.push({callback:d});return}this.security.validateRequest?this.execf_thread(this.security.validateRequest,[a],d,g,undefined,this.security):g("validateRequest is undefined at callee side");for(d=0;d<__eos_serial.length;d++)if(__eos_serial[d]==this){__eos_serial.splice(d,1);__eos_serial.push(this);break}};
Jnaric.prototype.getChild=function(a,c){if(a.length==0)return this;if(a.length==1&&a[0]=="~")return __eos_objects.terminal;if(typeof c=="undefined"){var b=[].concat(a);if(b[0]=="."){b.shift();b=this.uri.split("/").concat(b)}else if(b[0]==".."){b.shift();b=this.getParent().uri.split("/").concat(b)}var f=b.join("/");if(f in __eos_objects)return __eos_objects[f];var d=getFixedStorage();if(d){var g=d.getChildList(f);if(g){var k=[].concat(b),h=k.pop();k=k.join("/");var l=__eos_objects[k];if(!l){(d=d.getChildList(k))||
__eos_objects.terminal.ErrorConsole.log("failed to retreive parent from stor: "+k+" / "+f);l={serID:parseInt(d.rowid),uri:k,name:b[b.length-1]}}return eos_wakeObject(l,h,parseInt(g.rowid))}d.close()}}if(a[0]=="."){a.shift();return this.getChild(a,true)}else if(a[0]==".."){a.shift();return this.getParent().getChild(a,true)}else if(a[0]=="~"){a.shift();return __eos_objects.terminal.getChild(a,true)}else if(a[0]==""){a.shift();return this.getChild(a,true)}b=this.childList[a[0]];if(typeof b=="undefined")return null;
if(typeof b=="number"){if(!KCONFIG.autorestore)return null;b=eos_wakeObject(this,a[0],b);if(b==-1)return null}if(typeof b=="string"){if(a.length==1)return b;a.shift();return b+"/"+a.join("/")}if(a.length==1)return b;a.shift();return b.getChild(a,true)};Jnaric.prototype.getParent=function(){return this.parent};
function kIPC(a,c,b,f,d,g,k){var h={v:1,id:__jn_stacks.newId()+(new Date).getTime()+"",uri:c,terminal_id:"~",caller_type:a.TypeURI,caller_security:a.SecurityURI,caller_uri:a.uri,method:b,args:f,timeout:parseInt(k||MAX_RQ_TIME)},l=function(){var m=a.security.validateResponse?function(n){a.execf_thread(a.security.validateResponse,[h],function(r){r?d(n):g({id:h.id,status:"EPERM",result:"response validation failed"})},function(r){g({id:h.id,status:"EEXCP",result:"validateResponse failed with exception: "+
r})},undefined,a.security)}:d,q=c.split("/");if(q[0]==""){a.DEBUG&&a.ErrorConsole.log("in kIPC... request for HUB");hubConnection.send(h);if(c.indexOf(",")>-1)d({id:h.id,status:"OK",result:null});else __eos_requests[h.id]={request:h,onok:m,onerror:g}}else{try{var s=__eos_objects[c]?__eos_objects[c]:a.getChild(q)}catch(o){g({id:h.id,status:"EEXCP",result:"FAILED TO EXECUTE GETCHILD: "+o+" Line:"+o.lineNumber+" File:"+o.fileName});return}if(s==null){g({id:h.id,status:"EEXCP",result:"object not found by URI"});
return}if(typeof s=="string"){a.DEBUG&&a.ErrorConsole.log("in kIPC... again kIPC!");kIPC(a,s,b,f,d,g)}else try{s.execIPC(h,m,g)}catch(p){window.console&&console.log("in kIPC - execIPC error:: "+p)}}typeof k=="number"&&setTimeout(function(){g({id:h.id,status:"EEXCP",result:"TIMEOUT"})},k)};a.security.signRequest?a.execf_thread(a.security.signRequest,[h],function(m){m===true?l():g({id:h.id,status:"EPERM",result:m?m:"signRequest refused to sign request"})},function(m){g({id:h.id,status:"EEXCP",result:"signRequest failed with exception: "+
m})},undefined,a.security):l()}
function eos_wakeObject(a,c,b){var f=getFixedStorage();if(!f){__eos_objects.terminal.ErrorConsole.log("ASSERT FAILED: wakeObject: storage not availabl");return null}var d=f.getByID(b);f.close();if(!d){__eos_objects.terminal.ErrorConsole.log("ASSERT FAILED: wakeObject: could not get object by id: "+b);return null}var g=new Jnaric;g.name=c;g.TypeURI=d.TypeURI;g.SecurityURI=d.SecurityURI;g.parent=a;g.uri=g.parent.uri+"/"+c;g.parent.uri+"/"+c!=d.URI&&__eos_objects.terminal.ErrorConsole.log('ASSERT FAILED: obj.parent.uri+"/"+name != dump.URI: '+g.parent.uri+
"/"+c+" != "+d.URI);g.serID=d.rowid;g.childList=JSON.parse(d.ChildList);g.global.initIPCLock=new g.global.Lock;g.global.initIPCLock.goflag=0;g.global.wakeupIPCLock=new g.global.Lock;g.global.wakeupIPCLock.goflag=0;g.bind_dom();g.bind_om();for(var k in g.childList)for(var h in __eos_objects)if(__eos_objects[h].serID==g.childList[k]){g.childList[k]=__eos_objects[h];__eos_objects[h].parent=g;break}var l=function(){},m=function(){__eos_objects.terminal.ErrorConsole.log("error while executing setSecurityState!!")};
g.onerror=function(){g.ErrorConsole.log("ERROR! object wakeup failed due to error in main thread. Removing dead object.");if(g.swapout()!=0){g.clean_stacks();delete __eos_objects[g.uri]}};var q=function(s){__eos_objects.terminal.ErrorConsole.log("wakeObject kIPC error: "+s)};kIPC(__eos_objects.terminal,g.SecurityURI,"read",[],function(s){g.evaluate(s.result,d.SecurityURI);kIPC(__eos_objects.terminal,g.TypeURI,"read",[],function(o){g.evaluate(o.result,d.TypeURI);if(d.Data)try{g.global.object.data=
JSON.parse(d.Data)}catch(p){g.ErrorConsole.log("Could not load JSON object data (TQLW wakeup)")}if(d.SecurityProp)g.onfinish=function(){g.execf_thread(g.security.setSecurityState,[JSON.parse(d.SecurityProp)],l,m,undefined,g.security)}},q)},q);if(KCONFIG.autoswapout&&__eos_objects.length>KCONFIG.MEMOBJECTS){b=[];for(f=0;f<__eos_objects.length-KCONFIG.MEMOBJECTS&&f<__eos_serial.length;f++){k=__eos_serial[f];for(h=0;h<__eos_serial_weak.length;h++)if(k==__eos_serial_weak[h])break;h==__eos_serial_weak.length?
k.swapout():b.push(k)}__eos_serial=b}if(a.childList)a.childList[c]=g;__eos_objects[g.uri]=g;__eos_serial.push(g);return g}
function eos_createObject(a,c,b,f,d,g,k,h){var l=new Jnaric;l.name=c;l.TypeURI=g;l.SecurityURI=k;l.parent=__eos_objects.terminal.getChild(d.split("/"));l.parent.childList[c]=l;l.uri=l.parent.uri+"/"+c;__eos_objects[l.uri]=l;l.serID=-1;l.childList={};l.global.initIPCLock=new l.global.Lock;l.global.initIPCLock.goflag=0;l.global.wakeupIPCLock=new l.global.Lock;l.bind_dom(h);l.bind_om();l.onerror=function(m){a.global.ErrorConsole.log("created child (URI "+l.uri+") main thread died with exception: "+m)};
l.evaluate(f,k);l.evaluate(b,g)}Jnaric.prototype.getChildList=function(){var a={};for(ob in this.childList)if(typeof this.childList[ob]=="number"||typeof this.childList[ob]=="string")a[ob]=this.childList[ob];else if(this.childList[ob].serID>-1)a[ob]=this.childList[ob].serID;return{good:true,list:a}};
Jnaric.prototype.swapout=function(a){var c=this.has_stacks();if(!a&&c)return-1;if(!(this.serID>0))return-2;for(var b in this.childList)this.childList[b].parent={serID:this.serID,uri:this.uri,name:this.name};c&&this.clean_stacks();this.getParent().childList[this.name]=this.serID;delete __eos_objects[this.uri];return 0};
Jnaric.prototype.clean_stacks=function(){var a=[];for(j=0;j<__jn_stacks.stacks_sleeping.length;j++)__jn_stacks.stacks_sleeping[j].vm!=this&&a.push(__jn_stacks.stacks_sleeping[j]);__jn_stacks.stacks_sleeping=a;a=[];for(j=0;j<__jn_stacks.stacks_running.length;j++)__jn_stacks.stacks_running[j].vm!=this&&a.push(__jn_stacks.stacks_running[j]);__jn_stacks.stacks_running=a};
Jnaric.prototype.has_stacks=function(){var a;for(a=0;a<__jn_stacks.stacks_sleeping.length;a++)if(__jn_stacks.stacks_sleeping[a].vm==this)return true;for(a=0;a<__jn_stacks.stacks_running.length;a++)if(__jn_stacks.stacks_running[a].vm==this)return true};
function GearsStore(){this.db=google.gears.factory.create("beta.database");this.db.open("jeos3-ss");this.db.execute("create table if not exists Serialize (URI text UNIQUE, TypeURI text, SecurityURI text, SecurityProp text, ChildList text, Data text, Created int, Modified int)")}GearsStore.prototype.checkID=function(a){a=this.db.execute("SELECT * FROM Serialize WHERE OID=?",[a]);if(a.isValidRow()){a.close();return true}a.close();return false};
GearsStore.prototype.update=function(a,c){this.db.execute("UPDATE Serialize SET SecurityProp=?, ChildList=?, Data=?, Modified=? WHERE OID=?",[c.SecurityProp,c.ChildList,c.Data,(new Date).getTime(),a])};
GearsStore.prototype.insert=function(a){this.db.execute("INSERT INTO Serialize values (?,?,?,?,?,?,?,?)",[a.URI,a.TypeURI,a.SecurityURI,a.SecurityProp,a.ChildList,a.Data,(new Date).getTime(),(new Date).getTime()]);a=this.db.execute("SELECT rowid FROM Serialize WHERE URI=?",[a.URI]);var c=parseInt(a.field(0));a.close();return c};
GearsStore.prototype.getByID=function(a){a=this.db.execute("SELECT URI,rowid,TypeURI,SecurityURI,SecurityProp,ChildList,Data FROM Serialize WHERE OID=?",[a]);if(!a.isValidRow()){a.close();return null}for(var c={},b=0;b<a.fieldCount();b++)c[a.fieldName(b)]=a.field(b);a.close();return c};
GearsStore.prototype.getByURI=function(a){a=this.db.execute("SELECT rowid,TypeURI,SecurityURI,SecurityProp,ChildList,Data FROM Serialize WHERE URI=?",[a]);if(!a.isValidRow()){a.close();return null}for(var c={},b=0;b<a.fieldCount();b++)c[a.fieldName(b)]=a.field(b);a.close();return c};
GearsStore.prototype.getChildList=function(a){a=typeof a=="string"?this.db.execute("SELECT rowid,TypeURI,SecurityURI,ChildList FROM Serialize WHERE URI=?",[a]):this.db.execute("SELECT rowid,URI,TypeURI,SecurityURI,ChildList FROM Serialize WHERE OID=?",[a]);if(!a.isValidRow()){a.close();return null}for(var c={},b=0;b<a.fieldCount();b++)c[a.fieldName(b)]=a.field(b);a.close();return c};
GearsStore.prototype.setChildList=function(a,c){typeof a=="string"?this.db.execute("UPDATE Serialize SET ChildList=?, Modified=? WHERE URI=?",[c,(new Date).getTime(),a]):this.db.execute("UPDATE Serialize SET ChildList=?, Modified=? WHERE OID=?",[c,(new Date).getTime(),a])};GearsStore.prototype.remove=function(a){this.db.execute("DELETE FROM Serialize WHERE OID=?",[a])};GearsStore.prototype.close=function(){this.db.close()};function localStore(){}
localStore.prototype.checkID=function(a){if(window.localStorage.getItem(a.toString()))return true;return false};localStore.prototype.update=function(a,c){var b=JSON.parse(window.localStorage.getItem(a.toString()));for(var f in c)b[f]=c[f];b.Modified=(new Date).getTime();window.localStorage.setItem(a.toString(),JSON.stringify(b))};
localStore.prototype.insert=function(a){var c=(new Date).getTime();a.Created=a.Modified=c;window.localStorage.setItem(c.toString(),JSON.stringify(a));window.localStorage.setItem(a.URI,c.toString());return c};localStore.prototype.getByID=function(a){var c=JSON.parse(window.localStorage.getItem(a.toString()));c.rowid=parseInt(a);return c};localStore.prototype.getByURI=function(a){a=window.localStorage.getItem(a);if(!a)return null;return this.getByID(a)};
localStore.prototype.getChildList=function(a){if(typeof a=="string"){var c=window.localStorage.getItem(a);if(!c){DEBUG&&window.console&&console.log("localStore getChildList consistency error!!: "+a);return}}else c=a;a=JSON.parse(window.localStorage.getItem(c.toString()));a.rowid=parseInt(c);return a};
localStore.prototype.setChildList=function(a,c){if(typeof a=="string"){var b=window.localStorage.getItem(a);if(!b){DEBUG&&window.console&&console.log("localStore setChildList consistency error!!: "+a);return}}else b=a;var f=JSON.parse(window.localStorage.getItem(b.toString()));f.ChildList=c;window.localStorage.setItem(b.toString(),JSON.stringify(f))};localStore.prototype.remove=function(a){var c=JSON.parse(window.localStorage.getItem(a.toString()));window.localStorage.removeItem(c.URI);window.localStorage.removeItem(a.toString())};
localStore.prototype.close=function(){};function getFixedStorage(){if(window.google)try{return new GearsStore}catch(a){if(window.localStorage)return new localStore}else if(window.localStorage)return new localStore}
Jnaric.prototype.serialize=function(a,c){var b=getFixedStorage();if(!b)return-1;var f=this,d=f.getChildList();if(!(this.parent.serID>-1)){c&&c("object not ready - parent not serialized, skip to another");return-2}var g=JSON.stringify(d.list);f.execf_thread(f.security.getSecurityState,[],function(k){if(f.serID>0){if(b.checkID(f.serID)){k={SecurityProp:JSON.stringify(k),Data:JSON.stringify(f.global.object.data),ChildList:g};b.update(f.serID,k)}}else{k={SecurityProp:JSON.stringify(k),Data:JSON.stringify(f.global.object.data),
ChildList:g,TypeURI:f.TypeURI,SecurityURI:f.SecurityURI,URI:f.uri};f.serID=b.insert(k)}if(k=b.getChildList(f.parent.uri)){k=JSON.parse(k.ChildList);if(!(f.name in k)){k[f.name]=f.serID;b.setChildList(f.parent.uri,JSON.stringify(k))}}b.close();a&&a(f.serID)},function(k){c&&c(k)},undefined,f.security)};
eos_om={jnext_init:function(a){a.cur_stack.my.v0=undefined;var c=a.cur_stack,b=c.my.x2;a.cur_stack.EXCEPTION=false;var f=__jn_stacks.newId();a.cur_stack.STOP=f;JNEXT=new JNEXT_;setTimeout(function(){b.result=!!objJSExt.sendCmd;c.EXCEPTION=RETURN;c.STOP=false;__jn_stacks.start(c.pid)},100)},openFiles:function(a,c,b){a.cur_stack.my.v0=undefined;var f=a.cur_stack,d=f.my.x2;if(typeof c=="undefined")c={};if(typeof b=="undefined"||b==null||!(b instanceof this.FunctionObject)){a.cur_stack.EXCEPTION=false;
var g=__jn_stacks.newId();a.cur_stack.STOP=g;var k=function(h){if(f.STOP==g){for(var l=[],m,q=0;q<h.length;q++){m=new BlobObject;m.___blob=h[q].blob;l[q]={name:h[q].name,blob:m}}d.result=l;f.EXCEPTION=RETURN;f.STOP=false;__jn_stacks.start(f.pid)}}}else k=function(h){for(var l=[],m,q=0;q<h.length;q++){m=new BlobObject;m.___blob=h[q].blob;l[q]={name:h[q].name,blob:m}}a.global.start_new_thread(b,[l])};desktop=google.gears.factory.create("beta.desktop");desktop.openFiles(k,c)},release:function(a,c){if(typeof c==
"undefined")c=true;for(var b=0;b<__eos_serial.length;b++)if(__eos_serial[b]==a){__eos_serial.splice(b,1);break}c&&__eos_serial.push(a);eos_om.serialize(a)},serialize:function(a){__eos_serial_weak.push(a);__SERIALIZER.vm&&__SERIALIZER.vm.execf_thread(__SERIALIZER.fn,[],function(){},function(c){__SERIALIZER.vm.ErrorConsole.log("serialized thread died with exception: "+c)},5)},register_serializer:function(a,c){__SERIALIZER={vm:a,fn:c}},listObjects:function(){var a=[];for(ob in __eos_objects)a.push(__eos_objects[ob].uri);
return a},createChild:function(a,c,b,f,d){var g=__jn_stacks.newId(),k=a.cur_stack;if(c in a.childList){a.cur_stack.EXCEPTION=THROW;a.cur_stack.my.x2.result="duplicate child name";a.cur_stack.EXCEPTION_OBJ="duplicate child name"}else if(c.toString().indexOf("/")!=-1){a.cur_stack.EXCEPTION=THROW;a.cur_stack.my.x2.result="child name may not contain slash";a.cur_stack.EXCEPTION_OBJ="child name may not contain slash"}else if(typeof b!="string"&&!(b instanceof String)){a.cur_stack.EXCEPTION=THROW;a.cur_stack.my.x2.result=
new a.global.TypeError("TypeURI must be a string");a.cur_stack.EXCEPTION_OBJ=new a.global.TypeError("TypeURI must be a string")}else if(typeof f!="string"&&!(f instanceof String)){a.cur_stack.EXCEPTION=THROW;a.cur_stack.my.x2.result=new a.global.TypeError("SecurityURI must be a string");a.cur_stack.EXCEPTION_OBJ=new a.global.TypeError("SecurityURI must be a string")}else{k.STOP=g;k.EXCEPTION=false;kIPC(a,b,"read",[],function(h){var l=h.result;kIPC(a,f,"read",[],function(m){m=m.result;k.STOP=false;
k.EXCEPTION=RETURN;k.my.x2.result=1;__jn_stacks.start(k.pid);eos_createObject(a,c,l,m,a.uri,b,f,d)},function(m){k.EXCEPTION=THROW;if(m.status=="EPERM")k.my.x2.result=new a.global.SecurityError(m.result);else k.exc.result=new a.global.Error(m.result);k.STOP=false;__jn_stacks.start(k.pid)})},function(h){k.EXCEPTION=THROW;if(h.status=="EPERM")k.my.x2.result=new a.global.SecurityError(h.result);else k.exc.result=new a.global.Error(h.result);k.STOP=false;__jn_stacks.start(k.pid)})}},getReleaseObj:function(a){if(a>=
__eos_serial.length)return null;return __eos_serial[a].uri},getSerializeObj:function(a){if(a>=__eos_serial_weak.length)return null;return __eos_serial_weak[a].uri},delReleaseObj:function(a){var c=0;for(c=0;c<__eos_serial.length;c++)if(a==__eos_serial[c].uri){__eos_serial.splice(c,1);return}},delSerializeObj:function(a){var c=0;for(c=0;c<__eos_serial_weak.length;c++)if(a==__eos_serial_weak[c].uri){__eos_serial_weak.splice(c,1);return}},getReleaseLength:function(){return __eos_serial.length},getSerializeLength:function(){return __eos_serial_weak.length},
kconfig:function(a,c,b){if(typeof b!="undefined")for(var f=0;f<a.kconfig_w.length;f++){if(c==a.kconfig_w[f])return KCONFIG[c]=b}else for(f=0;f<a.kconfig_r.length;f++)if(c==a.kconfig_r[f])return KCONFIG[c]},kbind:function(a,c,b,f,d){if(c in a.childList){a=a.childList[c];for(c=0;c<b.length;c++)a[b[c]]();a.kconfig_r=a.kconfig_r.concat(f);a.kconfig_w=d}else{a.cur_stack.EXCEPTION=THROW;a.cur_stack.my.x2.result="object not found by URI"}},include:function(a,c,b){if(!a.includes)a.includes={};if(!(c in a.includes)){a.includes[c]=
true;if(b)d=b;else{a.cur_stack.EXCEPTION=false;a.cur_stack.my.v0=undefined;var f=__jn_stacks.newId();a.cur_stack.STOP=f;var d=a.cur_stack}kIPC(a,c,"read",[],function(g){g=g.result;if(!(!b&&d.STOP!=f)){var k=function(){if(a.global!=this.x.scope.object)for(var m in this.x.scope.object)a.global[m]=this.x.scope.object[m]};try{var h=parse(g,c,0);if(b){b.stack.unshift({n:h,x:d.exc,pmy:{},finally_exec:k});if(!b.pid||b.stack.length==1)__jn_stacks.add_task(a,b,a.nice,a.throttle);b.queueSize--}else d.push(S_EXEC,
{n:h,x:d.exc,pmy:{},finally_exec:k})}catch(l){if(b){a.ErrorConsole.log("include exec error! "+l+" Line: "+l.lineNumber+" File: "+l.fileName);a.ErrorConsole.log(l)}else{d.EXCEPTION=THROW;d.exc.result=l}}if(b)b.pid&&__jn_stacks.start(b.pid);else{d.STOP=false;__jn_stacks.start(d.pid)}}},function(g){if(!(!b&&d.STOP!=f))if(b){k=new a.global.InternalError("include('"+c+"') failed with exception: "+g.result);k.status=g.status;a.ErrorConsole.log(""+k)}else{d.EXCEPTION=THROW;var k=new a.global.InternalError("include('"+
c+"') failed with exception: "+g.result);k.status=g.status;d.exc.result=k;d.STOP=false;__jn_stacks.start(d.pid)}})}},deleteChild:function(a,c){var b=eos_deleteChild(a,c),f=a.cur_stack;if(b==-3){f.EXCEPTION=THROW;f.exc.result=new a.global.Error("object not found by URI")}else if(b<0){f.EXCEPTION=THROW;f.exc.result=new a.global.Error("delete object error code "+b)}return b},changeSecurityURI:function(a,c){a.SecurityURI=c;a.security_backup=a.security;a.security_backup_global=a.global.security;a.security=
{ipc:{},object:a.sec_object};a.global.security=a.security;a.global.initIPCLock.goflag=0;kIPC(a,c,"read",[],function(b){b=b.result;var f=function(){a.global.initIPCLock.goflag=1},d=function(k){a.ErrorConsole.log("changeSecurityURI security code error! "+k+" Line: "+k.lineNumber+" File: "+k.fileName);a.ErrorConsole.log(k);a.security=a.security_backup;a.global.security=a.security_backup_global;a.global.initIPCLock.goflag=1};try{a.evaluate_thread(b,c,0,f,d)}catch(g){d(g)}},function(b){a.ErrorConsole.log("changeSecurityURI security code failed to fetch from this URI "+
c+" Reason: "+b.status+" : "+b.result);a.security=a.security_backup;a.global.security=a.security_backup_global;a.global.initIPCLock.goflag=1})}};
function eos_deleteChild(a,c){if(typeof a=="number")a={serID:a};if(!a.global){var b=getFixedStorage();if(!b){__eos_objects.terminal.ErrorConsole.log("deleteChild: impossible scenario happened: object not found in storage "+a.uri+" "+c);return-1}var f=JSON.parse(b.getChildList(a.serID).ChildList);if(!(c in f)){__eos_objects.terminal.ErrorConsole.log("deleteChild: impossible scenario happened: child not found in stored parent "+a.uri+" "+c);b.close();return-2}a.childList=f;b.close()}f=a.childList[c];
if(!f){__eos_objects.terminal.ErrorConsole.log("deleteChild: child not found in cl "+a.uri+" "+c);return-3}if(typeof f=="number")for(var d in __eos_objects)if(__eos_objects[d].serID==f){f=__eos_objects[d];break}if(typeof f=="number"){b=getFixedStorage();if(!b)return-4;f={name:c,serID:f,uri:a.uri+"/"+c};f.childList=JSON.parse(b.getChildList(f.serID).ChildList);b.close()}for(var g in f.childList)eos_deleteChild(f,g);if(f.global){if(f.has_stacks()){d=[];for(b=0;b<__jn_stacks.stacks_sleeping.length;b++)__jn_stacks.stacks_sleeping[b].vm!=
f&&d.push(__jn_stacks.stacks_sleeping[b]);__jn_stacks.stacks_sleeping=d;d=[];for(b=0;b<__jn_stacks.stacks_running.length;b++)__jn_stacks.stacks_running[b].vm!=f&&d.push(__jn_stacks.stacks_running[b]);__jn_stacks.stacks_running=d}f.__abort()}if(a.childList[c].cssRules){d=document.styleSheets[0].cssRules||document.styleSheets[0].rules;for(g=0;g<a.childList[c].cssRules.length;g++){for(b=0;b<d.length;b++)if(d[b]===a.childList[c].cssRules[g])break;try{document.styleSheets[0].cssRules?document.styleSheets[0].deleteRule(b):
document.styleSheets[0].removeRule(b)}catch(k){a.ErrorConsole.log("deleteChild: failed to remove stylesheet entry due to error: "+k)}}}delete a.childList[c];delete __eos_objects[f.uri];b=getFixedStorage();if(!b)return 0;if(a.serID>0)a.global||b.setChildList(a.serID,JSON.stringify(a.childList));f.serID>0&&b.remove(f.serID);b.close();window.google&&google.gears.factory.create("beta.localserver").removeStore(f.uri.split("/").join("."));return 0}
Jnaric.prototype.bind_om=function(){var a=this;this.ErrorConsole.id=this.uri+": ";this.kconfig_r=["init","terminal_id","host","run","initdir"];this.kconfig_w=[];this.security={ipc:{}};this.global.security=this.security;this.security.changeSecurityURI=function(b){return eos_om.changeSecurityURI(a,b)};this.global.object={name:this.name,version:this.VERSION};this.global._object=this.global.object;this.global.object.ipc={};this.global.object.data={};this.global.object.uri2id=Jnaric.prototype.uri2id;this.global.execURI=
function(b,f,d,g){eos_execURI(a,b,f,d,g)};this.global.object.execURI=this.global.execURI;this.global.__ipc=this.global.object.ipc;this.global.object.createChild=function(b,f,d,g){eos_om.createChild(a,b,f,d,g)};this.global.object.deleteChild=function(b){eos_om.deleteChild(a,b)};this.global.object.linkChild=function(b,f){if(b in a.childList){a.cur_stack.EXCEPTION=THROW;a.cur_stack.exc.result="duplicate child name"}else a.childList[b]=f};this.global.object.enumerateChildren=function(){var b=[];for(c in a.childList)b.push(c);
return b};this.global.object.getMyURI=function(b){if(b)return"/"+KCONFIG.terminal_id+a.uri.slice(1);return a.uri};this.global.object.getMyAbsoluteURI=function(){return"/"+KCONFIG.terminal_id+a.uri.slice(1)};this.global.object.getMyTypeURI=function(b){if(b&&a.TypeURI.charAt(0)=="~")return"/"+KCONFIG.terminal_id+a.TypeURI.slice(1);return a.TypeURI};this.global.object.getMySecurityURI=function(b){if(b&&a.SecurityURI.charAt(0)=="~")return"/"+KCONFIG.terminal_id+a.SecurityURI.slice(1);return a.SecurityURI};
this.global.object.release=function(b){eos_om.release(a,b)};this.global.object.serialize=function(){eos_om.serialize(a)};this.global.object.isSerialized=function(){return a.serID>0};this.global.object.destroyInstance=function(){eos_deleteChild(a.parent,a.name)};this.global.object.destroy=this.global.object.destroyInstance;this.global.object.kconfig=function(b,f){return eos_om.kconfig(a,b,f)};this.global.object.include=function(b){return eos_om.include.call(this,a,b,false)};this.global.include=this.global.object.include;
this.global.BlobBuilder=function(){if(window.google&&google.gears)this.___builder=google.gears.factory.create("beta.blobbuilder");else this.___bloblist=[]};this.global.object.BlobBuilder=this.global.BlobBuilder;inject_proto(this.global.BlobBuilder,BlobBuilder);this.global.BlobBuilder.prototype.getAsBlob=BlobBuilder.prototype.getAsBlob;this.global.BlobBuilder.prototype.append=BlobBuilder.prototype.append;this.global.JSON={stringify:function(b,f,d){return typeof f==="function"?JSON.stringify(b,f,d):
JSON.native_stringify?JSON.native_stringify(b,f,d):JSON.stringify(b,f,d)},parse:function(b,f){return JSON.parse(b,f)}};this.global.object.canSerialize=getFixedStorage()?true:false;this.security.object=this.sec_object={};for(var c in this.global.object)this.security.object[c]=this.global.object[c];this.global.object.JNEXT={init:function(){if(window.JNEXT)return!!objJSExt.sendCmd;else eos_om.jnext_init(a)},UdpSocket:function(){return new JNEXT_UdpSocket(a)},AsyncLineSocket:function(){return new JNEXT_AsyncLineSocket(a)}};
this.bind_storage()};function inject_proto(a,c){for(var b in c.prototype)a.prototype[b]=c.prototype[b]}function FixedStorage(){}FixedStorage.prototype.___init=function(a){this.___vm=a;this.___ls=google.gears.factory.create("beta.localserver");a=this.___vm.uri.split("/").join(".");this.___r=this.___ls.openStore(a);if(!this.___r)this.___r=this.___ls.createStore(a)};FixedStorage.prototype.remove=function(a){this.___r.remove(this.___vm.uri+"/~blobs/"+a)};
FixedStorage.prototype.rename=function(a,c){this.___r.rename(this.___vm.uri+"/~blobs/"+a,this.___vm.uri+"/~blobs/"+c)};FixedStorage.prototype.copy=function(a,c){this.___r.copy(this.___vm.uri+"/~blobs/"+a,this.___vm.uri+"/~blobs/"+c)};FixedStorage.prototype.isStored=function(a){return this.___r.isCaptured(this.___vm.uri+"/~blobs/"+a)};
FixedStorage.prototype.storeBlob=function(a,c,b){a=a.___blob;if(!a)throw"storeBlob: first argument must be a BlobObject with Gears installed";b?this.___r.captureBlob(a,this.___vm.uri+"/~blobs/"+c,b):this.___r.captureBlob(a,this.___vm.uri+"/~blobs/"+c)};FixedStorage.prototype.getAsBlob=function(a){if(this.isStored(a)){var c=new BlobObject;c.___blob=this.___r.getAsBlob(this.___vm.uri+"/~blobs/"+a);return c}else return null};
FixedStorage.prototype.getObjectUrl=function(a){return this.___vm.uri+"/~blobs/"+a};FixedStorage.prototype.getAllHeaders=function(a){return this.isStored(a)?this.___r.getAllHeaders(this.___vm.uri+"/~blobs/"+a):null};Jnaric.prototype.bind_storage=function(){if(window.google&&google.gears){var a=this;this.global.object.FixedStorage=function(){this.___init(a)};inject_proto(this.global.object.FixedStorage,FixedStorage);this.global.object.openFiles=function(c,b){eos_om.openFiles(a,c,b)}}};
Jnaric.prototype.bind_terminal=function(){var a=this;for(var c in KCONFIG){this.kconfig_r.push(c);this.kconfig_w.push(c)}for(c in KCONFIG_DEFAULTS){this.kconfig_r.push(c);this.kconfig_w.push(c)}this.GRANTED=true;this.global.__createObject=function(b,f,d,g,k,h,l){return eos_createObject(a,b,f,d,g,k,h,l)};this.global.object.createObject=this.global.__createObject;this.global.object.kbind=function(b,f,d,g){return eos_om.kbind(a,b,f,d,g)};this.bind_serial()};
Jnaric.prototype.bind_serial=function(){var a=this,c=getFixedStorage();if(c){this.global.object.serializeURI=function(b,f){if(typeof f=="undefined")f=false;var d=a.cur_stack,g=d.my.x2;if(f){d.EXCEPTION=false;d.STOP=true}var k=__eos_objects.terminal.getChild(b.split("/")),h=function(){if(f){g.result=1;d.EXCEPTION=RETURN;d.STOP=false;__jn_stacks.start(d.pid)}},l=function(m){if(f){d.EXCEPTION=THROW;d.exc.result=m;d.STOP=false;__jn_stacks.start(d.pid)}};if(f)k.serialize(h,l);else return k.serialize(h,
l)};this.global.object.swapoutURI=function(b,f){return __eos_objects.terminal.getChild(b.split("/")).swapout(f)};this.global.object.listSystemObjects=eos_om.listSystemObjects;this.global.object.getReleaseLength=eos_om.getReleaseLength;this.global.object.getSerializeLength=eos_om.getSerializeLength;this.global.object.getReleaseObj=eos_om.getReleaseObj;this.global.object.getSerializeObj=eos_om.getSerializeObj;this.global.object.delReleaseObj=eos_om.delReleaseObj;this.global.object.delSerializeObj=eos_om.delSerializeObj;
this.global.object.register_serializer=function(b){eos_om.register_serializer(a,b)};c.close()}delete c};
(function(){Orbited={};Orbited.settings={};Orbited.settings.hostname=document.domain;Orbited.settings.port=location.port.length>0?location.port:80;Orbited.settings.protocol=location.protocol.slice(0,-1);Orbited.settings.log=false;Orbited.settings.streaming=true;Orbited.settings.HEARTBEAT_TIMEOUT=6E3;Orbited.settings.POLL_INTERVAL=2E3;Orbited.settings.pageLoggerHeight="200px";Orbited.settings.pageLoggerWidth=null;Orbited.settings.enableFFPrivileges=false;Orbited.singleton={};Orbited.Errors={};Orbited.Errors.ConnectionTimeout=
101;Orbited.Errors.InvalidHandshake=102;Orbited.Errors.UserConnectionReset=103;Orbited.Errors.Unauthorized=106;Orbited.Errors.RemoteConnectionFailed=108;Orbited.Statuses={};Orbited.Statuses.ServerClosedConnection=201;Orbited.Statuses.SocketControlKilled=301;Orbited.util={};Orbited.util.browser=null;if(typeof ActiveXObject!="undefined")Orbited.util.browser="ie";else if(navigator.userAgent.indexOf("WebKit")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1)Orbited.util.browser="webkit";else if(navigator.product==
"Gecko"&&window.find&&!navigator.savePreferences)Orbited.util.browser="firefox";else if(typeof window.addEventStream==="function")Orbited.util.browser=opera.version()>=10.5?"opera10_5":"opera";(function(){Orbited.base64={};if(window.btoa&&window.btoa("1")=="MQ=="){Orbited.base64.encode=function(d){return btoa(d)};Orbited.base64.decode=function(d){return atob(d)}}else{Orbited.base64.encode=function(d){var g=[],k=d.length,h=k%3;k=k-h;for(var l=0;l<k;){var m=d.charCodeAt(l++)<<16|d.charCodeAt(l++)<<
8|d.charCodeAt(l++);g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>18&63));g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>12&63));g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>6&63));g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m&63))}switch(h){case 2:m=d.charCodeAt(l++)<<16|d.charCodeAt(l++)<<8;g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>
18&63));g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>12&63));g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>6&63));g.push("=");break;case 1:m=d.charCodeAt(l++)<<16;g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>18&63));g.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m>>>12&63));g.push("=");g.push("=");break}return g.join("")};Orbited.base64.decode=function(d){d=
d.split("");for(var g=[],k=d.length,h=0;d[--k]=="=";)++h;for(var l=0;l<k;){var m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[l++])<<18;if(l<=k)m|="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[l++])<<12;if(l<=k)m|="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[l++])<<6;if(l<=k)m|="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[l++]);g.push(String.fromCharCode(m>>>16&255));g.push(String.fromCharCode(m>>>
8&255));g.push(String.fromCharCode(m&255))}for(;h--;)g.pop();return g.join("")}}})();Orbited.loggers={};Orbited.Loggers={};Orbited.util.loggingSystem=null;if(window.Log4js)Orbited.util.loggingSystem="log4js";else if(window.console&&console.firebug&&console.firebug!="1.3.0")Orbited.util.loggingSystem="firebug";Orbited.getLogger=function(d){if(!Orbited.loggers[d]){var g=null;switch(Orbited.util.loggingSystem){case "firebug":g=new Orbited.Loggers.FirebugLogger(d);break;case "log4js":g=new Orbited.Loggers.Log4jsLogger(d);
break;default:g=new Orbited.Loggers.PageLogger(d);break}Orbited.loggers[d]=g}return Orbited.loggers[d]};Orbited.Loggers.FirebugLogger=function(d){var g=this;g.name=d;g.enabled=false;var k=function(h){for(var l=[d+":"],m=0;m<h.length;++m)l.push(h[m]);return l};g.log=function(){g.enabled&&console.log.apply(this,k(arguments))};g.debug=function(){g.enabled&&console.debug.apply(this,k(arguments))};g.info=function(){g.enabled&&console.info.apply(this,k(arguments))};g.warn=function(){g.enabled&&console.warn.apply(this,
k(arguments))};g.error=function(){g.enabled&&console.error.apply(this,k(arguments))};g.assert=function(){if(g.enabled){for(var h=[arguments[0],d+":"],l=1;l<arguments.length;++l)h.push(arguments[l]);console.assert.apply(this,h)}};g.trace=function(){g.enabled&&console.trace.apply(this,k(arguments))}};Orbited.singleton.pageLoggerPane=null;Orbited.Loggers.PageLogger=function(d){var g=this;g.enabled=false;g.name=d;var k=function(h){if(!Orbited.singleton.pageLoggerPane){var l=document.createElement("div");
l.border="1px solid black";if(Orbited.settings.pageLoggerHeight)l.style.height=Orbited.settings.pageLoggerHeight;if(Orbited.settings.pageLoggerWidth)l.style.height=Orbited.settings.pageLoggerWidth;l.style.overflow="scroll";document.body.appendChild(l);Orbited.singleton.pageLoggerPane=l}l=document.createElement("div");l.innerHTML=h;Orbited.singleton.pageLoggerPane.appendChild(l);Orbited.singleton.pageLoggerPane.scrollTop=Orbited.singleton.pageLoggerPane.scrollHeight};g.log=function(){if(g.enabled){for(var h=
["log",new Date,"debug","<b>"+d+"</b>"],l=0;l<arguments.length;++l)h.push(arguments[l]);k(h.join(", "))}};g.debug=function(){if(g.enabled){for(var h=[new Date,"debug","<b>"+d+"</b>"],l=0;l<arguments.length;++l)h.push(arguments[l]);k(h.join(", "))}};g.info=function(){if(g.enabled){for(var h=[new Date,"info","<b>"+d+"</b>"],l=0;l<arguments.length;++l)h.push(arguments[l]);k(h.join(", "))}};g.warn=function(){};g.error=function(){};g.assert=function(){};g.trace=function(){}};Orbited.Loggers.Log4jsLogger=
function(d){for(var g=this.name=d;g.indexOf(".")!=-1;)g=g.replace(".","_");var k=Log4js.getLogger(g);this.logger=k;k.setLevel(Log4js.Level.OFF);var h=function(l){for(var m=[d+":"],q=0;q<l.length;++q)m.push(l[q]);return m.join(" ")};this.setLevel=function(l){k.setLevel(l)};this.addAppender=function(l){k.addAppender(l)};this.log=function(){k.info(h(arguments))};this.debug=function(){k.debug(h(arguments))};this.info=function(){k.info(h(arguments))};this.warn=function(){k.warn(h(arguments))};this.error=
function(){k.error(h(arguments))};this.assert=function(){};this.trace=function(){}};Orbited.system=Orbited.getLogger("system");Orbited.CometTransports={};Orbited.util.chooseTransport=function(){if(Orbited.settings.streaming==false||Orbited.util.browser=="webkit")return Orbited.CometTransports.LongPoll;var d=[];for(var g in Orbited.CometTransports){var k=Orbited.CometTransports[g];if(typeof k[Orbited.util.browser]=="number"){Orbited.system.log("viable transport: ",g);d.push(k)}}return d[0]};var a=
function(){try{return new XMLHttpRequest}catch(d){}try{return new ActiveXObject("MSXML3.XMLHTTP")}catch(g){}try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(k){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(h){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(l){}throw Error("Could not find XMLHttpRequest or an alternative.");};Orbited.legacy={};Orbited.CometSession=function(){var d=this;d.readyState=d.READY_STATE_INITIALIZED;d.onopen=function(){};d.onread=function(){};d.onclose=
function(){};var g=null,k=null,h=[],l=0,m=null,q=null,s=3E4,o=3E4,p=null,n=0,r=false,w=null,u=function(){var B=A([[++l,"close"]]);if(w)w.contentWindow.sendCloseFrame(g.render(),B);else{m.open("POST",g.render(),!g.isSameDomain(location.href));m.send(B)}};d.open=function(B){d.logger.debug("open");d.readyState=d.READY_STATE_OPENING;g=new Orbited.URL(B);if(g.isSameDomain(location.href))m=a();else{m=new Orbited.XSDR;if(g.isSamePort(location.href)){w=document.createElement("iframe");w.style.display="block";
w.style.width="0";w.style.height="0";w.style.border="0";w.style.margin="0";w.style.padding="0";w.style.overflow="hidden";w.style.visibility="hidden";var D=new Orbited.URL("");D.protocol=Orbited.settings.protocol;D.domain=Orbited.settings.hostname;D.port=Orbited.settings.port;D.path="/static/xsdClose.html";D.hash=document.domain;w.src=D.render();document.body.appendChild(w)}}if(Orbited.settings.enableFFPrivileges)try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(F){}m.open("GET",
B,true);m.onreadystatechange=function(){if(m.readyState==4)if(m.status==200){k=m.responseText;d.logger.debug("session key is: ",k);E();if(g.path[g.path.length]!="/")g.path+="/";g.path+=k;q=new (Orbited.util.chooseTransport());q.timeoutResetter=E;q.isSubDomain=g.isSubDomain(location.href);q.onReadFrame=y;q.onclose=x;q.connect(g.render())}else{m=null;d.readyState=d.READY_STATE_CLOSED;d.onclose(Orbited.Errors.InvalidHandshake)}};m.send(null)};d.send=function(B){d.logger.debug("send",B);if(d.readyState!=
d.READY_STATE_OPEN)throw Error("Invalid readyState");B=Orbited.base64.encode(B);h.push([++l,"data",B]);d.logger.debug("sending ==",r);if(!r){d.logger.debug("starting send");z()}};d.close=function(){switch(d.readyState){case d.READY_STATE_CLOSING:case d.READY_STATE_CLOSED:return;case d.READY_STATE_INITIALIZED:d.readyState=d.READY_STATE_CLOSED;return;default:break}d.readyState=d.READY_STATE_CLOSING;h.push([++l,"close"]);r||z()};d.reset=function(){d.logger.debug("reset");var B=d.readyState;d.readyState=
d.READY_STATE_CLOSED;switch(B){case d.READY_STATE_INITIALIZED:d.onclose(Orbited.Errors.UserConnectionReset);break;case d.READY_STATE_OPENING:m.onreadystatechange=function(){};m.abort();d.onclose(Orbited.Errors.UserConnectionReset);break;case d.READY_STATE_OPEN:d.sendQueue=[];d.sending=false;if(m.readyState<4){m.onreadystatechange=function(){};m.abort()}C(Orbited.Errors.UserConnectionReset);u();break;case d.READY_STATE_CLOSING:break;case d.READY_STATE_CLOSED:break}};d.cleanup=function(){d.readyState=
d.READY_STATE_CLOSED;q.close()};var y=function(B){d.logger.debug("transportOnReadFrame");d.logger.debug("READ FRAME: ",B.id,B.name,B.data?B.data.length:"");isNaN(B.id)||(n=Math.max(n,B.id));d.logger.debug(B);switch(B.name){case "close":d.readyState<d.READY_STATE_CLOSED&&C(Orbited.Statuses.ServerClosedConnection);break;case "data":d.logger.debug("base64 decoding "+B.data.length+" bytes of data");B=Orbited.base64.decode(B.data);d.logger.debug("decode complete");d.onread(B);break;case "open":if(d.readyState==
d.READY_STATE_OPENING){d.readyState=d.READY_STATE_OPEN;d.logger.debug("Call self.onopen()");d.onopen()}break;case "ping":switch(q.name){case "longpoll":break;case "poll":break;default:h.push([++l,"ping",null]);r||z();break}break;case "opt":B=B.data.split(",");switch(B[0]){case "pingTimeout":o=parseInt(B[1])*1E3;break;case "pingInterval":s=parseInt(B[1])*1E3;break;default:d.logger.warn("unknown opt key",B[0]);break}break}d.logger.debug("resetting timeout from transportOnReadFrame");E()},x=function(){d.logger.debug("transportOnClose");
if(d.readyState<d.READY_STATE_CLOSED)try{C(Orbited.Statuses.ServerClosedConnection)}catch(B){}},A=function(B){for(var D=[],F=0;F<B.length;++F)for(var G=B[F],H=0;H<G.length;++H){var I=G[H];if(I==null)I="";H==G.length-1?D.push("0"):D.push("1");D.push(I.toString().length);D.push(",");D.push(I.toString())}return D.join("")},z=function(B){d.logger.debug("in doSend");if(typeof B=="undefined")B=0;if(B*250>=3E4){C(Orbited.Errors.ConnectionTimeout);r=false}else if(h.length==0){d.logger.debug("sendQueue exhausted");
r=false}else{r=true;d.logger.debug("setting sending=true");var D=h.length;g.setQsParameter("ack",n);var F=A(h);d.logger.debug("post",B,F);if(Orbited.settings.enableFFPrivileges)try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(G){}m.open("POST",g.render(),true);m.onreadystatechange=function(){d.logger.debug("doSend onreadystatechange");switch(m.readyState){case 4:if(m.status==200){E();h.splice(0,D);return z()}else window.setTimeout(function(){z(++B)},250);break}};
m.send(F)}},C=function(B){d.logger.debug("doClose",B);window.clearTimeout(p);d.readyState=d.READY_STATE_CLOSED;if(q!=null){q.onReadFrame=function(){};q.onclose=function(){};q.close()}d.onclose(B)},E=function(){d.logger.debug("reset Timeout",s+o);window.clearTimeout(p);p=window.setTimeout(J,s+o)},J=function(){d.logger.debug("timed out!");C(Orbited.Errors.ConnectionTimeout)}};Orbited.CometSession.prototype.logger=Orbited.getLogger("Orbited.CometSession");Orbited.CometSession.prototype.READY_STATE_INITIALIZED=
1;Orbited.CometSession.prototype.READY_STATE_OPENING=2;Orbited.CometSession.prototype.READY_STATE_OPEN=3;Orbited.CometSession.prototype.READY_STATE_CLOSING=4;Orbited.CometSession.prototype.READY_STATE_CLOSED=5;var c=0,b={};Orbited.test={};Orbited.test.logger=Orbited.getLogger("Orbited.test");Orbited.test.socketcontrol={};Orbited.test.socketcontrol.kill=function(d){Orbited.test.logger.debug("kill ordered for socket:",d);if(b[d.id]){b[d.id](Orbited.Statuses.SocketControlKilled);Orbited.test.logger.debug("socket killed")}else Orbited.test.logger.debug("socket not found")};
Orbited.test.stompdispatcher={};Orbited.test.stompdispatcher.send=function(d,g){Orbited.test.logger.debug("stompdispatcher dispatching "+g+" to "+d);var k=document.createElement("script");k.src="http://"+Orbited.settings.hostname+":"+Orbited.settings.port+"/system/test/stomp?";k.src+="msg="+g;k.src+="&dest="+d;document.body.appendChild(k)};Orbited.TCPSocket=function(){var d=this;d.id=++c;if(arguments.length>0)throw Error("TCPSocket() accepts no arguments");d.readyState=d.READY_STATE_INITIALIZED;d.onopen=
function(){};d.onread=function(){};d.onclose=function(){};var g=false,k="",h=null,l=false,m=null,q=null,s=null;d.open=function(u,y,x){if(d.readyState!=d.READY_STATE_INITIALIZED)throw Error("Invalid readyState");if(u==false)throw Error("No hostname specified");if(isNaN(y))throw Error("Invalid port specified");l=!!x;d.readyState=d.READY_STATE_OPENING;q=u;s=y;h=new Orbited.CometSession;u=new Orbited.URL("/tcp");u.domain=Orbited.settings.hostname;u.port=Orbited.settings.port;u.protocol=Orbited.settings.protocol;
u.setQsParameter("nocache",Math.random());h.open(u.render());h.onopen=r;h.onread=p;h.onclose=w;m="initial"};d.close=function(){if(d.readyState!=d.READY_STATE_CLOSED){d.readyState=d.READY_STATE_CLOSED;n(Orbited.Errors.UserConnectionReset)}};d.reset=function(){h&&h.reset()};d.send=function(u){if(d.readyState!=d.READY_STATE_OPEN)throw Error("Invalid readyState");l||(u=Orbited.utf8.encode(u));d.logger.debug("SEND: ",u);h.send(u)};var o=function(){var u=Orbited.utf8.decode(k),y=u[0];k=k.slice(u[1]);y.length>
0&&window.setTimeout(function(){d.onread(y)},0)},p=function(u){switch(d.readyState){case d.READY_STATE_OPEN:d.logger.debug("READ: ",u);if(l)window.setTimeout(function(){d.onread(u)},0);else{d.logger.debug("start buffer size:",k.length);k+=u;o();d.logger.debug("end buffer size:",k.length)}break;case d.READY_STATE_OPENING:switch(m){case "initial":u=Orbited.utf8.decode(u)[0];d.logger.debug("initial");d.logger.debug("data",u);d.logger.debug("len",u.length);d.logger.debug("typeof(data)",typeof u);d.logger.debug("data[0] ",
u.slice(0,1));d.logger.debug("type ",typeof u.slice(0,1));var y=u.slice(0,1)=="1";d.logger.debug("result",y);if(!y){d.logger.debug("!result");var x=u.slice(1,4);n(parseInt(x))}if(y){d.readyState=d.READY_STATE_OPEN;d.logger.debug("tcpsocket.onopen..");d.onopen();d.logger.debug("did onopen")}break}break}},n=function(u){d.logger.debug("doClose",u);if(h){if(u==Orbited.Statuses.ServerClosedConnection||u==Orbited.Errors.Unauthorized||u==Orbited.Errors.RemoteConnectionFailed)h.cleanup();else{w=function(){};
h.close()}h=null}d.logger.debug("onCloseTriggered",g);if(!g){d.logger.debug("triggerClose timer",u);g=true;window.setTimeout(function(){d.logger.debug("onclose!",u);d.onclose(u)},0)}};b[d.id]=n;var r=function(){var u=q+":"+s+"\n";d.logger.debug("sessionOpen; sending:",u);u=Orbited.utf8.encode(u);d.logger.debug("encoded payload:",u);X=u;h.send(u);m="initial"},w=function(u){d.logger.debug("sessionOnClose");n(u)}};Orbited.TCPSocket.prototype.toString=function(){return"<Orbited.TCPSocket "+this.id+">"};
Orbited.TCPSocket.prototype.logger=Orbited.getLogger("Orbited.TCPSocket");Orbited.TCPSocket.prototype.READY_STATE_INITIALIZED=1;Orbited.TCPSocket.prototype.READY_STATE_OPENING=2;Orbited.TCPSocket.prototype.READY_STATE_OPEN=3;Orbited.TCPSocket.prototype.READY_STATE_CLOSING=4;Orbited.TCPSocket.prototype.READY_STATE_CLOSED=5;Orbited.singleton.XSDR={receiveCbs:{},queues:{},iframes:{},id:0,register:function(d,g){var k=++Orbited.singleton.XSDR.id;Orbited.singleton.XSDR.receiveCbs[k]=d;Orbited.singleton.XSDR.queues[k]=
g;Orbited.system.debug("id is",k);return k}};Orbited.XSDR=function(){var d=this,g=null,k,h,l,m,q=[],s=Orbited.singleton.XSDR.register(function(n){d.logger.debug("received",n);switch(n[0]){case "initialized":q.push([h,k,l,m]);d.logger.debug("queue is",q);d.logger.debug("Orbited.singleton.XSDR.queues[id] is",Orbited.singleton.XSDR.queues[s]);break;case "readystatechange":l=n[1];d.readyState=l.readyState;d.logger.debug("readystatechange",d.readyState);if(l.status){d.status=l.status;d.logger.debug("status",
l.status)}if(l.responseText){d.responseText+=l.responseText;d.logger.debug("responseText",l.responseText)}d.logger.debug("doing trigger");d.onreadystatechange();d.logger.debug("trigger complete");break}},q),o=new Orbited.URL("");o.domain=Orbited.settings.hostname;o.port=Orbited.settings.port;o.path="/static/xsdrBridge.html";o.hash=s.toString();o.protocol=Orbited.settings.protocol;d.logger.debug("bridgeUrl.hash is",o.hash);d.logger.debug("bridgeUrl.path is",o.path);d.logger.debug("bridgeUrl is",o.render());
var p=function(){d.responseText="";d.status=null;d.readyState=0;l=h=k=null;m={}};p();d.onreadystatechange=function(){};d.open=function(n,r,w){d.readyState==4&&p();if(d.readyState!=0)throw Error("Invalid readyState");if(!w)throw Error("Only Async XSDR supported");d.logger.debug("open",n,r,w);d.readyState=1;k=r;h=n};d.send=function(n){if(d.readyState!=1)throw Error("Invalid readyState");d.logger.debug("send",n);if(g)q.push([h,k,n,m]);else{d.logger.debug("creating iframe");n=g=document.createElement("iframe");
n.style.display="block";n.style.width="0";n.style.height="0";n.style.border="0";n.style.margin="0";n.style.padding="0";n.style.overflow="hidden";n.style.visibility="hidden";g.src=o.render();d.logger.debug("set ifr.src to",g.src);document.body.appendChild(g);Orbited.singleton.XSDR.iframes[s]=g}};d.abort=function(){if(d.readyState>0&&d.readyState<4){d.logger.debug("ABORT called");g.src="about:blank";document.body.removeChild(g);g=null;d.readyState=4;d.onreadystatechange()}};d.setRequestHeader=function(n,
r){if(d.readyState!=0)throw Error("Invalid readyState");m[n]=r};d.getResponseHeader=function(){if(d.readyState<2)throw Error("Invalid readyState");return responseHeaders[key]}};if(Orbited.util.browser=="opera"||Orbited.util.browser=="opera10_5"){var f=window.postMessage&&"contentWindow"||"document";(window.postMessage&&window||document).addEventListener("message",function(d){var g=d.data.split(" "),k=g.shift();if(k=="event"){var h=g.shift(),l=g.join(" ");l=Orbited.JSON.parse(l);Orbited.singleton.XSDR.receiveCbs[h](l)}if(k==
"queues"){h=g.shift();g=Orbited.singleton.XSDR.queues[h];if(g.length>0){l=g.shift();Orbited.singleton.XSDR.iframes[h][f].postMessage(Orbited.JSON.stringify(l),d.origin)}}},false)}Orbited.XSDR.prototype.logger=Orbited.getLogger("Orbited.XSDR");Orbited.singleton.XSDRBridgeLogger=Orbited.getLogger("XSDRBridge");Orbited.CometTransports.XHRStream=function(){var d=this;d.name="xhrstream";var g=null,k=null,h=null,l=0,m=null,q=null,s=50;d.readyState=0;d.onReadFrame=function(){};d.onread=function(A){d.onReadFrame(A)};
d.onclose=function(){};d.close=function(){if(d.readyState!=2){if(k!=null&&(k.readyState>1||k.readyState<4)){k.onreadystatechange=function(){};k.abort();k=null}d.readyState=2;window.clearTimeout(m);window.clearTimeout(q);d.onclose()}};d.connect=function(A){if(d.readyState==1)throw Error("Already Connected");g=new Orbited.URL(A);if(k==null)k=g.isSameDomain(location.href)?a():new Orbited.XSDR;g.path+="/xhrstream";d.readyState=1;o()};var o=function(){try{typeof h=="number"&&g.setQsParameter("ack",h);
if(typeof k=="undefined"||k==null)throw Error("how did this happen?");if(Orbited.settings.enableFFPrivileges)try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(A){}k.open("GET",g.render(),true);k.onreadystatechange=function(){d.logger.debug(k.readyState);if(d.readyState!=2)switch(k.readyState){case 2:try{var C=k.status}catch(E){return}if(C==200)try{m=window.setTimeout(x,Orbited.settings.HEARTBEAT_TIMEOUT)}catch(J){d.close();return}break;case 3:try{C=k.status}catch(B){return}if(C==
200){s=50;u()}break;case 4:C=true;try{C=k.status===null?true:false}catch(D){}if(C){s*=2;window.clearTimeout(m);q=window.setTimeout(p,s);return}switch(k.status){case 200:u();l=0;setTimeout(o,0);window.clearTimeout(m);break;case 404:d.close();break;default:d.close();break}break}};k.send(null)}catch(z){d.close()}},p=function(){d.logger.debug("reconnect...");if(k.readyState<4&&k.readyState>0){k.onreadystatechange=function(){k.readyState==4&&p()};d.logger.debug("do abort..");k.abort();window.clearTimeout(m)}else{d.logger.debug("reconnect do open");
l=0;setTimeout(o,0)}},n=-1,r=null,w=[],u=function(){var A=k.responseText;for(y();A[l]==" ";)l+=1;for(;A[l]=="x";)l+=1;for(var z=0;;){z+=1;if(z>2E3)throw Error("Borked XHRStream transport");if(n==-1)n=A.indexOf(",",l);if(n==-1)return;if(r==null){argSize=parseInt(A.slice(l+1,n));r=n+1+argSize}if(A.length<r)return;var C=A.slice(n+1,r);w.push(C);C=A.charAt(l)=="0";l=r;r=null;n=-1;if(C){C=w;w=[];C=C;var E=parseInt(C[0]);isNaN(E)||(h=E);d.onread({id:E,name:C[1],data:C[2]})}}},y=function(){window.clearTimeout(m);
d.logger.debug("clearing heartbeatTimer",m);try{m=window.setTimeout(function(){d.logger.debug("timer",z,"did it");x()},Orbited.settings.HEARTBEAT_TIMEOUT)}catch(A){return}var z=m;d.logger.debug("heartbeatTimer is now",m)},x=function(){d.logger.debug("heartbeat timeout... reconnect");p()}};Orbited.CometTransports.XHRStream.prototype.logger=Orbited.getLogger("Orbited.CometTransports.XHRStream");Orbited.CometTransports.XHRStream.firefox=1;Orbited.CometTransports.XHRStream.firefox2=1;Orbited.CometTransports.XHRStream.firefox3=
1;Orbited.CometTransports.XHRStream.safari2=1;Orbited.CometTransports.XHRStream.safari3=1;Orbited.CometTransports.LongPoll=function(){var d=this;d.name="longpoll";var g=null,k=null,h=null,l=50;d.readyState=0;d.onReadFrame=function(){};d.onclose=function(){};d.close=function(){d.logger.debug("close");if(d.readyState!=2){if(k!=null&&(k.readyState>1||k.readyState<4)){k.onreadystatechange=function(){};k.abort();k=null}d.logger.debug("close! self.readyState now is 2");d.readyState=2;window.clearTimeout(null);
d.onclose()}};d.connect=function(s){d.logger.debug("connect");if(d.readyState==1)throw Error("Already Connected");g=new Orbited.URL(s);if(k==null)k=g.isSameDomain(location.href)?a():new Orbited.XSDR;g.path+="/longpoll";d.readyState=1;m()};var m=function(){d.logger.debug("open... self.readyState = "+d.readyState);if(d.readyState!=2)try{typeof h=="number"&&g.setQsParameter("ack",h);if(typeof k=="undefined"||k==null)throw Error("how did this happen?");if(Orbited.settings.enableFFPrivileges)try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(s){}g.setQsParameter("nocache",
Math.random());k.open("GET",g.render(),true);k.onreadystatechange=function(){d.logger.debug("readystate",k.readyState);switch(k.readyState){case 4:switch(k.status){case 200:d.timeoutResetter();a:{d.logger.debug("process");for(var p=-1,n=null,r,w=[],u=k.responseText,y=0,x=0;;){x+=1;if(x>2E3)throw Error("Borked XHRStream transport");if(p==-1)p=u.indexOf(",",y);if(p==-1){d.logger.debug("no more commas. offset:",y,"stream.length:",u.length);break a}if(n==null){r=parseInt(u.slice(y+1,p));n=p+1+r}d.logger.assert(true);
p=u.slice(p+1,n);d.logger.assert(p.length==r,"argSize:",r,"data.length",p.length);if(p.length!=r)DEBUGDATA=u;w.push(p);var A=u.charAt(y)=="0";y=n;n=null;p=-1;if(A){A=w;w=[];A=A;var z=parseInt(A[0]);d.logger.debug("args",A);isNaN(z)||(h=z);d.logger.debug("testAckId",z,"ackId",h);d.onReadFrame({id:z,name:A[1],data:A[2]})}}}d.logger.debug("completed request, reconnect immediately");setTimeout(m,0);break;case 404:d.close();break;case null:l*=2;d.logger.debug("start reconnect Timer (null xhr.status)");
window.setTimeout(q,l);break;default:d.logger.debug("something broke, xhr.status=",k.status);d.close();break}break}};k.send(null)}catch(o){d.close()}},q=function(){d.logger.debug("reconnect...");if(k.readyState<4&&k.readyState>0){k.onreadystatechange=function(){k.readyState==4&&q()};d.logger.debug("do abort..");k.abort();window.clearTimeout(heartbeatTimer)}else{d.logger.debug("reconnect do open");offset=0;setTimeout(m,0)}}};Orbited.CometTransports.LongPoll.prototype.logger=Orbited.getLogger("Orbited.CometTransports.LongPoll");
Orbited.CometTransports.LongPoll.opera10_5=1;Orbited.CometTransports.Poll=function(){var d=this;d.name="poll";var g=null,k=null,h=null,l=Orbited.settings.POLL_INTERVAL,m=l;d.readyState=0;d.onReadFrame=function(){};d.onclose=function(){};d.close=function(){d.logger.debug("close...");if(d.readyState!=2){if(k!=null&&(k.readyState>1||k.readyState<4)){k.onreadystatechange=function(){};k.abort();k=null}d.readyState=2;window.clearTimeout(null);d.onclose()}};d.connect=function(o){d.logger.debug("connect...");
if(d.readyState==1)throw Error("Already Connected");g=new Orbited.URL(o);if(k==null)k=g.isSameDomain(location.href)?a():new Orbited.XSDR;g.path+="/poll";d.readyState=1;q()};var q=function(){d.logger.debug("open...");try{typeof h=="number"&&g.setQsParameter("ack",h);if(typeof k=="undefined"||k==null)throw Error("how did this happen?");if(Orbited.settings.enableFFPrivileges)try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(o){}k.open("GET",g.render(),true);k.onreadystatechange=
function(){switch(k.readyState){case 4:switch(k.status){case 200:d.timeoutResetter();m=l;a:{d.logger.debug("process...");for(var n=-1,r=null,w,u=[],y=k.responseText,x=0,A=0;;){A+=1;if(A>2E3)throw Error("Borked XHRStream transport");if(n==-1)n=y.indexOf(",",x);if(n==-1){d.logger.debug("no more commas. offset:",x,"stream.length:",y.length);break a}if(r==null){w=parseInt(y.slice(x+1,n));r=n+1+w}n=y.slice(n+1,r);d.logger.assert(n.length==w,"argSize:",w,"data.length",n.length);if(n.length!=w)DEBUGDATA=
y;u.push(n);var z=y.charAt(x)=="0";x=r;r=null;n=-1;if(z){z=u;u=[];z=z;d.logger.debug("receivedPacket...");var C=parseInt(z[0]);d.logger.debug("args",z);isNaN(C)||(h=C);d.logger.debug("testAckId",C,"ackId",h);d.onReadFrame({id:C,name:z[1],data:z[2]})}}}setTimeout(q,m);break;case 404:d.close();break;case null:m*=2;window.setTimeout(s,m);break;default:d.close();break}break}};k.send(null)}catch(p){d.close()}},s=function(){d.logger.debug("reconnect...");if(k.readyState<4&&k.readyState>0){k.onreadystatechange=
function(){k.readyState==4&&s()};d.logger.debug("do abort..");k.abort();window.clearTimeout(heartbeatTimer)}else{d.logger.debug("reconnect do open");offset=0;setTimeout(q,0)}}};Orbited.CometTransports.Poll.prototype.logger=Orbited.getLogger("Orbited.CometTransports.Poll");Orbited.CometTransports.HTMLFile=function(){var d=this;d.name="htmlfile";var g=++Orbited.singleton.HTMLFile.i;Orbited.singleton.HTMLFile.instances[g]=d;var k=null,h=null,l=null,m=null,q=null,s=2E3;d.onReadFrame=function(){};d.onread=
function(p){d.onReadFrame(p)};d.onclose=function(){};d.connect=function(p){if(d.readyState==1)throw Error("Already Connected");d.logger.debug("self.connect",p);l=new Orbited.URL(p);l.path+="/htmlfile";l.setQsParameter("frameID",g.toString());d.readyState=1;p=l.render();d.logger.debug("doOpen",p);k=new ActiveXObject("htmlfile");k.open();d.isSubDomain?k.write('<html><script>document.domain="'+document.domain+'";<\/script></html>'):k.write("<html></html>");k.parentWindow.Orbited=Orbited;k.close();var n=
k.createElement("div");k.body.appendChild(n);h=k.createElement("iframe");n.appendChild(h);m=h.src=p;q=window.setTimeout(o,s)};d.restartingStream=function(p){m=p;q=window.setTimeout(o,s)};var o=function(){d.logger.debug("doing reconnect... "+s);s*=2;h.src=m;q=window.setTimeout(o,s)};d.streamStarted=function(){d.logger.debug("stream started..");window.clearTimeout(q);q=null;s=2E3};d.streamClosed=function(){d.logger.debug("stream closed!");window.clearTimeout(q);d.close()};d.receive=function(p,n,r){packet=
{id:p,name:n,data:r};d.onread(packet)};d.close=function(){if(d.readyState!=2){d.logger.debug("close called, clearing timer");window.clearTimeout(q);d.readyState=2;h.src="about:blank";k=null;CollectGarbage();d.onclose()}}};Orbited.CometTransports.HTMLFile.prototype.logger=Orbited.getLogger("Orbited.CometTransports.HTMLFile");Orbited.CometTransports.HTMLFile.ie=1;Orbited.singleton.HTMLFile={i:0,instances:{}};Orbited.CometTransports.SSE=function(){var d=this;d.name="sse";d.onReadFrame=function(){};d.onclose=
function(){};d.readyState=0;var g=null,k=null,h=-1;d.close=function(){if(d.readyState!=2){d.readyState=2;doClose();d.onclose()}};d.connect=function(m){if(d.readyState==1)throw Error("Already Connected");k=new Orbited.URL(m);k.path+="/sse";d.readyState=1;doOpen()};doClose=function(){g.removeEventSource(g.getAttribute("src"));g.setAttribute("src","");opera.version()<9.5&&document.body.removeChild(g);g=null};doOpen=function(){g=document.createElement("event-source");g.setAttribute("src",k.render());
opera.version()<9.5&&document.body.appendChild(g);g.addEventListener("payload",l,false)};var l=function(m){m=eval(m.data);if(typeof m!="undefined")for(var q=0;q<m.length;++q){var s=m[q],o=s[0],p=s[1];s=s[2];var n=parseInt(o);isNaN(n)||(h=n);packet={id:o,name:p,data:s};d.onReadFrame(packet)}}};Orbited.CometTransports.SSE.prototype.logger=Orbited.getLogger("Orbited.CometTransports.SSE");Orbited.CometTransports.SSE.opera=1;Orbited.CometTransports.SSE.opera8=1;Orbited.CometTransports.SSE.opera9=1;Orbited.CometTransports.SSE.opera9_5=
0.8;Orbited.URL=function(d){var g=this,k=d.indexOf("://");if(k!=-1)g.protocol=d.slice(0,k);else k=-3;var h=d.indexOf("/",k+3);if(h==-1)h=d.length;var l=d.indexOf("#",h);if(l!=-1)g.hash=d.slice(l+1);else l=d.length;l=d.slice(h,l);var m=l.indexOf("?");if(m==-1)m=l.length;g.path=l.slice(0,m);g.qs=l.slice(m+1);if(g.path=="")g.path="/";d=d.slice(k+3,h);k=d.indexOf(":");if(k==-1){g.port=80;k=d.length}else g.port=parseInt(d.slice(k+1));if(isNaN(this.port))throw Error("Invalid _url");g.domain=d.slice(0,k);
g.render=function(){var o="";if(typeof g.protocol!="undefined")o+=g.protocol+"://";o+=g.domain;if(g.port!=80&&typeof g.port!="undefined"&&g.port!=null)if(typeof g.port!="string"||g.port.length>0)o+=":"+g.port;o+=typeof g.path=="undefined"||g.path==null?"/":g.path;if(g.qs.length>0)o+="?"+g.qs;if(typeof g.hash!="undefined"&&g.hash.length>0)o+="#"+g.hash;return o};g.isSamePort=function(o){o=new Orbited.URL(o);return o.port==g.port};g.isSameDomain=function(o){o=new Orbited.URL(o);if(!o.domain||!g.domain)return true;
return o.port==g.port&&o.domain==g.domain};g.isSameParentDomain=function(o){o=new Orbited.URL(o);if(o.domain==g.domain)return true;o=o.domain;for(var p=document.domain.split("."),n=0;n<p.length-1;++n){var r=p.slice(n).join(".");if(o==r)return true}return false};g.isSubDomain=function(o){o=new Orbited.URL(o);if(!o.domain||!g.domain)return false;return o.port==g.port&&g.domain.indexOf("."+o.domain)>0};var q=function(o){if(o.indexOf("=")==-1)return{};var p={};o=o.split("&");for(var n=0;n<o.length;++n){var r=
o[n].split("=");p[r[0]]=r[1]}return p},s=function(o){var p="";for(var n in o)p+="&"+n+"="+o[n];return p.slice(1)};g.setQsParameter=function(o,p){var n=q(g.qs);n[o]=p;g.qs=s(n)};g.mergeQs=function(o){o=q(o);for(key in o)curQsObj[key]=o[key]};g.removeQsParameter=function(o){var p=q(g.qs);delete p[o];g.qs=s(p)};g.merge=function(o){if(typeof g.protocol!="undefined"&&g.protocol.length>0)g.protocol=o.protocol;if(o.domain.length>0){g.domain=o.domain;g.port=o.port}g.path=o.path;g.qs=o.qs;g.hash=o.hash}};
Orbited.utf8={};Orbited.utf8.decode=function(d){function g(m){for(;m.length<6;)m="0"+m;return m}for(var k=[],h=0,l=0;l<d.length;l++)if((d.charCodeAt(l)&248)==240){if(d.length-h<4)break;h+=4;k.push(String.fromCharCode(parseInt((d.charCodeAt(l)&7).toString(2)+g((d.charCodeAt(l+1)&63).toString(2))+g((d.charCodeAt(l+2)&63).toString(2))+g((d.charCodeAt(l+3)&63).toString(2)),2)));l+=3}else if((d.charCodeAt(l)&240)==224){if(d.length-h<3)break;h+=3;k.push(String.fromCharCode(parseInt((d.charCodeAt(l)&15).toString(2)+
g((d.charCodeAt(l+1)&63).toString(2))+g((d.charCodeAt(l+2)&63).toString(2)),2)));l+=2}else if((d.charCodeAt(l)&224)==192){if(d.length-h<2)break;h+=2;k.push(String.fromCharCode(parseInt((d.charCodeAt(l)&31).toString(2)+g((d.charCodeAt(l+1)&63).toString(2),6),2)));l+=1}else{h+=1;k.push(String.fromCharCode(d.charCodeAt(l)))}return[k.join(""),h]};Orbited.utf8.encode=function(d){function g(q,s){for(;q.length<s;)q="0"+q;return q}for(var k=[],h=String.fromCharCode,l=0;l<d.length;l++){var m=d.charCodeAt(l);
if(m<=127)k.push(h(m));else if(m<=2047){m=g(m.toString(2),11);k.push(h(parseInt("110"+m.substr(0,5),2)));k.push(h(parseInt("10"+m.substr(5,6),2)))}else if(m<=65535){m=g(m.toString(2),16);k.push(h(parseInt("1110"+m.substr(0,4),2)));k.push(h(parseInt("10"+m.substr(4,6),2)));k.push(h(parseInt("10"+m.substr(10,6),2)))}else if(m<=1114111){m=g(m.toString(2),21);k.push(h(parseInt("11110"+m.substr(0,3),2)));k.push(h(parseInt("10"+m.substr(3,6),2)));k.push(h(parseInt("10"+m.substr(9,6),2)));k.push(h(parseInt("10"+
m.substr(15,6),2)))}}return k.join("")};Orbited.JSON=function(){function d(p){return p<10?"0"+p:p}function g(p){l.lastIndex=0;return l.test(p)?'"'+p.replace(l,function(n){var r=s[n];if(typeof r==="string")return r;return"\\u"+("0000"+(+n.charCodeAt(0)).toString(16)).slice(-4)})+'"':'"'+p+'"'}function k(p,n){var r,w,u,y,x=m,A,z=n[p];if(z&&typeof z==="object"&&typeof z.toJSON==="function")z=z.toJSON(p);if(typeof o==="function")z=o.call(n,p,z);switch(typeof z){case "string":return g(z);case "number":return isFinite(z)?
String(z):"null";case "boolean":case "null":return String(z);case "object":if(!z)return"null";m+=q;A=[];if(typeof z.length==="number"&&!z.propertyIsEnumerable("length")){y=z.length;for(r=0;r<y;r+=1)A[r]=k(r,z)||"null";u=A.length===0?"[]":m?"[\n"+m+A.join(",\n"+m)+"\n"+x+"]":"["+A.join(",")+"]";m=x;return u}if(o&&typeof o==="object"){y=o.length;for(r=0;r<y;r+=1){w=o[r];if(typeof w==="string")if(u=k(w,z))A.push(g(w)+(m?": ":":")+u)}}else for(w in z)if(Object.hasOwnProperty.call(z,w))if(u=k(w,z))A.push(g(w)+
(m?": ":":")+u);u=A.length===0?"{}":m?"{\n"+m+A.join(",\n"+m)+"\n"+x+"}":"{"+A.join(",")+"}";m=x;return u}}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+d(this.getUTCMonth()+1)+"-"+d(this.getUTCDate())+"T"+d(this.getUTCHours())+":"+d(this.getUTCMinutes())+":"+d(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var h=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
l=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,m,q,s={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},o;return{stringify:function(p,n,r){var w;q=m="";if(typeof r==="number")for(w=0;w<r;w+=1)q+=" ";else if(typeof r==="string")q=r;if((o=n)&&typeof n!=="function"&&(typeof n!=="object"||typeof n.length!=="number"))throw Error("JSON.stringify");return k("",{"":p})},parse:function(p,n){function r(u,
y){var x,A,z=u[y];if(z&&typeof z==="object")for(x in z)if(Object.hasOwnProperty.call(z,x)){A=r(z,x);if(A!==undefined)z[x]=A;else delete z[x]}return n.call(u,y,z)}var w;h.lastIndex=0;if(h.test(p))p=p.replace(h,function(u){return"\\u"+("0000"+(+u.charCodeAt(0)).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(p.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){w=eval("("+p+")");return typeof n===
"function"?r({"":w},""):w}throw new SyntaxError("JSON.parse");}}}()})();(function(){try{for(var a=document.getElementsByTagName("script"),c=0;c<a.length;++c){var b=a[c];if(b.src.match("/static/Orbited.js$")){var f=new Orbited.URL(b.src);if(f.render().indexOf("http")!=0)f=new Orbited.URL(window.location.toString());Orbited.settings.hostname=f.domain;Orbited.settings.port=f.port;break}}}catch(d){}})();var whitespace="\n\r\t ";
XMLP=function(a){a=SAXStrings.replace(a,null,null,"\r\n","\n");this.m_xml=a=SAXStrings.replace(a,null,null,"\r","\n");this.m_iP=0;this.m_iState=XMLP._STATE_PROLOG;this.m_stack=new Stack;this._clearAttributes()};XMLP._NONE=0;XMLP._ELM_B=1;XMLP._ELM_E=2;XMLP._ELM_EMP=3;XMLP._ATT=4;XMLP._TEXT=5;XMLP._ENTITY=6;XMLP._PI=7;XMLP._CDATA=8;XMLP._COMMENT=9;XMLP._DTD=10;XMLP._ERROR=11;XMLP._CONT_XML=0;XMLP._CONT_ALT=1;XMLP._ATT_NAME=0;XMLP._ATT_VAL=1;XMLP._STATE_PROLOG=1;XMLP._STATE_DOCUMENT=2;
XMLP._STATE_MISC=3;XMLP._errs=[];XMLP._errs[XMLP.ERR_CLOSE_PI=0]="PI: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_DTD=1]="DTD: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_ELM=4]="Element: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence";XMLP._errs[XMLP.ERR_PI_TARGET=6]="PI: target is required";
XMLP._errs[XMLP.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing";XMLP._errs[XMLP.ERR_ELM_NAME=8]='Element: name must immediatly follow "<"';XMLP._errs[XMLP.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names';XMLP._errs[XMLP.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes";XMLP._errs[XMLP.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names';XMLP._errs[XMLP.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values';
XMLP._errs[XMLP.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed";XMLP._errs[XMLP.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity";XMLP._errs[XMLP.ERR_INFINITELOOP=15]="Infininte loop";XMLP._errs[XMLP.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element";XMLP._errs[XMLP.ERR_ELM_NESTING=17]="Element: must be nested correctly";XMLP.prototype._addAttribute=function(a,c){this.m_atts[this.m_atts.length]=Array(a,c)};
XMLP.prototype._checkStructure=function(a){if(XMLP._STATE_PROLOG==this.m_iState){if(XMLP._TEXT==a||XMLP._ENTITY==a)if(SAXStrings.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd())!=-1)return this._setErr(XMLP.ERR_DOC_STRUCTURE);if(XMLP._ELM_B==a||XMLP._ELM_EMP==a)this.m_iState=XMLP._STATE_DOCUMENT}if(XMLP._STATE_DOCUMENT==this.m_iState){if(XMLP._ELM_B==a||XMLP._ELM_EMP==a)this.m_stack.push(this.getName());if(XMLP._ELM_E==a||XMLP._ELM_EMP==a){var c=this.m_stack.pop();
if(c==null||c!=this.getName())return this._setErr(XMLP.ERR_ELM_NESTING)}if(this.m_stack.count()==0){this.m_iState=XMLP._STATE_MISC;return a}}if(XMLP._STATE_MISC==this.m_iState){if(XMLP._ELM_B==a||XMLP._ELM_E==a||XMLP._ELM_EMP==a||XMLP.EVT_DTD==a)return this._setErr(XMLP.ERR_DOC_STRUCTURE);if(XMLP._TEXT==a||XMLP._ENTITY==a)if(SAXStrings.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd())!=-1)return this._setErr(XMLP.ERR_DOC_STRUCTURE)}return a};
XMLP.prototype._clearAttributes=function(){this.m_atts=[]};XMLP.prototype._findAttributeIndex=function(a){for(var c=0;c<this.m_atts.length;c++)if(this.m_atts[c][XMLP._ATT_NAME]==a)return c;return-1};XMLP.prototype.getAttributeCount=function(){return this.m_atts?this.m_atts.length:0};XMLP.prototype.getAttributeName=function(a){return a<0||a>=this.m_atts.length?null:this.m_atts[a][XMLP._ATT_NAME]};XMLP.prototype.getAttributeValue=function(a){return a<0||a>=this.m_atts.length?null:__unescapeString(this.m_atts[a][XMLP._ATT_VAL])};
XMLP.prototype.getAttributeValueByName=function(a){return this.getAttributeValue(this._findAttributeIndex(a))};XMLP.prototype.getColumnNumber=function(){return SAXStrings.getColumnNumber(this.m_xml,this.m_iP)};XMLP.prototype.getContent=function(){return this.m_cSrc==XMLP._CONT_XML?this.m_xml:this.m_cAlt};XMLP.prototype.getContentBegin=function(){return this.m_cB};XMLP.prototype.getContentEnd=function(){return this.m_cE};
XMLP.prototype.getLineNumber=function(){return SAXStrings.getLineNumber(this.m_xml,this.m_iP)};XMLP.prototype.getName=function(){return this.m_name};XMLP.prototype.next=function(){return this._checkStructure(this._parse())};
XMLP.prototype._parse=function(){if(this.m_iP==this.m_xml.length)return XMLP._NONE;return this.m_iP==this.m_xml.indexOf("<?",this.m_iP)?this._parsePI(this.m_iP+2):this.m_iP==this.m_xml.indexOf("<!DOCTYPE",this.m_iP)?this._parseDTD(this.m_iP+9):this.m_iP==this.m_xml.indexOf("<!--",this.m_iP)?this._parseComment(this.m_iP+4):this.m_iP==this.m_xml.indexOf("<![CDATA[",this.m_iP)?this._parseCDATA(this.m_iP+9):this.m_iP==this.m_xml.indexOf("<",this.m_iP)?this._parseElement(this.m_iP+1):this.m_iP==this.m_xml.indexOf("&",
this.m_iP)?this._parseEntity(this.m_iP+1):this._parseText(this.m_iP)};
XMLP.prototype._parseAttribute=function(a,c){var b,f,d,g;this.m_cAlt="";b=SAXStrings.indexOfNonWhitespace(this.m_xml,a,c);if(b==-1||b>=c)return b;d=this.m_xml.indexOf("=",b);if(d==-1||d>c)return this._setErr(XMLP.ERR_ATT_VALUES);f=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,b,d);d=SAXStrings.indexOfNonWhitespace(this.m_xml,d+1,c);if(d==-1||d>c)return this._setErr(XMLP.ERR_ATT_VALUES);g=this.m_xml.charAt(d);if(SAXStrings.QUOTES.indexOf(g)==-1)return this._setErr(XMLP.ERR_ATT_VALUES);g=this.m_xml.indexOf(g,
d+1);if(g==-1||g>c)return this._setErr(XMLP.ERR_ATT_VALUES);b=this.m_xml.substring(b,f+1);f=this.m_xml.substring(d+1,g);if(b.indexOf("<")!=-1)return this._setErr(XMLP.ERR_ATT_LT_NAME);if(f.indexOf("<")!=-1)return this._setErr(XMLP.ERR_ATT_LT_VALUE);f=SAXStrings.replace(f,null,null,"\n"," ");f=SAXStrings.replace(f,null,null,"\t"," ");iRet=this._replaceEntities(f);if(iRet==XMLP._ERROR)return iRet;f=this.m_cAlt;if(this._findAttributeIndex(b)==-1)this._addAttribute(b,f);else return this._setErr(XMLP.ERR_ATT_DUP);
this.m_iP=g+2;return XMLP._ATT};XMLP.prototype._parseCDATA=function(a){var c=this.m_xml.indexOf("]]\>",a);if(c==-1)return this._setErr(XMLP.ERR_CLOSE_CDATA);this._setContent(XMLP._CONT_XML,a,c);this.m_iP=c+3;return XMLP._CDATA};XMLP.prototype._parseComment=function(a){var c=this.m_xml.indexOf("--\>",a);if(c==-1)return this._setErr(XMLP.ERR_CLOSE_COMMENT);this._setContent(XMLP._CONT_XML,a,c);this.m_iP=c+3;return XMLP._COMMENT};
XMLP.prototype._parseDTD=function(a){var c,b,f;c=this.m_xml.indexOf(">",a);if(c==-1)return this._setErr(XMLP.ERR_CLOSE_DTD);b=this.m_xml.indexOf("[",a);for(b=b!=-1&&b<c?"]>":">";;){if(c==f)return this._setErr(XMLP.ERR_INFINITELOOP);f=c;c=this.m_xml.indexOf(b,a);if(c==-1)return this._setErr(XMLP.ERR_CLOSE_DTD);if(this.m_xml.substring(c-1,c+2)!="]]\>")break}this.m_iP=c+b.length;return XMLP._DTD};
XMLP.prototype._parseElement=function(a){var c,b,f,d,g,k;b=c=this.m_xml.indexOf(">",a);if(c==-1)return this._setErr(XMLP.ERR_CLOSE_ELM);if(this.m_xml.charAt(a)=="/"){g=XMLP._ELM_E;a++}else g=XMLP._ELM_B;if(this.m_xml.charAt(c-1)=="/"){if(g==XMLP._ELM_E)return this._setErr(XMLP.ERR_ELM_EMPTY);g=XMLP._ELM_EMP;b--}b=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,a,b);if(c-a!=1)if(SAXStrings.indexOfNonWhitespace(this.m_xml,a,b)!=a)return this._setErr(XMLP.ERR_ELM_NAME);this._clearAttributes();f=SAXStrings.indexOfWhitespace(this.m_xml,
a,b);if(f==-1)f=b+1;else for(this.m_iP=f;this.m_iP<b;){if(this.m_iP==k)return this._setErr(XMLP.ERR_INFINITELOOP);k=this.m_iP;d=this._parseAttribute(this.m_iP,b);if(d==XMLP._ERROR)return d}a=this.m_xml.substring(a,f);if(a.indexOf("<")!=-1)return this._setErr(XMLP.ERR_ELM_LT_NAME);this.m_name=a;this.m_iP=c+1;return g};XMLP.prototype._parseEntity=function(a){var c=this.m_xml.indexOf(";",a);if(c==-1)return this._setErr(XMLP.ERR_CLOSE_ENTITY);this.m_iP=c+1;return this._replaceEntity(this.m_xml,a,c)};
XMLP.prototype._parsePI=function(a){var c,b,f,d;c=this.m_xml.indexOf("?>",a);if(c==-1)return this._setErr(XMLP.ERR_CLOSE_PI);a=SAXStrings.indexOfNonWhitespace(this.m_xml,a,c);if(a==-1)return this._setErr(XMLP.ERR_PI_TARGET);b=SAXStrings.indexOfWhitespace(this.m_xml,a,c);if(b==-1)b=c;f=SAXStrings.indexOfNonWhitespace(this.m_xml,b,c);if(f==-1)f=c;d=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,f,c);if(d==-1)d=c-1;this.m_name=this.m_xml.substring(a,b);this._setContent(XMLP._CONT_XML,f,d+1);this.m_iP=
c+2;return XMLP._PI};XMLP.prototype._parseText=function(a){var c,b;c=this.m_xml.indexOf("<",a);if(c==-1)c=this.m_xml.length;b=this.m_xml.indexOf("&",a);if(b!=-1&&b<=c)c=b;this._setContent(XMLP._CONT_XML,a,c);this.m_iP=c;return XMLP._TEXT};
XMLP.prototype._replaceEntities=function(a,c,b){if(SAXStrings.isEmpty(a))return"";c=c||0;b=b||a.length;var f,d="";f=a.indexOf("&",c);for(c=c;f>0&&f<b;){d+=a.substring(c,f);c=a.indexOf(";",f)+1;if(c==0||c>b)return this._setErr(XMLP.ERR_CLOSE_ENTITY);iRet=this._replaceEntity(a,f+1,c-1);if(iRet==XMLP._ERROR)return iRet;d+=this.m_cAlt;f=a.indexOf("&",c)}if(c!=b)d+=a.substring(c,b);this._setContent(XMLP._CONT_ALT,d);return XMLP._ENTITY};
XMLP.prototype._replaceEntity=function(a,c,b){if(SAXStrings.isEmpty(a))return-1;c=c||0;b=b||a.length;switch(a.substring(c,b)){case "amp":strEnt="&";break;case "lt":strEnt="<";break;case "gt":strEnt=">";break;case "apos":strEnt="'";break;case "quot":strEnt='"';break;case "nbsp":strEnt=" ";break;default:if(a.charAt(c)=="#")strEnt=String.fromCharCode(parseInt(a.substring(c+1,b)));else return a;break}this._setContent(XMLP._CONT_ALT,strEnt);return XMLP._ENTITY};
XMLP.prototype._setContent=function(a){var c=arguments;if(XMLP._CONT_XML==a){this.m_cAlt=null;this.m_cB=c[1];this.m_cE=c[2]}else{this.m_cAlt=c[1];this.m_cB=0;this.m_cE=c[1].length}this.m_cSrc=a};XMLP.prototype._setErr=function(a){this.m_cAlt=a=XMLP._errs[a];this.m_cB=0;this.m_cE=a.length;this.m_cSrc=XMLP._CONT_ALT;return XMLP._ERROR};SAXDriver=function(){this.m_hndLex=this.m_hndErr=this.m_hndDoc=null};SAXDriver.DOC_B=1;SAXDriver.DOC_E=2;SAXDriver.ELM_B=3;SAXDriver.ELM_E=4;SAXDriver.CHARS=5;
SAXDriver.PI=6;SAXDriver.CD_B=7;SAXDriver.CD_E=8;SAXDriver.CMNT=9;SAXDriver.DTD_B=10;SAXDriver.DTD_E=11;SAXDriver.prototype.parse=function(a){a=new XMLP(a);this.m_hndDoc&&this.m_hndDoc.setDocumentLocator&&this.m_hndDoc.setDocumentLocator(this);this.m_parser=a;(this.m_bErr=false)||this._fireEvent(SAXDriver.DOC_B);this._parseLoop();this.m_bErr||this._fireEvent(SAXDriver.DOC_E);this.m_xml=null;this.m_iP=0};SAXDriver.prototype.setDocumentHandler=function(a){this.m_hndDoc=a};
SAXDriver.prototype.setErrorHandler=function(a){this.m_hndErr=a};SAXDriver.prototype.setLexicalHandler=function(a){this.m_hndLex=a};SAXDriver.prototype.getColumnNumber=function(){return this.m_parser.getColumnNumber()};SAXDriver.prototype.getLineNumber=function(){return this.m_parser.getLineNumber()};SAXDriver.prototype.getMessage=function(){return this.m_strErrMsg};SAXDriver.prototype.getPublicId=function(){return null};SAXDriver.prototype.getSystemId=function(){return null};
SAXDriver.prototype.getLength=function(){return this.m_parser.getAttributeCount()};SAXDriver.prototype.getName=function(a){return this.m_parser.getAttributeName(a)};SAXDriver.prototype.getValue=function(a){return this.m_parser.getAttributeValue(a)};SAXDriver.prototype.getValueByName=function(a){return this.m_parser.getAttributeValueByName(a)};SAXDriver.prototype._fireError=function(a){this.m_strErrMsg=a;this.m_bErr=true;this.m_hndErr&&this.m_hndErr.fatalError&&this.m_hndErr.fatalError(this)};
SAXDriver.prototype._fireEvent=function(a){var c,b,f=arguments,d=f.length-1;if(!this.m_bErr){if(SAXDriver.DOC_B==a){b="startDocument";c=this.m_hndDoc}else if(SAXDriver.DOC_E==a){b="endDocument";c=this.m_hndDoc}else if(SAXDriver.ELM_B==a){b="startElement";c=this.m_hndDoc}else if(SAXDriver.ELM_E==a){b="endElement";c=this.m_hndDoc}else if(SAXDriver.CHARS==a){b="characters";c=this.m_hndDoc}else if(SAXDriver.PI==a){b="processingInstruction";c=this.m_hndDoc}else if(SAXDriver.CD_B==a){b="startCDATA";c=this.m_hndLex}else if(SAXDriver.CD_E==
a){b="endCDATA";c=this.m_hndLex}else if(SAXDriver.CMNT==a){b="comment";c=this.m_hndLex}if(c&&c[b])if(0==d)c[b]();else if(1==d)c[b](f[1]);else if(2==d)c[b](f[1],f[2]);else 3==d&&c[b](f[1],f[2],f[3])}};
SAXDriver.prototype._parseLoop=function(a){var c;for(a=this.m_parser;!this.m_bErr;){c=a.next();if(c==XMLP._ELM_B)this._fireEvent(SAXDriver.ELM_B,a.getName(),this);else if(c==XMLP._ELM_E)this._fireEvent(SAXDriver.ELM_E,a.getName());else if(c==XMLP._ELM_EMP){this._fireEvent(SAXDriver.ELM_B,a.getName(),this);this._fireEvent(SAXDriver.ELM_E,a.getName())}else if(c==XMLP._TEXT)this._fireEvent(SAXDriver.CHARS,a.getContent(),a.getContentBegin(),a.getContentEnd()-a.getContentBegin());else if(c==XMLP._ENTITY)this._fireEvent(SAXDriver.CHARS,
a.getContent(),a.getContentBegin(),a.getContentEnd()-a.getContentBegin());else if(c==XMLP._PI)this._fireEvent(SAXDriver.PI,a.getName(),a.getContent().substring(a.getContentBegin(),a.getContentEnd()));else if(c==XMLP._CDATA){this._fireEvent(SAXDriver.CD_B);this._fireEvent(SAXDriver.CHARS,a.getContent(),a.getContentBegin(),a.getContentEnd()-a.getContentBegin());this._fireEvent(SAXDriver.CD_E)}else if(c==XMLP._COMMENT)this._fireEvent(SAXDriver.CMNT,a.getContent(),a.getContentBegin(),a.getContentEnd()-
a.getContentBegin());else if(c!=XMLP._DTD)if(c==XMLP._ERROR)this._fireError(a.getContent());else if(c==XMLP._NONE)return}};SAXStrings=function(){};SAXStrings.WHITESPACE=" \t\n\r";SAXStrings.QUOTES="\"'";SAXStrings.getColumnNumber=function(a,c){if(SAXStrings.isEmpty(a))return-1;c=c||a.length;var b=a.substring(0,c).split("\n");b.length--;b=b.join("\n").length;return c-b};SAXStrings.getLineNumber=function(a,c){if(SAXStrings.isEmpty(a))return-1;c=c||a.length;return a.substring(0,c).split("\n").length};
SAXStrings.indexOfNonWhitespace=function(a,c,b){if(SAXStrings.isEmpty(a))return-1;c=c||0;b=b||a.length;for(c=c;c<b;c++)if(SAXStrings.WHITESPACE.indexOf(a.charAt(c))==-1)return c;return-1};SAXStrings.indexOfWhitespace=function(a,c,b){if(SAXStrings.isEmpty(a))return-1;c=c||0;b=b||a.length;for(c=c;c<b;c++)if(SAXStrings.WHITESPACE.indexOf(a.charAt(c))!=-1)return c;return-1};SAXStrings.isEmpty=function(a){return a==null||a.length==0};
SAXStrings.lastIndexOfNonWhitespace=function(a,c,b){if(SAXStrings.isEmpty(a))return-1;c=c||0;b=b||a.length;for(b=b-1;b>=c;b--)if(SAXStrings.WHITESPACE.indexOf(a.charAt(b))==-1)return b;return-1};SAXStrings.replace=function(a,c,b,f,d){if(SAXStrings.isEmpty(a))return"";c=c||0;b=b||a.length;return a.substring(c,b).split(f).join(d)};Stack=function(){this.m_arr=[]};Stack.prototype.clear=function(){this.m_arr=[]};Stack.prototype.count=function(){return this.m_arr.length};
Stack.prototype.destroy=function(){this.m_arr=null};Stack.prototype.peek=function(){if(this.m_arr.length==0)return null;return this.m_arr[this.m_arr.length-1]};Stack.prototype.pop=function(){if(this.m_arr.length==0)return null;var a=this.m_arr[this.m_arr.length-1];this.m_arr.length--;return a};Stack.prototype.push=function(a){this.m_arr[this.m_arr.length]=a};function isEmpty(a){return a==null||a.length==0}
function trim(a,c,b){if(isEmpty(a))return"";if(c==null)c=true;if(b==null)b=true;var f=0,d=0,g=0,k=0;if(c==true)for(;g<a.length&&whitespace.indexOf(a.charAt(g++))!=-1;)f++;if(b==true)for(k=a.length-1;k>=f&&whitespace.indexOf(a.charAt(k--))!=-1;)d++;return a.substring(f,a.length-d)}function __escapeString(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/"/g,"&quot;");return a=a.replace(/'/g,"&apos;")}
function __unescapeString(a){a=a.replace(/&amp;/g,"&");a=a.replace(/&lt;/g,"<");a=a.replace(/&gt;/g,">");a=a.replace(/&quot;/g,'"');return a=a.replace(/&apos;/g,"'")}_DOM_idsource=0;function __dom_id(){_DOM_idsource+=1;return _DOM_idsource}function addClass(a,c){if(a){if(a.indexOf("|"+c+"|")<0)a+=c+"|"}else a="|"+c+"|";return a}DOMException=function(a){this._class=addClass(this._class,"DOMException");this.code=a};
DOMException.prototype.toString=function(){return"DOMException code="+this.code+" ("+DOMImplementation.prototype.translateErrCode(this.code)+")"};DOMException.INDEX_SIZE_ERR=1;DOMException.DOMSTRING_SIZE_ERR=2;DOMException.HIERARCHY_REQUEST_ERR=3;DOMException.WRONG_DOCUMENT_ERR=4;DOMException.INVALID_CHARACTER_ERR=5;DOMException.NO_DATA_ALLOWED_ERR=6;DOMException.NO_MODIFICATION_ALLOWED_ERR=7;DOMException.NOT_FOUND_ERR=8;DOMException.NOT_SUPPORTED_ERR=9;DOMException.INUSE_ATTRIBUTE_ERR=10;
DOMException.INVALID_STATE_ERR=11;DOMException.SYNTAX_ERR=12;DOMException.INVALID_MODIFICATION_ERR=13;DOMException.NAMESPACE_ERR=14;DOMException.INVALID_ACCESS_ERR=15;DOMImplementation=function(){this._class=addClass(this._class,"DOMImplementation");this._p=null;this.namespaceAware=this.preserveWhiteSpace=false;this.errorChecking=true};DOMImplementation.prototype.escapeString=function(a){return __escapeString(a)};DOMImplementation.prototype.unescapeString=function(a){return __unescapeString(a)};
DOMImplementation.prototype.hasFeature=function(a,c){var b=false;if(a.toLowerCase()=="xml")b=!c||c=="1.0"||c=="2.0";else if(a.toLowerCase()=="core")b=!c||c=="2.0";return b};
DOMImplementation.prototype.loadXML=function(a,c){var b;try{b=new XMLP(a)}catch(f){alert("Error Creating the SAX Parser. Did you include xmlsax.js or tinyxmlsax.js in your web page?\nThe SAX parser is needed to populate XML for <SCRIPT>'s W3C DOM Parser with data.")}var d=new DOMDocument(this);if(c)d.___vm=c;this.___parseLoop(d,b);d._parseComplete=true;return d};
DOMImplementation.prototype.translateErrCode=function(a){var c="";switch(a){case DOMException.INDEX_SIZE_ERR:c="INDEX_SIZE_ERR: Index out of bounds";break;case DOMException.DOMSTRING_SIZE_ERR:c="DOMSTRING_SIZE_ERR: The resulting string is too long to fit in a DOMString";break;case DOMException.HIERARCHY_REQUEST_ERR:c="HIERARCHY_REQUEST_ERR: The Node can not be inserted at this location";break;case DOMException.WRONG_DOCUMENT_ERR:c="WRONG_DOCUMENT_ERR: The source and the destination Documents are not the same";
break;case DOMException.INVALID_CHARACTER_ERR:c="INVALID_CHARACTER_ERR: The string contains an invalid character";break;case DOMException.NO_DATA_ALLOWED_ERR:c="NO_DATA_ALLOWED_ERR: This Node / NodeList does not support data";break;case DOMException.NO_MODIFICATION_ALLOWED_ERR:c="NO_MODIFICATION_ALLOWED_ERR: This object cannot be modified";break;case DOMException.NOT_FOUND_ERR:c="NOT_FOUND_ERR: The item cannot be found";break;case DOMException.NOT_SUPPORTED_ERR:c="NOT_SUPPORTED_ERR: This implementation does not support function";
break;case DOMException.INUSE_ATTRIBUTE_ERR:c="INUSE_ATTRIBUTE_ERR: The Attribute has already been assigned to another Element";break;case DOMException.INVALID_STATE_ERR:c="INVALID_STATE_ERR: The object is no longer usable";break;case DOMException.SYNTAX_ERR:c="SYNTAX_ERR: Syntax error";break;case DOMException.INVALID_MODIFICATION_ERR:c="INVALID_MODIFICATION_ERR: Cannot change the type of the object";break;case DOMException.NAMESPACE_ERR:c="NAMESPACE_ERR: The namespace declaration is incorrect";break;
case DOMException.INVALID_ACCESS_ERR:c="INVALID_ACCESS_ERR: The object does not support this function";break;default:c="UNKNOWN: Unknown Exception Code ("+a+")"}return c};
DOMImplementation.prototype.___parseLoop=function(a,c){var b,f,d;iNodeParent=a;var g=[],k=[];if(this.namespaceAware){f=a.createNamespace("");f.setValue("http://www.w3.org/2000/xmlns/");a._namespaces.setNamedItem(f)}for(;;){b=c.next();if(b==XMLP._ELM_B){b=c.getName();trim(b,true,true);if(this.namespaceAware){b=a.createElementNS("",c.getName());b._namespaces=iNodeParent._namespaces._cloneNodes(b);for(h=0;h<c.getAttributeCount();h++){d=c.getAttributeName(h);if(this._isNamespaceDeclaration(d)){this._parseNSName(d);
f=d!="xmlns"?a.createNamespace(d):a.createNamespace("");f.setValue(c.getAttributeValue(h));b._namespaces.setNamedItem(f)}else{(f=b.getAttributeNode(d))||(f=a.createAttributeNS("",d));f.setValue(c.getAttributeValue(h));b.setAttributeNodeNS(f);if(this._isIdDeclaration(d))b.id=c.getAttributeValue(h)}}if(b._namespaces.getNamedItem(b.prefix))b.namespaceURI=b._namespaces.getNamedItem(b.prefix).value;for(h=0;h<b.attributes.length;h++)if(b.attributes.item(h).prefix!="")if(b._namespaces.getNamedItem(b.attributes.item(h).prefix))b.attributes.item(h).namespaceURI=
b._namespaces.getNamedItem(b.attributes.item(h).prefix).value}else{b=a.createElement(c.getName());for(var h=0;h<c.getAttributeCount();h++){d=c.getAttributeName(h);(f=b.getAttributeNode(d))||(f=a.createAttribute(d));f.setValue(c.getAttributeValue(h));b.setAttributeNode(f)}if(b.___rewriteNode){window.console&&console.log("Fixing IE: "+b.tagName);h=document.createElement("SPAN");f="<"+b.tagName+" ";for(d=0;d<b.attributes._nodes.length;d++)f+=b.attributes._nodes[d].name+'="'+b.attributes._nodes[d].nodeValue+
'" ';f+="/>";h.innerHTML=f;b.___link=h.firstChild;b.___rewriteNode=false}}if(iNodeParent.nodeType==DOMNode.DOCUMENT_NODE)iNodeParent.documentElement=b;iNodeParent.appendChild(b);iNodeParent=b}else if(b==XMLP._ELM_E)iNodeParent=iNodeParent.parentNode;else if(b==XMLP._ELM_EMP){b=c.getName();b=trim(b,true,true);if(this.namespaceAware){b=a.createElementNS("",c.getName());b._namespaces=iNodeParent._namespaces._cloneNodes(b);for(h=0;h<c.getAttributeCount();h++){d=c.getAttributeName(h);if(this._isNamespaceDeclaration(d)){this._parseNSName(d);
f=d!="xmlns"?a.createNamespace(d):a.createNamespace("");f.setValue(c.getAttributeValue(h));b._namespaces.setNamedItem(f)}else{(f=b.getAttributeNode(d))||(f=a.createAttributeNS("",d));f.setValue(c.getAttributeValue(h));b.setAttributeNodeNS(f);if(this._isIdDeclaration(d))b.id=c.getAttributeValue(h)}}if(b._namespaces.getNamedItem(b.prefix))b.namespaceURI=b._namespaces.getNamedItem(b.prefix).value;for(h=0;h<b.attributes.length;h++)if(b.attributes.item(h).prefix!="")if(b._namespaces.getNamedItem(b.attributes.item(h).prefix))b.attributes.item(h).namespaceURI=
b._namespaces.getNamedItem(b.attributes.item(h).prefix).value}else{b=a.createElement(b);for(h=0;h<c.getAttributeCount();h++){d=c.getAttributeName(h);(f=b.getAttributeNode(d))||(f=a.createAttribute(d));f.setValue(c.getAttributeValue(h));b.setAttributeNode(f)}}if(iNodeParent.nodeType==DOMNode.DOCUMENT_NODE)iNodeParent.documentElement=b;iNodeParent.appendChild(b)}else if(b==XMLP._TEXT||b==XMLP._ENTITY){h=c.getContent().substring(c.getContentBegin(),c.getContentEnd());if(!this.preserveWhiteSpace)if(trim(h,
true,true)=="")h="";if(h.length>0){h=a.createTextNode(h);iNodeParent.appendChild(h);if(b==XMLP._ENTITY)g[g.length]=h;else k[k.length]=h}}else if(b==XMLP._PI)iNodeParent.appendChild(a.createProcessingInstruction(c.getName(),c.getContent().substring(c.getContentBegin(),c.getContentEnd())));else if(b==XMLP._CDATA){h=c.getContent().substring(c.getContentBegin(),c.getContentEnd());if(!this.preserveWhiteSpace){h=trim(h,true,true);h.replace(/ +/g," ")}h.length>0&&iNodeParent.appendChild(a.createCDATASection(h))}else if(b==
XMLP._COMMENT){h=c.getContent().substring(c.getContentBegin(),c.getContentEnd());if(!this.preserveWhiteSpace){h=trim(h,true,true);h.replace(/ +/g," ")}h.length>0&&iNodeParent.appendChild(a.createComment(h))}else if(b!=XMLP._DTD)if(b==XMLP._ERROR){window.console&&console.log("SAX PARSER Fatal Error: "+c.getContent()+"\nLine: "+c.getLineNumber()+"\nColumn: "+c.getColumnNumber()+"\n");throw new DOMException(DOMException.SYNTAX_ERR);}else if(b==XMLP._NONE)if(iNodeParent==a)break;else throw new DOMException(DOMException.SYNTAX_ERR);
}b=g.length;for(intLoop=0;intLoop<b;intLoop++)if(h=g[intLoop].getParentNode()){h.normalize();if(!this.preserveWhiteSpace){h=h.getChildNodes();f=h.getLength();for(intLoop2=0;intLoop2<f;intLoop2++){d=h.item(intLoop2);if(d.getNodeType()==DOMNode.TEXT_NODE){var l=d.getData();l=trim(l,true,true);l.replace(/ +/g," ");d.setData(l)}}}}if(!this.preserveWhiteSpace){b=k.length;for(intLoop=0;intLoop<b;intLoop++){g=k[intLoop];if(g.getParentNode()!=null){h=g.getData();h=trim(h,true,true);h.replace(/ +/g," ");g.setData(h)}}}};
DOMImplementation.prototype._isNamespaceDeclaration=function(a){return a.indexOf("xmlns")>-1};DOMImplementation.prototype._isIdDeclaration=function(a){return a.toLowerCase()=="id"};DOMImplementation.prototype._isValidName=function(a){if(DEBUG>2&&window.console&&!(a.match(re_validName)<0)){for(var c="",b=0;b<a.length;b++)c=c+b+":"+a.charCodeAt(b)+"; ";console.log("DOM: invalid name: "+a+" : "+c)}return a.match(re_validName)};re_validName=/^[a-zA-Z_:][a-zA-Z0-9\.\-_:]*$/;
DOMImplementation.prototype._isValidString=function(a){DEBUG&&window.console&&!(a.search(re_invalidStringChars)<0)&&console.log("DOM: invalid string: "+a);return a.search(re_invalidStringChars)<0};re_invalidStringChars=/\x01|\x02|\x03|\x04|\x05|\x06|\x07|\x08|\x0B|\x0C|\x0E|\x0F|\x10|\x11|\x12|\x13|\x14|\x15|\x16|\x17|\x18|\x19|\x1A|\x1B|\x1C|\x1D|\x1E|\x1F|\x7F/;
DOMImplementation.prototype._parseNSName=function(a){var c={};c.prefix=a;c.namespaceName="";delimPos=a.indexOf(":");if(delimPos>-1){c.prefix=a.substring(0,delimPos);c.namespaceName=a.substring(delimPos+1,a.length)}return c};DOMImplementation.prototype._parseQName=function(a){var c={};c.localName=a;c.prefix="";delimPos=a.indexOf(":");if(delimPos>-1){c.prefix=a.substring(0,delimPos);c.localName=a.substring(delimPos+1,a.length)}return c};
DOMNodeList=function(a,c){this._class=addClass(this._class,"DOMNodeList");this._nodes=[];this.length=0;this.parentNode=c;this.ownerDocument=a;this._readonly=false};DOMNodeList.prototype.getLength=function(){return this.length};DOMNodeList.prototype.item=function(a){var c=null;if(a>=0&&a<this._nodes.length)c=this._nodes[a];return c};DOMNodeList.prototype._findItemIndex=function(a){var c=-1;if(a>-1)for(var b=0;b<this._nodes.length;b++)if(this._nodes[b]._id==a){c=b;break}return c};
DOMNodeList.prototype._insertBefore=function(a,c){if(c>=0&&c<this._nodes.length){var b=[];b=this._nodes.slice(0,c);if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE)b=b.concat(a.childNodes._nodes);else b[b.length]=a;this._nodes=b.concat(this._nodes.slice(c));this.length=this._nodes.length}};
DOMNodeList.prototype._replaceChild=function(a,c){var b=null;if(c>=0&&c<this._nodes.length){b=this._nodes[c];if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){var f=[];f=this._nodes.slice(0,c);f=f.concat(a.childNodes._nodes);this._nodes=f.concat(this._nodes.slice(c+1))}else this._nodes[c]=a}return b};DOMNodeList.prototype._removeChild=function(a){var c=null;if(a>-1){c=this._nodes[a];var b=[];b=this._nodes.slice(0,a);this._nodes=b.concat(this._nodes.slice(a+1));this.length=this._nodes.length}return c};
DOMNodeList.prototype._appendChild=function(a){if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE)this._nodes=this._nodes.concat(a.childNodes._nodes);else this._nodes[this._nodes.length]=a;this.length=this._nodes.length};DOMNodeList.prototype._cloneNodes=function(a,c){for(var b=new DOMNodeList(this.ownerDocument,c),f=0;f<this._nodes.length;f++)b._appendChild(this._nodes[f].cloneNode(a));return b};
DOMNodeList.prototype.toString=function(){for(var a="",c=0;c<this.length;c++)a+=this._nodes[c].toString();return a};DOMNamedNodeMap=function(a,c){this._class=addClass(this._class,"DOMNamedNodeMap");this.DOMNodeList=DOMNodeList;this.DOMNodeList(a,c)};DOMNamedNodeMap.prototype=new DOMNodeList;DOMNamedNodeMap.prototype.getNamedItem=function(a){var c=null;a=this._findNamedItemIndex(a);if(a>-1)c=this._nodes[a];return c};
DOMNamedNodeMap.prototype.setNamedItem=function(a){if(this.ownerDocument.implementation.errorChecking){if(this.ownerDocument!=a.ownerDocument)throw new DOMException(DOMException.WRONG_DOCUMENT_ERR);if(this._readonly||this.parentNode&&this.parentNode._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(a.ownerElement&&a.ownerElement!=this.parentNode)throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR);}var c=this._findNamedItemIndex(a.name),b=null;if(c>-1){b=this._nodes[c];
if(this.ownerDocument.implementation.errorChecking&&b._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);else this._nodes[c]=a}else this._nodes[this.length]=a;this.length=this._nodes.length;a.ownerElement=this.parentNode;return b};
DOMNamedNodeMap.prototype.removeNamedItem=function(a){if(this.ownerDocument.implementation.errorChecking&&(this._readonly||this.parentNode&&this.parentNode._readonly))throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);a=this._findNamedItemIndex(a);if(this.ownerDocument.implementation.errorChecking&&a<0)throw new DOMException(DOMException.NOT_FOUND_ERR);var c=this._nodes[a];if(this.ownerDocument.implementation.errorChecking&&c._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
return this._removeChild(a)};DOMNamedNodeMap.prototype.getNamedItemNS=function(a,c){var b=null,f=this._findNamedItemNSIndex(a,c);if(f>-1)b=this._nodes[f];return b};
DOMNamedNodeMap.prototype.setNamedItemNS=function(a){if(this.ownerDocument.implementation.errorChecking){if(this._readonly||this.parentNode&&this.parentNode._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.ownerDocument!=a.ownerDocument)throw new DOMException(DOMException.WRONG_DOCUMENT_ERR);if(a.ownerElement&&a.ownerElement!=this.parentNode)throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR);}var c=this._findNamedItemNSIndex(a.namespaceURI,a.localName),b=null;
if(c>-1){b=this._nodes[c];if(this.ownerDocument.implementation.errorChecking&&b._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);else this._nodes[c]=a}else this._nodes[this.length]=a;this.length=this._nodes.length;a.ownerElement=this.parentNode;return b};
DOMNamedNodeMap.prototype.removeNamedItemNS=function(a,c){if(this.ownerDocument.implementation.errorChecking&&(this._readonly||this.parentNode&&this.parentNode._readonly))throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);var b=this._findNamedItemNSIndex(a,c);if(this.ownerDocument.implementation.errorChecking&&b<0)throw new DOMException(DOMException.NOT_FOUND_ERR);var f=this._nodes[b];if(this.ownerDocument.implementation.errorChecking&&f._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
return this._removeChild(b)};DOMNamedNodeMap.prototype._findNamedItemIndex=function(a){for(var c=-1,b=0;b<this._nodes.length;b++)if(this._nodes[b].name==a){c=b;break}return c};DOMNamedNodeMap.prototype._findNamedItemNSIndex=function(a,c){var b=-1;if(c)for(var f=0;f<this._nodes.length;f++)if(this._nodes[f].namespaceURI==a&&this._nodes[f].localName==c){b=f;break}return b};DOMNamedNodeMap.prototype._hasAttribute=function(a){var c=false;if(this._findNamedItemIndex(a)>-1)c=true;return c};
DOMNamedNodeMap.prototype._hasAttributeNS=function(a,c){var b=false;if(this._findNamedItemNSIndex(a,c)>-1)b=true;return b};DOMNamedNodeMap.prototype._cloneNodes=function(a){a=new DOMNamedNodeMap(this.ownerDocument,a);for(var c=0;c<this._nodes.length;c++)a._appendChild(this._nodes[c].cloneNode(false));return a};DOMNamedNodeMap.prototype.toString=function(){for(var a="",c=0;c<this.length-1;c++)a+=this._nodes[c].toString()+" ";if(this.length>0)a+=this._nodes[this.length-1].toString();return a};
DOMNamespaceNodeMap=function(a,c){this._class=addClass(this._class,"DOMNamespaceNodeMap");this.DOMNamedNodeMap=DOMNamedNodeMap;this.DOMNamedNodeMap(a,c)};DOMNamespaceNodeMap.prototype=new DOMNamedNodeMap;DOMNamespaceNodeMap.prototype._findNamedItemIndex=function(a){for(var c=-1,b=0;b<this._nodes.length;b++)if(this._nodes[b].localName==a){c=b;break}return c};
DOMNamespaceNodeMap.prototype._cloneNodes=function(a){a=new DOMNamespaceNodeMap(this.ownerDocument,a);for(var c=0;c<this._nodes.length;c++)a._appendChild(this._nodes[c].cloneNode(false));return a};DOMNamespaceNodeMap.prototype.toString=function(){for(var a="",c=0;c<this._nodes.length;c++){var b=null;try{b=this.parentNode.parentNode._namespaces.getNamedItem(this._nodes[c].localName)}catch(f){break}b&&""+b.nodeValue==""+this._nodes[c].nodeValue||(a+=this._nodes[c].toString()+" ")}return a};
DOMNode=function(a){this._class=addClass(this._class,"DOMNode");if(a)this._id=a._genId();this.nodeValue=this.nodeName=this.localName=this.prefix=this.namespaceURI="";this.nodeType=0;this.parentNode=null;this.childNodes=new DOMNodeList(a,this);this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=null;this.attributes=new DOMNamedNodeMap(a,this);this.ownerDocument=a;this._namespaces=new DOMNamespaceNodeMap(a,this);this._readonly=false};DOMNode.ELEMENT_NODE=1;DOMNode.ATTRIBUTE_NODE=2;
DOMNode.TEXT_NODE=3;DOMNode.CDATA_SECTION_NODE=4;DOMNode.ENTITY_REFERENCE_NODE=5;DOMNode.ENTITY_NODE=6;DOMNode.PROCESSING_INSTRUCTION_NODE=7;DOMNode.COMMENT_NODE=8;DOMNode.DOCUMENT_NODE=9;DOMNode.DOCUMENT_TYPE_NODE=10;DOMNode.DOCUMENT_FRAGMENT_NODE=11;DOMNode.NOTATION_NODE=12;DOMNode.NAMESPACE_NODE=13;DOMNode.prototype.hasAttributes=function(){return this.attributes.length==0?false:true};DOMNode.prototype.getNodeName=function(){return this.nodeName};
DOMNode.prototype.getNodeValue=function(){if(this.___link)this.nodeValue=this.___link.nodeValue;return this.nodeValue};DOMNode.prototype.setNodeValue=function(a){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.___link)this.___link.nodeValue=a;this.nodeValue=a};DOMNode.prototype.getNodeType=function(){return this.nodeType};DOMNode.prototype.getParentNode=function(){return this.parentNode};
DOMNode.prototype.getChildNodes=function(){return this.childNodes};DOMNode.prototype.getFirstChild=function(){return this.firstChild};DOMNode.prototype.getLastChild=function(){return this.lastChild};DOMNode.prototype.getPreviousSibling=function(){return this.previousSibling};DOMNode.prototype.getNextSibling=function(){return this.nextSibling};DOMNode.prototype.getAttributes=function(){return this.attributes};DOMNode.prototype.getOwnerDocument=function(){return this.ownerDocument};
DOMNode.prototype.getNamespaceURI=function(){return this.namespaceURI};DOMNode.prototype.getPrefix=function(){return this.prefix};
DOMNode.prototype.setPrefix=function(a){if(this.ownerDocument.implementation.errorChecking){if(this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(!this.ownerDocument.implementation._isValidName(a))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);if(!this.ownerDocument._isValidNamespace(this.namespaceURI,a+":"+this.localName))throw new DOMException(DOMException.NAMESPACE_ERR);if(a=="xmlns"&&this.namespaceURI!="http://www.w3.org/2000/xmlns/")throw new DOMException(DOMException.NAMESPACE_ERR);
if(a==""&&this.localName=="xmlns")throw new DOMException(DOMException.NAMESPACE_ERR);}this.prefix=a;this.nodeName=this.prefix!=""?this.prefix+":"+this.localName:this.localName};DOMNode.prototype.getLocalName=function(){return this.localName};
DOMNode.prototype.insertBefore=function(a,c){var b;if(this.ownerDocument.implementation.errorChecking){if(this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.ownerDocument!=a.ownerDocument)throw new DOMException(DOMException.WRONG_DOCUMENT_ERR);if(this._isAncestor(a))throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR);}if(c){b=this.childNodes._findItemIndex(c._id);if(this.ownerDocument.implementation.errorChecking&&b<0)throw new DOMException(DOMException.NOT_FOUND_ERR);
(b=a.parentNode)&&b.removeChild(a);this.childNodes._insertBefore(a,this.childNodes._findItemIndex(c._id));a.___link&&c.___link&&this.___link&&this.___link.insertBefore(a.___link,c.___link);b=c.previousSibling;if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(a.childNodes._nodes.length>0){for(var f=0;f<a.childNodes._nodes.length;f++)a.childNodes._nodes[f].parentNode=this;c.previousSibling=a.childNodes._nodes[a.childNodes._nodes.length-1]}}else{a.parentNode=this;c.previousSibling=a}}else{b=this.lastChild;
this.appendChild(a)}if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(a.childNodes._nodes.length>0){if(b)b.nextSibling=a.childNodes._nodes[0];else this.firstChild=a.childNodes._nodes[0];a.childNodes._nodes[0].previousSibling=b;a.childNodes._nodes[a.childNodes._nodes.length-1].nextSibling=c}}else{if(b)b.nextSibling=a;else this.firstChild=a;a.previousSibling=b;a.nextSibling=c}this.ownerDocument.___DOMcache_outdated=true;return a};
DOMNode.prototype.replaceChild=function(a,c){var b=null;if(this.ownerDocument.implementation.errorChecking){if(this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.ownerDocument!=a.ownerDocument)throw new DOMException(DOMException.WRONG_DOCUMENT_ERR);if(this._isAncestor(a))throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR);}b=this.childNodes._findItemIndex(c._id);if(this.ownerDocument.implementation.errorChecking&&b<0)throw new DOMException(DOMException.NOT_FOUND_ERR);
var f=a.parentNode;f&&f.removeChild(a);b=this.childNodes._replaceChild(a,b);a.___link&&c.___link&&this.___link&&this.___link.replaceChild(a.___link,c.___link);this.ownerDocument.___DOMcache_outdated=true;if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(a.childNodes._nodes.length>0){for(f=0;f<a.childNodes._nodes.length;f++)a.childNodes._nodes[f].parentNode=this;if(c.previousSibling)c.previousSibling.nextSibling=a.childNodes._nodes[0];else this.firstChild=a.childNodes._nodes[0];if(c.nextSibling)c.nextSibling.previousSibling=
a;else this.lastChild=a.childNodes._nodes[a.childNodes._nodes.length-1];a.childNodes._nodes[0].previousSibling=c.previousSibling;a.childNodes._nodes[a.childNodes._nodes.length-1].nextSibling=c.nextSibling}}else{a.parentNode=this;c.parentNode=null;if(c.previousSibling)c.previousSibling.nextSibling=a;else this.firstChild=a;if(c.nextSibling)c.nextSibling.previousSibling=a;else this.lastChild=a;a.previousSibling=c.previousSibling;a.nextSibling=c.nextSibling}return b};
DOMNode.prototype.removeChild=function(a){if(this.ownerDocument.implementation.errorChecking&&(this._readonly||a._readonly))throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);var c=this.childNodes._findItemIndex(a._id);if(this.ownerDocument.implementation.errorChecking&&c<0)throw new DOMException(DOMException.NOT_FOUND_ERR);this.childNodes._removeChild(c);a.___link&&this.___link&&this.___link.removeChild(a.___link);this.ownerDocument.___DOMcache_outdated=true;a.parentNode=null;if(a.previousSibling)a.previousSibling.nextSibling=
a.nextSibling;else this.firstChild=a.nextSibling;if(a.nextSibling)a.nextSibling.previousSibling=a.previousSibling;else this.lastChild=a.previousSibling;a.previousSibling=null;a.nextSibling=null;return a};
DOMNode.prototype.appendChild=function(a){if(this.ownerDocument.implementation.errorChecking){if(this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.ownerDocument!=a.ownerDocument)throw new DOMException(DOMException.WRONG_DOCUMENT_ERR);if(this._isAncestor(a))throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR);}var c=a.parentNode;c&&c.removeChild(a);this.childNodes._appendChild(a);if(_isIE){window.csshovertimeout&&clearTimeout(window.csshovertimeout);window.csshovertimeout=
setTimeout(window.CSSHover,300)}if(a.___isBody&&a.___link&&a.ownerDocument.___bodyLink)a.ownerDocument.___bodyLink.appendChild(a.___link);else a.___link&&this.___link&&this.___link.appendChild(a.___link);this.ownerDocument.___DOMcache_outdated=true;if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(a.childNodes._nodes.length>0){for(c=0;c<a.childNodes._nodes.length;c++)a.childNodes._nodes[c].parentNode=this;if(this.lastChild){this.lastChild.nextSibling=a.childNodes._nodes[0];a.childNodes._nodes[0].previousSibling=
this.lastChild;this.lastChild=a.childNodes._nodes[a.childNodes._nodes.length-1]}else{this.lastChild=a.childNodes._nodes[a.childNodes._nodes.length-1];this.firstChild=a.childNodes._nodes[0]}}}else{a.parentNode=this;if(this.lastChild){this.lastChild.nextSibling=a;a.previousSibling=this.lastChild;this.lastChild=a}else this.firstChild=this.lastChild=a}return a};DOMNode.prototype.hasChildNodes=function(){return this.childNodes.length>0};
DOMNode.prototype.cloneNode=function(a){try{return this.ownerDocument.importNode(this,a)}catch(c){return null}};
DOMNode.prototype.normalize=function(){var a,c=new DOMNodeList;if(this.nodeType==DOMNode.ELEMENT_NODE||this.nodeType==DOMNode.DOCUMENT_NODE){for(var b=null,f=0;f<this.childNodes.length;f++){a=this.childNodes.item(f);if(a.nodeType==DOMNode.TEXT_NODE)if(a.length<1)c._appendChild(a);else if(b){b.appendData(a.data);c._appendChild(a)}else b=a;else{b=null;a.normalize()}}for(f=0;f<c.length;f++){a=c.item(f);a.parentNode.removeChild(a)}}};
DOMNode.prototype.isSupported=function(a,c){return this.ownerDocument.implementation.hasFeature(a,c)};DOMNode.prototype.getElementsByTagName=function(a){a=this._getElementsByTagNameRecursive(a,new DOMNodeList(this.ownerDocument));var c=[].concat(a._nodes);for(var b in a)c[b]=a[b];c.item=function(f){return this[f]};return c};
DOMNode.prototype._getElementsByTagNameRecursive=function(a,c){if(this.nodeType==DOMNode.ELEMENT_NODE||this.nodeType==DOMNode.DOCUMENT_NODE){if(this.nodeName==a||a=="*")c._appendChild(this);for(var b=0;b<this.childNodes.length;b++)c=this.childNodes.item(b)._getElementsByTagNameRecursive(a,c)}return c};DOMNode.prototype.getXML=function(){return this.toString()};DOMNode.prototype.getElementsByTagNameNS=function(a,c){return this._getElementsByTagNameNSRecursive(a,c,new DOMNodeList(this.ownerDocument))};
DOMNode.prototype._getElementsByTagNameNSRecursive=function(a,c,b){if(this.nodeType==DOMNode.ELEMENT_NODE||this.nodeType==DOMNode.DOCUMENT_NODE){if((this.namespaceURI==a||a=="*")&&(this.localName==c||c=="*"))b._appendChild(this);for(var f=0;f<this.childNodes.length;f++)b=this.childNodes.item(f)._getElementsByTagNameNSRecursive(a,c,b)}return b};DOMNode.prototype._isAncestor=function(a){return this==a||this.parentNode&&this.parentNode._isAncestor(a)};
DOMNode.prototype.importNode=function(a,c){var b;this.getOwnerDocument()._performingImportNodeOperation=true;try{if(a.nodeType==DOMNode.ELEMENT_NODE){if(this.ownerDocument.implementation.namespaceAware){b=this.ownerDocument.createElementNS(a.namespaceURI,a.nodeName);for(f=0;f<a.attributes.length;f++)b.setAttributeNS(a.attributes.item(f).namespaceURI,a.attributes.item(f).name,a.attributes.item(f).value);for(f=0;f<a._namespaces.length;f++){b._namespaces._nodes[f]=this.ownerDocument.createNamespace(a._namespaces.item(f).localName);
b._namespaces._nodes[f].setValue(a._namespaces.item(f).value)}}else{b=this.ownerDocument.createElement(a.tagName);for(var f=0;f<a.attributes.length;f++)b.setAttribute(a.attributes.item(f).name,a.attributes.item(f).value)}if(a.___link&&b.___link){var d=false;if(a.___link.style.length)for(f=0;f<a.___link.style.length;f++){if(!b.___link.style[a.___link.style[f]]){d=true;break}b.___link.style[a.___link.style[f]]=a.___link.style[a.___link.style[f]]}if(d||!a.___link.style.length)for(var g in a.___link.style)if(a.___link.style[g])try{b.___link.style[g]=
a.___link.style[g]}catch(k){}}}else if(a.nodeType==DOMNode.ATTRIBUTE_NODE){if(this.ownerDocument.implementation.namespaceAware){b=this.ownerDocument.createAttributeNS(a.namespaceURI,a.nodeName);for(f=0;f<a._namespaces.length;f++){b._namespaces._nodes[f]=this.ownerDocument.createNamespace(a._namespaces.item(f).localName);b._namespaces._nodes[f].setValue(a._namespaces.item(f).value)}}else b=this.ownerDocument.createAttribute(a.name);b.setValue(a.value)}else if(a.nodeType==DOMNode.DOCUMENT_FRAGMENT)b=
this.ownerDocument.createDocumentFragment();else if(a.nodeType==DOMNode.NAMESPACE_NODE){b=this.ownerDocument.createNamespace(a.nodeName);b.setValue(a.value)}else if(a.nodeType==DOMNode.TEXT_NODE)b=this.ownerDocument.createTextNode(a.data);else if(a.nodeType==DOMNode.CDATA_SECTION_NODE)b=this.ownerDocument.createCDATASection(a.data);else if(a.nodeType==DOMNode.PROCESSING_INSTRUCTION_NODE)b=this.ownerDocument.createProcessingInstruction(a.target,a.data);else if(a.nodeType==DOMNode.COMMENT_NODE)b=this.ownerDocument.createComment(a.data);
else throw new DOMException(DOMException.NOT_SUPPORTED_ERR);if(c)for(f=0;f<a.childNodes.length;f++)b.appendChild(this.ownerDocument.importNode(a.childNodes.item(f),true));this.getOwnerDocument()._performingImportNodeOperation=false;return b}catch(h){this.getOwnerDocument()._performingImportNodeOperation=false;throw h;}};DOMNode.prototype.__escapeString=function(a){return __escapeString(a)};DOMNode.prototype.__unescapeString=function(a){return __unescapeString(a)};
DOMDocument=function(a){this._class=addClass(this._class,"DOMDocument");this.DOMNode=DOMNode;this.DOMNode(this);this.doctype=null;this.implementation=a;this.documentElement=null;this.all=[];this.nodeName="#document";this.nodeType=DOMNode.DOCUMENT_NODE;this._lastId=this._id=0;this._parseComplete=false;this.ownerDocument=this;this._performingImportNodeOperation=false};DOMDocument.prototype=new DOMNode;DOMDocument.prototype.getDoctype=function(){return this.doctype};
DOMDocument.prototype.getImplementation=function(){return this.implementation};DOMDocument.prototype.getDocumentElement=function(){return this.documentElement};DOMDocument.prototype.createElement=function(a){if(this.ownerDocument.implementation.errorChecking&&!this.ownerDocument.implementation._isValidName(a))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);var c=new DOMElement(this);c.tagName=a;c.nodeName=a;c.bind_real_dom();return this.all[this.all.length]=c};
DOMDocument.prototype.createDocumentFragment=function(){var a=new DOMDocumentFragment(this);if(!document.createElement)return a;a.___link=document.createDocumentFragment();return a};DOMDocument.prototype.createTextNode=function(a){var c=new DOMText(this);a||(a="");a=a.toString();c.data=a;c.nodeValue=a;if(document.createTextNode)c.___link=document.createTextNode(a);c.length=a.length;return c};
DOMDocument.prototype.createComment=function(a){var c=new DOMComment(this);c.data=a;c.nodeValue=a;c.length=a.length;return c};DOMDocument.prototype.createCDATASection=function(a){var c=new DOMCDATASection(this);c.data=a;c.nodeValue=a;c.length=a.length;return c};
DOMDocument.prototype.createProcessingInstruction=function(a,c){if(this.ownerDocument.implementation.errorChecking&&!this.implementation._isValidName(a))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);var b=new DOMProcessingInstruction(this);b.target=a;b.nodeName=a;b.data=c;b.nodeValue=c;b.length=c.length;return b};
DOMDocument.prototype.createAttribute=function(a){if(this.ownerDocument.implementation.errorChecking&&!this.ownerDocument.implementation._isValidName(a))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);var c=new DOMAttr(this);c.name=a;c.nodeName=a;if(document.createAttribute)c.___link=document.createAttribute(a);return c};
DOMDocument.prototype.createElementNS=function(a,c){if(this.ownerDocument.implementation.errorChecking){if(!this.ownerDocument._isValidNamespace(a,c))throw new DOMException(DOMException.NAMESPACE_ERR);if(!this.ownerDocument.implementation._isValidName(c))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);}if(trim(c,true,true).toLowerCase()=="script")c="span";var b=new DOMElement(this),f=this.implementation._parseQName(c);b.nodeName=c;b.namespaceURI=a;b.prefix=f.prefix;b.localName=f.localName;
b.tagName=c;b.bind_real_dom();if(trim(tagName,true,true).toLowerCase()=="form")b.___link.target="_blank";return this.all[this.all.length]=b};
DOMDocument.prototype.createAttributeNS=function(a,c){if(this.ownerDocument.implementation.errorChecking){if(!this.ownerDocument._isValidNamespace(a,c,true))throw new DOMException(DOMException.NAMESPACE_ERR);if(!this.ownerDocument.implementation._isValidName(c))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);}var b=new DOMAttr(this),f=this.implementation._parseQName(c);b.nodeName=c;b.namespaceURI=a;b.prefix=f.prefix;b.localName=f.localName;b.name=c;b.nodeValue="";return b};
DOMDocument.prototype.createNamespace=function(a){var c=new DOMNamespace(this),b=this.implementation._parseQName(a);c.nodeName=a;c.prefix=b.prefix;c.localName=b.localName;c.name=a;c.nodeValue="";return c};DOMDocument.prototype.getElementById=function(a){for(var c=null,b=0;b<this.all.length;b++){var f=this.all[b];if(f.id==a&&f._isAncestor(f.ownerDocument.documentElement)){c=f;break}}return c};DOMDocument.prototype._genId=function(){this._lastId+=1;return this._lastId};
DOMDocument.prototype._isValidNamespace=function(a,c,b){if(this._performingImportNodeOperation==true)return true;var f=true;c=this.implementation._parseQName(c);if(this._parseComplete==true){if(c.localName.indexOf(":")>-1)f=false;if(f&&!b)a||(f=false);if(f&&c.prefix=="")f=false}if(f&&c.prefix=="xml"&&a!="http://www.w3.org/XML/1998/namespace")f=false;return f};DOMDocument.prototype.toString=function(){return""+this.childNodes};
DOMElement=function(a){this._class=addClass(this._class,"DOMElement");this.DOMNode=DOMNode;this.DOMNode(a);this.id=this.tagName="";this.nodeType=DOMNode.ELEMENT_NODE};DOMElement.prototype=new DOMNode;
DOMElement.prototype.bind_real_dom=function(){if(document.createElement){var a=this.tagName,c=trim(a,true,true).toLowerCase();if(c==="script"||c==="object"||c==="embed"){a="span";this.___isScript=true}else if(c==="body"){a="div";this.___isBody=true;if(!this.ownerDocument.body)this.ownerDocument.body=this}else if(c==="meta"){a="span";this.___isMeta=true}else if(c==="iframe"){a="div";this.___isIframe=true;this.ownerDocument.___vm.global.window.frames.push(this);this.contentDocument=(new DOMImplementation).loadXML("");
this.contentDocument.___vm=this.ownerDocument.___vm;this.contentWindow=this.ownerDocument.___vm.createGlobal();delete this.contentWindow.fetchUrl;delete this.contentWindow.load;extendWindow(this.contentWindow);this.contentWindow.document=this.contentDocument;this.contentWindow.location="JENERIC";this.contentWindow.parent=this.ownerDocument.___vm.global.window;this.contentWindow.top=this.ownerDocument.___vm.global.window;this.contentWindow.window=this.contentWindow;this.contentWindow.self=this.contentWindow;
this.contentWindow.frameElement=this;this.contentDocument.defaultView=this.contentWindow}else if(trim(a,true,true).toLowerCase()==="link"){a="span";this.___isLink=true}if(_isIE)if(c=="tr"){window.console&&console.log("Warning! patching IE table render TR!");a=document.createElement("TABLE");this.___link=a.insertRow(-1)}else if(c=="td"){window.console&&console.log("Warning! patching IE table render TD!");a=document.createElement("TABLE");this.___link=a.insertRow(-1).insertCell(-1)}else this.___link=
document.createElement(a);else this.___link=document.createElement(a);this.___link.___id=__dom_id();this.attributes.___link=this.___link;this.style=this.___link.style;if(c=="form"||c=="a")this.___link.target="_blank";if(this.___isScript||this.___isMeta||this.___isLink)this.___link.style.display="none";if(this.___isIframe)this.contentDocument.___bodyLink=this.___link}};DOMElement.prototype.getTagName=function(){return this.tagName};
DOMElement.prototype.getAttribute=function(a){var c="";if(a=this.attributes.getNamedItem(a))c=a.value;return c};
DOMElement.prototype.setAttribute=function(a,c){var b=a.toLowerCase();if(b.substr(0,2)!="on"){if(b==="src"&&this.___isLink&&this.___isStyleSheet){window.console&&console.log("will iport CSS!!");this.ownerDocument.___vm._importCSS(this.ownerDocument.___vm,src,false)}(b=this.attributes.getNamedItem(a))||(b=this.ownerDocument.createAttribute(a));if(this.ownerDocument.implementation.errorChecking){if(b._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(!this.ownerDocument.implementation._isValidString(new String(c)))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);
}if(this.ownerDocument.implementation._isIdDeclaration(a))this.id=c;b.setValue(c);c=new String(c);b.specified=c.length>0?true:false;this instanceof DOMElement?this.setAttributeNode(b):this.attributes.setNamedItem(b)}};DOMElement.prototype.removeAttribute=function(a){this.___link&&this.___link.removeAttribute&&this.___link.removeAttribute(a);return this.attributes.removeNamedItem(a)};DOMElement.prototype.getAttributeNode=function(a){return this.attributes.getNamedItem(a)};
DOMElement.prototype.setAttributeNode=function(a){if(this.ownerDocument.implementation._isIdDeclaration(a.name))this.id=a.value;var c=a.name.toLowerCase(),b=a.value;if(c.substr(0,2)=="on")try{listener=new this.ownerDocument.___vm.global.Function("event",b);this.addEventListener(c.slice(2),listener)}catch(f){this.ownerDocument.___vm.ErrorConsole.log("Failed to create event handler for "+c+": '"+b+"' at "+this+" due to: "+f)}else if(!(c=="target"&&b!="_blank")){if(c==="type"&&b==="application/x-shockwave-flash")this.___flash=
true;if(c=="rel"&&b.toLowerCase()=="stylesheet")this.___isStyleSheet=true;c==="href"&&this.___isLink&&this.___isStyleSheet&&this.ownerDocument.___vm._importCSS(this.ownerDocument.___vm,b,false);if(c==="src"&&this.___isScript){if(this.ownerDocument.___scriptTagStack)this.ownerDocument.___scriptTagStack.queueSize++;else{var d=new this.ownerDocument.___vm.ExecutionContext(GLOBAL_CODE);d.scope={object:this.ownerDocument.defaultView,parent:null};this.ownerDocument.___scriptTagStack=new __Stack(d);this.ownerDocument.___scriptTagStack.onerror=
function(k){console.log("Error loading <script>: "+k);console.log(k)};this.ownerDocument.___scriptTagStack.queueSize=1;if(this.ownerDocument.defaultView)this.ownerDocument.___scriptTagStack.global_scope=this.ownerDocument.defaultView;else console.log("AAAAAAAAAAAAAA ->>>>>>>>> no defaultView deined!")}eos_om.include.call(this,this.ownerDocument.___vm,b,this.ownerDocument.___scriptTagStack)}if(!(this.tagName.toLowerCase()!="img"&&c==="src"))if(!(this.tagName=="object"&&c==="data"&&!this.___flash)){if(a.___link&&
this.___link)try{this.___link.setAttributeNode(a.___link)}catch(g){if(c=="style")this.___link.style.cssText=b;else{this.___rewriteNode=true;window.console&&console.log("Error setting attribute: "+a.name+" = "+a.value+" on "+this.tagName+" with error: "+g)}}return this.attributes.setNamedItem(a)}}};
DOMElement.prototype.removeAttributeNode=function(a){if(this.ownerDocument.implementation.errorChecking&&a._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);var c=this.attributes._findItemIndex(a._id);if(this.ownerDocument.implementation.errorChecking&&c<0)throw new DOMException(DOMException.NOT_FOUND_ERR);this.___link&&a.___link&&this.___link.removeAttributeNode&&this.___link.removeAttributeNode(a.___link);return this.attributes._removeChild(c)};
DOMElement.prototype.getAttributeNS=function(a,c){var b="",f=this.attributes.getNamedItemNS(a,c);if(f)b=f.value;return b};
DOMElement.prototype.setAttributeNS=function(a,c,b){var f=this.attributes.getNamedItem(a,c);f||(f=this.ownerDocument.createAttributeNS(a,c));b=new String(b);if(this.ownerDocument.implementation.errorChecking){if(f._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(!this.ownerDocument._isValidNamespace(a,c))throw new DOMException(DOMException.NAMESPACE_ERR);if(!this.ownerDocument.implementation._isValidString(b))throw new DOMException(DOMException.INVALID_CHARACTER_ERR);
}if(this.ownerDocument.implementation._isIdDeclaration(name))this.id=b;f.value=b;f.nodeValue=b;f.specified=b.length>0?true:false;this.attributes.setNamedItemNS(f)};DOMElement.prototype.removeAttributeNS=function(a,c){return this.attributes.removeNamedItemNS(a,c)};DOMElement.prototype.getAttributeNodeNS=function(a,c){return this.attributes.getNamedItemNS(a,c)};
DOMElement.prototype.setAttributeNodeNS=function(a){if(a.prefix==""&&this.ownerDocument.implementation._isIdDeclaration(a.name))this.id=a.value;return this.attributes.setNamedItemNS(a)};DOMElement.prototype.hasAttribute=function(a){return this.attributes._hasAttribute(a)};DOMElement.prototype.hasAttributeNS=function(a,c){return this.attributes._hasAttributeNS(a,c)};
DOMElement.prototype.toString=function(){var a="",c=this._namespaces.toString();if(c.length>0)c=" "+c;var b=this.attributes.toString();if(b.length>0)b=" "+b;a+="<"+this.nodeName+c+b+">";a+=this.childNodes.toString();a+="</"+this.nodeName+">";return a};DOMAttr=function(a){this._class=addClass(this._class,"DOMAttr");this.DOMNode=DOMNode;this.DOMNode(a);this.name="";this.specified=false;this.value="";this.nodeType=DOMNode.ATTRIBUTE_NODE;this.attributes=this.childNodes=this.ownerElement=null};
DOMAttr.prototype=new DOMNode;DOMAttr.prototype.getName=function(){return this.nodeName};DOMAttr.prototype.getSpecified=function(){return this.specified};DOMAttr.prototype.getValue=function(){if(this.___link)this.nodeValue=this.___link.value;return this.nodeValue};DOMAttr.prototype.setValue=function(a){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);this.setNodeValue(a)};
DOMAttr.prototype.setNodeValue=function(a){var c=this.name.toLowerCase();if(!(c=="target"&&a.toLowerCase()!="_blank"))if(c!="data"){this.value=this.nodeValue=new String(a);this.specified=this.value.length>0;if(this.___link)this.___link.nodeValue=a}};DOMAttr.prototype.toString=function(){var a="";if(this.___link)this.nodeValue=this.___link.nodeValue;a+=this.nodeName+'="'+this.__escapeString(this.nodeValue)+'"';return a};DOMAttr.prototype.getOwnerElement=function(){return this.ownerElement};
DOMNamespace=function(a){this._class=addClass(this._class,"DOMNamespace");this.DOMNode=DOMNode;this.DOMNode(a);this.name="";this.specified=false;this.value="";this.nodeType=DOMNode.NAMESPACE_NODE};DOMNamespace.prototype=new DOMNode;DOMNamespace.prototype.getValue=function(){return this.nodeValue};DOMNamespace.prototype.setValue=function(a){this.value=this.nodeValue=new String(a)};
DOMNamespace.prototype.toString=function(){var a="";a+=this.nodeName!=""?this.nodeName+'="'+this.__escapeString(this.nodeValue)+'"':'xmlns="'+this.__escapeString(this.nodeValue)+'"';return a};DOMCharacterData=function(a){this._class=addClass(this._class,"DOMCharacterData");this.DOMNode=DOMNode;this.DOMNode(a);this.data="";this.length=0};DOMCharacterData.prototype=new DOMNode;DOMCharacterData.prototype.getData=function(){if(this.___link)return this.___link.nodeValue;return this.nodeValue};
DOMCharacterData.prototype.setData=function(a){this.setNodeValue(a)};DOMCharacterData.prototype.setNodeValue=function(a){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);this.data=this.nodeValue=new String(a);if(this.___link)this.___link.nodeValue=a;this.length=this.nodeValue.length};DOMCharacterData.prototype.getLength=function(){if(this.___link)return this.___link.length;return this.nodeValue.length};
DOMCharacterData.prototype.substringData=function(a,c){var b=null;if(this.___link)this.data=this.___link.nodeValue;if(this.data){if(this.ownerDocument.implementation.errorChecking&&(a<0||a>this.data.length||c<0))throw new DOMException(DOMException.INDEX_SIZE_ERR);b=c?this.data.substring(a,a+c):this.data.substring(a)}return b};
DOMCharacterData.prototype.appendData=function(a){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);this.setData(""+this.data+a);this.___link&&this.___link.appendData(a)};
DOMCharacterData.prototype.insertData=function(a,c){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.___link)this.data=this.___link.nodeValue;if(this.data){if(this.ownerDocument.implementation.errorChecking&&(a<0||a>this.data.length))throw new DOMException(DOMException.INDEX_SIZE_ERR);this.setData(this.data.substring(0,a).concat(c,this.data.substring(a)))}else{if(this.ownerDocument.implementation.errorChecking&&
a!=0)throw new DOMException(DOMException.INDEX_SIZE_ERR);this.setData(c)}this.___link&&this.___link.insertData(a,c)};
DOMCharacterData.prototype.deleteData=function(a,c){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.___link)this.data=this.___link.nodeValue;if(this.data){if(this.ownerDocument.implementation.errorChecking&&(a<0||a>this.data.length||c<0))throw new DOMException(DOMException.INDEX_SIZE_ERR);!c||a+c>this.data.length?this.setData(this.data.substring(0,a)):this.setData(this.data.substring(0,a).concat(this.data.substring(a+
c)))}this.___link&&this.___link.deleteData(a,c)};
DOMCharacterData.prototype.replaceData=function(a,c,b){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(this.___link)this.data=this.___link.nodeValue;if(this.data){if(this.ownerDocument.implementation.errorChecking&&(a<0||a>this.data.length||c<0))throw new DOMException(DOMException.INDEX_SIZE_ERR);this.setData(this.data.substring(0,a).concat(b,this.data.substring(a+c)))}else this.setData(b);this.___link&&this.___link.replaceData(a,
c,b)};DOMText=function(a){this._class=addClass(this._class,"DOMText");this.DOMCharacterData=DOMCharacterData;this.DOMCharacterData(a);this.nodeName="#text";this.nodeType=DOMNode.TEXT_NODE};DOMText.prototype=new DOMCharacterData;
DOMText.prototype.splitText=function(a){var c;if(this.ownerDocument.implementation.errorChecking){if(this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(a<0||a>this.data.length)throw new DOMException(DOMException.INDEX_SIZE_ERR);}if(this.parentNode){c=this.substringData(a);c=this.ownerDocument.createTextNode(c);this.nextSibling?this.parentNode.insertBefore(c,this.nextSibling):this.parentNode.appendChild(c);this.deleteData(a)}return c};
DOMText.prototype.toString=function(){if(this.___link)return this.__escapeString(""+this.___link.nodeValue);return this.__escapeString(""+this.nodeValue)};DOMCDATASection=function(a){this._class=addClass(this._class,"DOMCDATASection");this.DOMCharacterData=DOMCharacterData;this.DOMCharacterData(a);this.nodeName="#cdata-section";this.nodeType=DOMNode.CDATA_SECTION_NODE};DOMCDATASection.prototype=new DOMCharacterData;
DOMCDATASection.prototype.splitText=function(a){var c;if(this.ownerDocument.implementation.errorChecking){if(this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);if(a<0||a>this.data.length)throw new DOMException(DOMException.INDEX_SIZE_ERR);}if(this.parentNode){c=this.substringData(a);c=this.ownerDocument.createCDATASection(c);this.nextSibling?this.parentNode.insertBefore(c,this.nextSibling):this.parentNode.appendChild(c);this.deleteData(a)}return c};
DOMCDATASection.prototype.toString=function(){var a="";a+="<![CDATA["+this.nodeValue+"]]\>";return a};DOMComment=function(a){this._class=addClass(this._class,"DOMComment");this.DOMCharacterData=DOMCharacterData;this.DOMCharacterData(a);this.nodeName="#comment";this.nodeType=DOMNode.COMMENT_NODE};DOMComment.prototype=new DOMCharacterData;DOMComment.prototype.toString=function(){var a="";a+="<!--"+this.nodeValue+"--\>";return a};
DOMProcessingInstruction=function(a){this._class=addClass(this._class,"DOMProcessingInstruction");this.DOMNode=DOMNode;this.DOMNode(a);this.data=this.target="";this.nodeType=DOMNode.PROCESSING_INSTRUCTION_NODE};DOMProcessingInstruction.prototype=new DOMNode;DOMProcessingInstruction.prototype.getTarget=function(){return this.nodeName};DOMProcessingInstruction.prototype.getData=function(){return this.nodeValue};DOMProcessingInstruction.prototype.setData=function(a){this.setNodeValue(a)};
DOMProcessingInstruction.prototype.setNodeValue=function(a){if(this.ownerDocument.implementation.errorChecking&&this._readonly)throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);this.data=this.nodeValue=new String(a)};DOMProcessingInstruction.prototype.toString=function(){var a="";a+="<?"+this.nodeName+" "+this.nodeValue+" ?>";return a};
DOMDocumentFragment=function(a){this._class=addClass(this._class,"DOMDocumentFragment");this.DOMNode=DOMNode;this.DOMNode(a);this.nodeName="#document-fragment";this.nodeType=DOMNode.DOCUMENT_FRAGMENT_NODE};DOMDocumentFragment.prototype=new DOMNode;DOMDocumentFragment.prototype.toString=function(){var a="",c=this.getChildNodes().getLength();for(intLoop=0;intLoop<c;intLoop++)a+=this.getChildNodes().item(intLoop).toString();return a};DOMDocumentType=function(){alert("DOMDocumentType.constructor(): Not Implemented")};
DOMEntity=function(){alert("DOMEntity.constructor(): Not Implemented")};DOMEntityReference=function(){alert("DOMEntityReference.constructor(): Not Implemented")};DOMNotation=function(){alert("DOMNotation.constructor(): Not Implemented")};Strings={};Strings.WHITESPACE=" \t\n\r";Strings.QUOTES="\"'";Strings.isEmpty=function(a){return a==null||a.length==0};
Strings.indexOfNonWhitespace=function(a,c,b){if(Strings.isEmpty(a))return-1;c=c||0;b=b||a.length;for(c=c;c<b;c++)if(Strings.WHITESPACE.indexOf(a.charAt(c))==-1)return c;return-1};Strings.lastIndexOfNonWhitespace=function(a,c,b){if(Strings.isEmpty(a))return-1;c=c||0;b=b||a.length;for(b=b-1;b>=c;b--)if(Strings.WHITESPACE.indexOf(a.charAt(b))==-1)return b;return-1};
Strings.indexOfWhitespace=function(a,c,b){if(Strings.isEmpty(a))return-1;c=c||0;b=b||a.length;for(c=c;c<b;c++)if(Strings.WHITESPACE.indexOf(a.charAt(c))!=-1)return c;return-1};Strings.replace=function(a,c,b,f,d){if(Strings.isEmpty(a))return"";c=c||0;b=b||a.length;return a.substring(c,b).split(f).join(d)};Strings.getLineNumber=function(a,c){if(Strings.isEmpty(a))return-1;c=c||a.length;return a.substring(0,c).split("\n").length};
Strings.getColumnNumber=function(a,c){if(Strings.isEmpty(a))return-1;c=c||a.length;var b=a.substring(0,c).split("\n");b.length--;b=b.join("\n").length;return c-b};StringBuffer=function(){this._a=[]};StringBuffer.prototype.append=function(a){this._a[this._a.length]=a};StringBuffer.prototype.toString=function(){return this._a.join("")};
function applyStyleRules(a,c){for(var b=c.split(";"),f,d,g,k,h=0;h<b.length;h++){f=trim(b[h],true,true);if(f.length>3){d=trim(f.split(":")[0],true,true);f=trim(f.split(":").splice(1,f.split(":").length).join(":"),true,true);g=d.split("-")[0];k=d.split("-")[1];if(g&&k)d=g+k.charAt(0).toUpperCase()+k.slice(1);if(d=="float")d="styleFloat";try{a.style[d]=f}catch(l){window.console&&console.log("CSS Error was:"+d+"="+f)}}}}
Jnaric.prototype.bind_dom=function(a){var c=this;this.global.document=(new DOMImplementation).loadXML("<div/>");this.global.document.body=this.global.document.documentElement;typeof a!="undefined"&&a.___link.appendChild(this.global.document.body.___link);this.uriId=this.uri2id(this.uri);this.global.document.body.___link.id=this.uriId;this.global.document.___vm=this;this.global.document.defaultView=this.global;extendWindow(this.global);this.global.importCSS=function(b){return c._importCSS(c,b,true)};
this.global.document.styleSheets=[new __CSSStyleSheet(this)];this.cssRules=[]};document.getElementsByTagName("HEAD")[0].insertBefore(document.createElement("STYLE"),document.getElementsByTagName("HEAD")[0].firstChild);
Jnaric.prototype._importCSS=function(a,c,b){if(b){a.cur_stack.EXCEPTION=false;a.cur_stack.my.v0=undefined;var f=__jn_stacks.newId();a.cur_stack.STOP=f;var d=a.cur_stack}kIPC(a,c,"read",[],function(g){g=g.result.toString();if(!(b&&d.STOP!=f)){g.replace(/\/\*.+\*\//g,"");g=g.split("}");g.pop();if(b)d.my.x2.result=true;if(a.global.document.styleSheets[0])for(var k=0;k<g.length;k++)try{a.global.document.styleSheets[0].insertRule(g[k]+"}")}catch(h){a.ErrorConsole.log("Error parsing CSS rule: "+g[k]+"}; Error: "+
h);if(b)d.my.x2.result=false}if(b){d.STOP=false;__jn_stacks.start(d.pid)}}},function(g){if(!(b&&d.STOP!=f))if(b){d.EXCEPTION=THROW;var k=new a.global.InternalError("importCSS('"+c+"') failed with exception: "+g.result);k.status=g.status;d.exc.result=k;d.STOP=false;__jn_stacks.start(d.pid)}else a.ErrorConsole.log("importCSS('"+c+"') failed with exception: "+g.result)})};
Jnaric.prototype.uri2id=function(a){var c="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z";c+=","+c.toUpperCase();var b=c.split(",");c={};for(var f=0;f<b.length;f++)c[b[f]]=true;b="ID";for(f=0;f<a.length;f++)b+=a.charAt(f)in c?a.charAt(f):a.charCodeAt(f).toString();return b};function __htmldom_set_direct(a,c){if(this.___link)this.___link[a]=c;else return this[a]=c;return c}function __htmldom_get_direct(a){return this.___link?this.___link[a]:this[a]}
function __htmldom_getter_this(a){try{return this["get"+a.charAt(0).toUpperCase()+a.substr(1)]()}catch(c){}}function __htmldom_get_wrappedElement(a){if(!this.___link)return null;return this.ownerDocument.___get_from_link(this.___link[a])||null}function _col_item(a){return this[a]}function _col_namedItem(a){for(var c=0;c<this.length;c++)if(this[c].id==a)return this[c];for(c=0;c<this.length;c++)if(this[c].getAttribute("name")==a)return this[c];return null}
function __htmldom_get_wrappedElement_list(a){if(!this.___link)return null;a=this.___link[a];var c,b=[];b.item=_col_item;b.namedItem=_col_namedItem;for(var f=0;f<a.length;f++)(c=this.ownerDocument.___get_from_link(a[f]))&&b.push(c);return b}
___DOMHTMLGetters={contentEditable:__htmldom_get_direct,innerHTML:__htmldom_get_direct,textContent:function(a){if(!this.___link)return this[a];if("textContent"in this.___link)return this.___link.textContent;return this.___link.innerText},id:function(a){return this.___link?this.getAttribute(a):this.id},offsetParent:function(){var a=this.getParentNode();if(a.___link)if(a.___link==this.___link.offsetParent)return a;else{if(a=this.ownerDocument.___get_from_link(this.___link.offsetParent))return a;return null}return null},
ownerDocument:function(){return this.ownerDocument},childNodes:function(){var a=[].concat(this.childNodes._nodes);a.item=function(c){return this[c]};return a},firstChild:__htmldom_getter_this,lastChild:__htmldom_getter_this,nextSibling:__htmldom_getter_this,previousSibling:__htmldom_getter_this,nodeName:__htmldom_getter_this,nodeType:__htmldom_getter_this,nodeValue:__htmldom_getter_this,parentNode:__htmldom_getter_this,tagName:__htmldom_getter_this,scrollLeft:__htmldom_get_direct,scrollTop:__htmldom_get_direct,
tabIndex:__htmldom_get_direct,title:__htmldom_get_direct,dir:__htmldom_get_direct,className:__htmldom_get_direct,clientHeight:__htmldom_get_direct,clientLeft:__htmldom_get_direct,clientTop:__htmldom_get_direct,clientWidth:__htmldom_get_direct,offsetHeight:__htmldom_get_direct,offsetLeft:__htmldom_get_direct,offsetTop:__htmldom_get_direct,offsetWidth:__htmldom_get_direct,scrollHeight:__htmldom_get_direct,scrollWidth:__htmldom_get_direct,name:__htmldom_get_direct,onbeforeunload:__get_onevent_listener,
onblur:__get_onevent_listener,onchange:__get_onevent_listener,onclick:__get_onevent_listener,oncontextmenu:__get_onevent_listener,ondblclick:__get_onevent_listener,onfocus:__get_onevent_listener,onkeydown:__get_onevent_listener,onkeypress:__get_onevent_listener,onkeyup:__get_onevent_listener,onmousedown:__get_onevent_listener,onmousemove:__get_onevent_listener,onmouseout:__get_onevent_listener,onmouseover:__get_onevent_listener,onmouseup:__get_onevent_listener,onresize:__get_onevent_listener,onscroll:__get_onevent_listener,
onsubmit:__get_onevent_listener,charset:__htmldom_get_direct,disabled:__htmldom_get_direct,href:__htmldom_get_direct,hreflang:__htmldom_get_direct,media:__htmldom_get_direct,rel:__htmldom_get_direct,rev:__htmldom_get_direct,target:__htmldom_get_direct,type:__htmldom_get_direct,spellcheck:__htmldom_get_direct,action:__htmldom_get_direct,enctype:__htmldom_get_direct,encoding:__htmldom_get_direct,method:__htmldom_get_direct,accessKey:__htmldom_get_direct,alt:__htmldom_get_direct,checked:__htmldom_get_direct,
defaultValue:__htmldom_get_direct,defaultChecked:__htmldom_get_direct,disabled:__htmldom_get_direct,maxLength:__htmldom_get_direct,name:__htmldom_get_direct,readOnly:__htmldom_get_direct,selectionEnd:__htmldom_get_direct,selectionStart:__htmldom_get_direct,size:__htmldom_get_direct,src:__htmldom_get_direct,tabIndex:__htmldom_get_direct,textLength:1,type:1,useMap:__htmldom_get_direct,value:__htmldom_get_direct,rows:__htmldom_get_wrappedElement_list,cells:__htmldom_get_wrappedElement_list,tBodies:__htmldom_get_wrappedElement_list,
tHead:__htmldom_get_wrappedElement,tFoot:__htmldom_get_wrappedElement,cellIndex:__htmldom_get_direct,rowIndex:__htmldom_get_direct,selectedIndex:__htmldom_get_direct,options:__htmldom_get_wrappedElement_list};
___DOMHTMLSetters={contentEditable:__htmldom_set_direct,innerHTML:function(a,c){this.childNodes._nodes=[];var b=new DOMImplementation;b=this.tagName&&b._isValidName(this.tagName.toString())?b.loadXML("<"+this.tagName+">"+c+"</"+this.tagName+">",this.ownerDocument.___vm):b.loadXML("<div>"+c+"</div>",this.ownerDocument.___vm);this.___link.innerHTML="";for(var f=b.documentElement.getElementsByTagName("*"),d=0;d<f.length;d++){f[d].ownerDocument=this.ownerDocument;f[d].attributes.ownerDocument=this.ownerDocument}for(f=
0;f<b.all.length;f++)b.all[f].ownerDocument=this.ownerDocument;for(this.ownerDocument.all=this.ownerDocument.all.concat(b.all);b.documentElement.childNodes.getLength();){b.documentElement.childNodes.item(0).ownerDocument=this.ownerDocument;this.appendChild(b.documentElement.childNodes.item(0))}},textContent:function(a,c){if(!this.___link)return this[a]=c;if("textContent"in this.___link)this.___link.textContent=c;this.___link.innerText=c},id:function(a,c){if(this.___link)this.setAttribute(a,c);else this.id=
c;return this.id},scrollLeft:__htmldom_set_direct,scrollTop:__htmldom_set_direct,tabIndex:__htmldom_set_direct,title:__htmldom_set_direct,dir:__htmldom_set_direct,className:__htmldom_set_direct,clientHeight:1,clientLeft:1,clientTop:1,clientWidth:1,offsetHeight:1,offsetLeft:1,offsetTop:1,offsetWidth:1,scrollHeight:1,scrollWidth:1,offsetParent:1,ownerDocument:1,childNodes:1,firstChild:1,lastChild:1,nextSibling:1,previousSibling:1,nodeName:1,nodeType:1,nodeValue:__htmldom_set_direct,parentNode:1,tagName:1,
name:1,onbeforeunload:__set_onevent_listener,onblur:__set_onevent_listener,onchange:__set_onevent_listener,onclick:__set_onevent_listener,oncontextmenu:__set_onevent_listener,ondblclick:__set_onevent_listener,onfocus:__set_onevent_listener,onkeydown:__set_onevent_listener,onkeypress:__set_onevent_listener,onkeyup:__set_onevent_listener,onmousedown:__set_onevent_listener,onmousemove:__set_onevent_listener,onmouseout:__set_onevent_listener,onmouseover:__set_onevent_listener,onmouseup:__set_onevent_listener,
onresize:__set_onevent_listener,onscroll:__set_onevent_listener,onsubmit:__set_onevent_listener,charset:__htmldom_set_direct,disabled:__htmldom_set_direct,href:__htmldom_set_direct,hreflang:__htmldom_set_direct,media:__htmldom_set_direct,rel:__htmldom_set_direct,rev:__htmldom_set_direct,target:function(a,c){if(this.tagName.toLowerCase()!="a")if(c!="_self")this[a]=c},type:__htmldom_set_direct,spellcheck:__htmldom_set_direct,action:__htmldom_set_direct,enctype:__htmldom_set_direct,encoding:__htmldom_set_direct,
method:__htmldom_set_direct,accept:__htmldom_set_direct,accessKey:__htmldom_set_direct,alt:__htmldom_set_direct,checked:__htmldom_set_direct,defaultValue:__htmldom_set_direct,defaultChecked:__htmldom_set_direct,disabled:__htmldom_set_direct,maxLength:__htmldom_set_direct,name:__htmldom_set_direct,readOnly:__htmldom_set_direct,selectionEnd:__htmldom_set_direct,selectionStart:__htmldom_set_direct,size:__htmldom_set_direct,src:__htmldom_set_direct,tabIndex:__htmldom_set_direct,textLength:1,useMap:__htmldom_set_direct,
value:__htmldom_set_direct,rows:1,cells:1,tHead:1,tFoot:1,tBodies:1,cellIndex:1,rowIndex:1,selectedIndex:__htmldom_set_direct,options:1};DOMNode.prototype.___getters=___DOMHTMLGetters;DOMNode.prototype.___setters=___DOMHTMLSetters;DOMElement.prototype.submit=function(){this.___link&&this.___link.submit&&this.___link.submit()};DOMElement.prototype.reset=function(){this.___link&&this.___link.reset&&this.___link.reset()};DOMElement.prototype.focus=function(){if(this.___link&&this.___link.focus)try{this.___link.focus()}catch(a){}};
DOMElement.prototype.blur=function(){this.___link&&this.___link.blur&&this.___link.blur()};DOMElement.prototype.click=function(){this.___link&&this.___link.click&&this.___link.click()};DOMElement.prototype.scrollIntoView=function(a){if(this.___link&&this.___link.scrollIntoView)a?this.___link.scrollIntoView(a):this.___link.scrollIntoView()};
DOMElement.prototype.compareDocumentPosition=function(a){var c=this.___link;a=a.___link;return c.compareDocumentPosition?c.compareDocumentPosition(a):c.contains?(c!=a&&c.contains(a)&&16)+(c!=a&&a.contains(c)&&8)+(c.sourceIndex>=0&&a.sourceIndex>=0?(c.sourceIndex<a.sourceIndex&&4)+(c.sourceIndex>a.sourceIndex&&2):1)+0:0};
___DOCHTMLGetters={designMode:function(){return this.body.___link&&this.body.___link.contentEditable?"on":"off"},textContent:function(){return null},ownerDocument:function(){return null},childNodes:function(){return[].concat(this.childNodes._nodes)},firstChild:__htmldom_getter_this,lastChild:__htmldom_getter_this,nextSibling:__htmldom_getter_this,previousSibling:__htmldom_getter_this,nodeName:__htmldom_getter_this,nodeType:__htmldom_getter_this,nodeValue:__htmldom_getter_this,parentNode:__htmldom_getter_this,
tagName:__htmldom_getter_this,title:function(){return"JENERIC"},dir:__htmldom_get_direct,activeElement:function(){if(typeof document!="undefined"&&document.activeElement){var a=this.___get_from_link(document.activeElement);if(a)return a}return this.body},height:function(){if(this.documentElement.___link)return this.documentElement.___link.scrollHeight;return 0},width:function(){if(this.documentElement.___link)return this.documentElement.___link.scrollWidth;return 0},onbeforeunload:__get_onevent_listener,
onblur:__get_onevent_listener,onchange:__get_onevent_listener,onclick:__get_onevent_listener,oncontextmenu:__get_onevent_listener,ondblclick:__get_onevent_listener,onfocus:__get_onevent_listener,onkeydown:__get_onevent_listener,onkeypress:__get_onevent_listener,onkeyup:__get_onevent_listener,onmousedown:__get_onevent_listener,onmousemove:__get_onevent_listener,onmouseout:__get_onevent_listener,onmouseover:__get_onevent_listener,onmouseup:__get_onevent_listener,onresize:__get_onevent_listener,onscroll:__get_onevent_listener,
onsubmit:__get_onevent_listener};
___DOCHTMLSetters={contentEditable:__htmldom_set_direct,designMode:function(a,c){this.body.___link&&(this.body.___link.contentEditable=c=="on"?true:false)},textContent:function(a,c){return c},title:function(a,c){return c},dir:__htmldom_set_direct,ownerDocument:1,childNodes:1,firstChild:1,lastChild:1,nextSibling:1,previousSibling:1,nodeName:1,nodeType:1,nodeValue:1,parentNode:1,tagName:1,activeElement:1,height:1,width:1,onbeforeunload:__set_onevent_listener,onblur:__set_onevent_listener,onchange:__set_onevent_listener,
onclick:__set_onevent_listener,oncontextmenu:__set_onevent_listener,ondblclick:__set_onevent_listener,onfocus:__set_onevent_listener,onkeydown:__set_onevent_listener,onkeypress:__set_onevent_listener,onkeyup:__set_onevent_listener,onmousedown:__set_onevent_listener,onmousemove:__set_onevent_listener,onmouseout:__set_onevent_listener,onmouseover:__set_onevent_listener,onmouseup:__set_onevent_listener,onresize:__set_onevent_listener,onscroll:__set_onevent_listener,onsubmit:__set_onevent_listener};
DOMDocument.prototype.___getters=___DOCHTMLGetters;DOMDocument.prototype.___setters=___DOCHTMLSetters;DOMDocument.prototype.characterSet="UTF-8";DOMDocument.prototype.inputEncoding="UTF-8";DOMDocument.prototype.contentType="text/html";DOMDocument.prototype.referrer="#";DOMDocument.prototype.documentURI="";DOMDocument.prototype.domain="";DOMDocument.prototype.location="";DOMDocument.prototype.URL="";
DOMDocument.prototype.hasFocus=function(){if(typeof document!="undefined"&&document.hasFocus)return document.hasFocus();return false};DOMDocument.prototype.getElementsByName=function(){};
DOMDocument.prototype.___get_from_link=function(a){if(a){if(!this.___DOMcache||this.___DOMcache_outdated)this.___rebuild_cache();var c=a.nodeType==3?a.parentNode:a,b=this.___DOMcache[c.___id];if(!b)if(this.defaultView.frames.length)for(var f=0;f<this.defaultView.frames.length;f++){b=this.defaultView.frames[f].contentDocument;if(!b.___DOMcache||b.___DOMcache_outdated)b.___rebuild_cache();if(b=b.___DOMcache[c.___id])break}if(!b)return null;if(a.nodeType==3){console.log("doing for text node");if(c.childNodes.length==
1)if(b.childNodes._nodes.length==1)return b.getFirstChild();else{window.console&&console.log&&console.log("get_from_link: XML tree TextNodes inconsistency #1");return null}else{NOTNORM=c;window.console&&console.log&&console.log("Can not normalize yet!")}}else return b}};
DOMDocument.prototype.___rebuild_cache=function(){var a=this.documentElement.getElementsByTagName("*")._nodes;delete this.___DOMcache;this.___DOMcache={};for(var c=0;c<a.length;c++)if(a[c].___link)this.___DOMcache[a[c].___link.___id]=a[c];this.___DOMcache_outdated=false};DOMDocument.prototype.write=function(){var a=Array.prototype.slice.call(arguments).join("");this._parseComplete=false;parser=new XMLP(a);this.implementation.___parseLoop(this,parser);this._parseComplete=true};
DOMDocument.prototype.open=function(){};DOMDocument.prototype.close=function(){};function fake(){}
DOMElement.prototype.addEventListener=function(a,c,b,f,d){if(this.___link){var g=this.ownerDocument.___vm;if(!(c.node&&c.scope))throw new g.global.TypeError("JNARIC: addEventListener second argument must be a function");if(!(this.___listeners&&this.___listeners[a]&&this.___listeners[a][c])){var k=undefined;b=function(h){h=new __Event(g,h);if(h.target!=null){d&&h.preventDefault();var l=function(m){g.ErrorConsole.log("Error executing event handler: "+m)};if(k&&k.stack.length>0){if(f)return;if(k.stack.length>
1E3){window.console&&console.log("Event handler: stack too deep (pid "+k.pid+"); skipping event!");return}g.execf_stack(k,c,[h],h.target)}else k=g.execf_thread(c,[h],fake,l,-11,h.target);if(d||h.___preventDefault)return false;h.passed=true;h.cancelable=false}};this.___link.attachEvent?this.___link.attachEvent("on"+a,b):this.___link.addEventListener(a,b,false);if(!this.___listeners)this.___listeners={};this.___listeners[a]||(this.___listeners[a]={});this.___listeners[a][c]=b}}};
DOMDocument.prototype.addEventListener=function(a,c,b,f,d){this.body.LISTENING=true;this.body.addEventListener(a,c,b,f,d)};DOMDocument.prototype.removeEventListener=function(a,c,b){this.documentElement.removeEventListener(a,c,b)};DOMDocument.prototype.listEventListeners=function(a,c,b){this.documentElement.listEventListeners(a,c,b)};
DOMElement.prototype.removeEventListener=function(a,c){if(this.___listeners&&this.___listeners[a])if(this.___link)if(c in this.___listeners[a]){var b=this.___listeners[a][c];this.___link.attachEvent?this.___link.detachEvent("on"+a,b):this.___link.removeEventListener(a,b,false);delete this.___listeners[a][c]}};DOMElement.prototype.listEventListeners=function(){if(this.___listeners){var a={};for(var c in this.___listeners){a[c]={};for(var b in this.___listeners[c])a[c]=b}return a}};
DOMElement.prototype.dispatchEvent=function(a){if(this.___link)this.___link.dispatchEvent?this.___link.dispatchEvent(a.___link):this.___link.fireEvent(a.___link)};
DOMElement.prototype.waitEvent=function(a,c,b,f){c=c||0;var d=this.ownerDocument.___vm,g=this.ownerDocument.___vm.cur_stack,k=g.my.x2;g.EXCEPTION=false;var h=__jn_stacks.newId();g.STOP=h;var l=this,m=function(q){e=new __Event(d,q);if(e.target==l){if(b){var s=false;for(var o in b)if(b[o]instanceof Array){for(var p=0;p<b[o].length;p++)if(b[o][p]==e[o])s=true;if(!s)return}else if(e[o]!=b[o])return}f&&e.preventDefault();l.___link.addEventListener?l.___link.removeEventListener(a,arguments.callee,false):
l.___link.detachEvent("on"+a,arguments.callee);k.result=e;g.EXCEPTION=RETURN;g.STOP=false;__jn_stacks.start(g.pid);if(f)return false}};this.___link.addEventListener?this.___link.addEventListener(a,m,false):this.___link.attachEvent("on"+a,m);c&&setTimeout(function(){if(g.STOP==h){k.result=null;g.EXCEPTION=RETURN;g.STOP=false;__jn_stacks.start(g.pid)}},c)};
DOMDocument.prototype.createEvent=function(a){a=document.createEventObject?document.createEventObject():document.createEvent(a);vm=this.___vm;return new __Event(vm,a)};
function __Event(a,c){if(!c&&window.event)c=window.event;else if(!c&&!window.event)throw"Assert failed: no event supplied for init";this.___vm=a;this.___link=c;this.altKey=c.altKey;this.ctrlKey=c.ctrlKey;this.clientX=c.clientX;this.clientY=c.clientY;this.screenX=c.screenX;this.screenY=c.screenY;this.shiftKey=c.shiftKey;this.type=c.type;this.keyCode=c.keyCode;this.charCode=c.srcElement?String.fromCharCode(c.keyCode):c.charCode;this.isChar=this.charCode>0;if(c.which)this.which=c.which;else{if(c.button==
1)this.which=1;if(c.button==4)this.which=2;if(c.button==2)this.which=3}if(this.which)this.button=this.which-1;this.target=c.target?this.___vm.global.document.___get_from_link(c.target):this.___vm.global.document.___get_from_link(c.srcElement);this.relatedTarget=c.relatedTarget?this.___vm.global.document.___get_from_link(c.relatedTarget):this.___vm.global.document.___get_from_link(c.fromElement);this.currentTarget=c.currentTarget?this.___vm.global.document.___get_from_link(c.currentTarget):this.___vm.global.document.___get_from_link(c.toElement);
if(this.target==this.relatedTarget)this.relatedTarget=this.currentTarget}__Event.prototype.___getters={targetX:function(){if(!this.clientX)return null;var a=0,c=this.target.___link;if(c.offsetParent){do a+=c.offsetLeft;while(c=c.offsetParent)}return this.clientX+window.scrollX-a},targetY:function(){if(!this.clientY)return null;var a=0,c=this.target.___link;if(c.offsetParent){do a+=c.offsetTop;while(c=c.offsetParent)}return this.clientY+window.scrollY-a}};__Event.prototype.___setters={targetX:1,targetY:1};
__Event.prototype.toString=function(){return"[object Event]"};__Event.prototype.initEvent=function(a,c,b){this.___link.initEvent&&this.___link.initEvent(a,c,b)};__Event.prototype.preventDefault=function(){this.___preventDefault=true;if(this.___link)if(this.___link.preventDefault){this.___link.preventDefault();this.passed&&this.___vm.ErrorConsole.log("failed to preventDefault(): check event preemption condition")}else try{this.___link.returnValue=false}catch(a){this.___vm.ErrorConsole.log("failed to set .returnValue: check event preemption condition")}};
__Event.prototype.stopPropagation=function(){if(this.___link)if(this.___link.stopPropagation)this.___link.stopPropagation();else this.___link.cancelBubble=true};__Event.prototype.initKeyEvent=function(){};__Event.prototype.initMouseEvent=function(){};__Event.prototype.initUIEvent=function(){};
function __set_onevent_listener(a,c){this["___"+a]&&this.removeEventListener(a.slice(2),this["___"+a],false);if(!c||!c.node||!c.scope)delete this["___"+a];else{this.addEventListener(a.slice(2),c,false);this["___"+a]=c}}function __get_onevent_listener(a){var c=a.slice(2);if(!this.___listeners)this.___listeners={};if(this.___listeners[c]&&this.___listeners[c][this["___"+a]])return this["___"+a];return null}
function extendWindow(a){a.window=a;a.frameElement=null;a.frames=[];a.length=0;a.window.location="JENERIC";a.window.parent=a.window;a.window.top=a.window;a.window.window=a.window;a.window.self=a.window;for(ob in __Window.prototype)a[ob]=__Window.prototype[ob];a.window.___link=window}function __Window(){this.frameElement=null;this.frames=[];this.length=0;this.___link=window}__Window.prototype.escape=escape;__Window.prototype.unescape=unescape;__Window.prototype.encodeURI=encodeURI;
__Window.prototype.decodeURI=decodeURI;__Window.prototype.btoa=Orbited.base64.encode;__Window.prototype.atob=Orbited.base64.decode;__Window.prototype.scrollTo=function(a,c){window.scrollTo&&window.scrollTo(a,c)};__Window.prototype.scroll=__Window.prototype.scrollTo;__Window.prototype.scrollBy=function(a,c){window.scrollBy&&window.scrollBy(a,c)};__Window.prototype.focus=function(){window.focus()};__Window.prototype.blur=function(){};
__Window.prototype.addEventListener=function(a,c,b,f,d){if(a=="load"||a=="DOMContentLoaded"){var g=null;if(this.document.___scriptTagStack)g=this.document.___scriptTagStack;else for(a=0;a<this.frames.length;a++)if(this.frames[a].contentWindow.document.___scriptTagStack)g=this.frames[a].contentWindow.document.___scriptTagStack;if(g){var k=this;g.onfinish=function(){if(!g.queueSize){var h=function(l){k.document.___vm.ErrorConsole.log("Error executing onload event handler: "+l)};if(g.global_scope){h=
new k.document.___vm.ExecutionContext(GLOBAL_CODE);h.scope={object:k.document.defaultView,parent:null};h=new __Stack(h);h.global_scope=g.global_scope;h.onerror=function(l){k.document.___vm.ErrorConsole.log("Error executing onload(): "+l)};h=k.document.___vm.execf_stack(h,c,[{}],k.document.defaultView);__jn_stacks.add_task(k.document.___vm,h,k.document.___vm.nice,k.document.___vm.throttle)}else{console.log("Starting onload via THREAD");k.document.___vm.execf_thread(c,[{}],fake,h)}}}}else this.document.___vm.ErrorConsole.log("Failed to find which script stack to attach onload to!")}else a!=
"unload"&&this.document.body.addEventListener(a,c,b,f,d)};__Window.prototype.removeEventListener=function(a,c,b){a!="load"&&a!="unload"&&this.document.body.removeEventListener(a,c,b)};
if(window.getSelection){__Window.prototype.getSelection=function(){var a=new __Selection;a.___document=this.document;return a};var __Selection=function(){this.___link=this.sel=window.getSelection()};__Selection.prototype.getRangeAt=function(a){if(this.___link.getRangeAt)a=this.___link.getRangeAt(a);else{a=document.createRange();a.setStart(this.___link.anchorNode,this.___link.anchorOffset);a.setEnd(this.___link.focusNode,this.___link.focusOffset)}var c=new __Range;c.___link=a;c.___document=this.___document;
return c};__Selection.prototype.collapse=function(a,c){this.sel.collapse(a.___link,c)};__Selection.prototype.extend=function(a,c){this.sel.extend(a.___link,c)};__Selection.prototype.collapseToStart=function(){this.sel.collapseToStart()};__Selection.prototype.collapseToEnd=function(){this.sel.collapseToEnd()};__Selection.prototype.selectAllChildren=function(a){this.sel.selectAllChildren(a.___link)};__Selection.prototype.addRange=function(a){this.sel.addRange(a.___link)};__Selection.prototype.removeRange=
function(a){this.sel.removeRange(a.___link)};__Selection.prototype.removeAllRanges=function(){this.sel.removeAllRanges()};__Selection.prototype.deleteFromDocument=function(){this.sel.deleteFromDocument()};__Selection.prototype.containsNode=function(a,c){return this.sel.containsNode(a.___link,c)};__Selection.prototype.toString=function(){return this.___link.toString()};__Selection.prototype.___get_wrapped_node=function(a){return this.___document.___get_from_link(this.sel[a])};__Selection.prototype.___getters=
{anchorNode:__Selection.prototype.___get_wrapped_node,anchorOffset:__htmldom_get_direct,focusNode:__Selection.prototype.___get_wrapped_node,focusOffset:__htmldom_get_direct,isCollapsed:__htmldom_get_direct,rangeCount:function(){if(this.___link.rangeCount){var a=this.getRangeAt(0);if(a.___getters.startContainer.call(a,"startContainer")==null)return 0}if("rangeCount"in this.___link)return this.___link.rangeCount;return 0}};__Selection.prototype.___setters={anchorNode:1,anchorOffset:1,focusNode:1,focusOffset:1,
isCollapsed:1,rangeCount:1};var __Range=function(){};__Range.prototype.setStart=function(a,c){this.___link.setStart(a.___link,c)};__Range.prototype.setEnd=function(a,c){this.___link.setEnd(a.___link,c)};__Range.prototype.setStartBefore=function(a){this.___link.setStartBefore(a.___link)};__Range.prototype.setStartAfter=function(a){this.___link.setStartAfter(a.___link)};__Range.prototype.setEndBefore=function(a){this.___link.setEndBefore(a.___link)};__Range.prototype.setEndAfter=function(a){this.___link.setEndAfter(a.___link)};
__Range.prototype.selectNode=function(a){this.___link.selectNode(a.___link)};__Range.prototype.selectNodeContents=function(a){this.___link.selectNodeContents(a.___link)};__Range.prototype.collapse=function(a){this.___link.collapse(a)};__Range.prototype.cloneContents=function(){var a=this.___link.cloneContents(),c=document.createElement("DIV");c.appendChild(a);a=c.innerHTML;c=this.___document.createDocumentFragment();c.___setters.innerHTML.call(c,"innerHTML",a);return c};__Range.prototype.createContextualFragment=
function(a){var c=this.___document.createDocumentFragment();c.___setters.innerHTML.call(c,"innerHTML",a);return c};__Range.prototype.deleteContents=function(){this.___link.deleteContents()};__Range.prototype.extractContents=function(){var a=this.cloneContents();this.deleteContents();return a};__Range.prototype.insertNode=function(a){var c=this.___link.startContainer,b=this.___link.startOffset;if(c.nodeType==3){var f=c.textContent?c.textContent:c.innerText;if(b==0){var d=this.___document.___get_from_link(c);
d.getParentNode().insertBefore(a,d)}else if(b==f.length)if(c.nextSibling){d=this.___document.___get_from_link(c.nextSibling);d.getParentNode().insertBefore(a,d)}else{d=this.___document.___get_from_link(c.parentNode);d.appendChild(a)}else{d=this.___document.___get_from_link(c.parentNode);c=this.___document.___get_from_link(c);var g=f.slice(0,b);b=f.slice(b);f=this.___document.createTextNode(g);b=this.___document.createTextNode(b);d.replaceChild(b,c);d.insertBefore(f,b);d.insertBefore(a,b)}}else if(b==
c.childNodes.length)this.___document.___get_from_link(c).appendChild(a);else{d=b==0?this.___document.___get_from_link(c.firstChild):this.___document.___get_from_link(c.childNodes[b]);d.getParentNode().insertBefore(a,d)}};__Range.prototype.surroundContents=function(a){a.appendChild(this.extractContents());this.insertNode(a)};__Range.prototype.compareBoundaryPoints=function(a,c){return this.___link.compareBoundaryPoints(a,c.___link)};__Range.prototype.cloneRange=function(){var a=new __Range;a.___link=
this.___link.cloneRange();a.___document=this.___document;return a};__Range.prototype.detach=function(){this.___link.detach()};__Range.prototype.toString=function(){return this.___link.toString()};__Range.prototype.___getters={collapsed:function(){return this.___link.collapsed},commonAncestorContainer:function(a){if(a=this.___document.___get_from_link(this.___link[a]))return a;return null},endContainer:function(a){if(a=this.___document.___get_from_link(this.___link[a]))return a;return null},endOffset:function(){return this.___link.endOffset},
startContainer:function(a){var c=this.___document.___get_from_link(this.___link[a]);if(c)return c;console.log("CCC: no container!");CCC=this.___link[a];return null},startOffset:function(){return this.___link.startOffset}};__Range.prototype.___setters={collapsed:1,commonAncestorContainer:1,endContainer:1,endOffset:1,startContainer:1,startOffset:1};__Range.prototype.END_TO_END=Range.END_TO_END;__Range.prototype.END_TO_START=Range.END_TO_START;__Range.prototype.START_TO_END=Range.START_TO_END;__Range.prototype.START_TO_START=
Range.START_TO_START;DOMDocument.prototype.createRange=function(){var a=new __Range;a.___link=document.createRange();a.___document=this;return a}}else alert("IERange library not loaded!");__Window.prototype.getComputedStyle=function(a){return new ComputedStyle(a)};function ComputedStyle(a){this.el=a}ComputedStyle.prototype.getPropertyValue=function(a){return window.getComputedStyle?window.getComputedStyle(this.el.___link).getPropertyValue(a):this.el.___link.currentStyle[a]};
__window_getters={innerHeight:function(){if(window.innerHeight)return window.innerHeight;if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;return document.body.clientHeight},innerWidth:function(){if(window.innerWidth)return window.innerWidth;if(document.documentElement&&document.documentElement.clientWidth)return document.documentElement.clientWidth;return document.body.clientWidth},name:function(){return""},scrollX:function(){if(window.scrollX)return window.scrollX;
if(document.documentElement.scrollLeft)return document.documentElement.scrollLeft;return document.body.scrollLeft},scrollY:function(){if(window.scrollY)return window.scrollY;if(document.documentElement.scrollTop)return document.documentElement.scrollTop;return document.body.scrollTop}};__window_setters={innerHeight:1,innerWidth:1,name:fake,outerHeight:1,outerWidth:1,scrollX:1,scrollY:1};
__nav_set={appCodeName:1,appName:1,appVersion:1,buildID:1,cookieEnabled:1,language:1,mimeTypes:1,onLine:1,oscpu:1,platform:1,plugins:1,product:1,productSub:1,securityPolicy:1,userAgent:1,vendor:1,vendorSub:1};
__nav_get={appCodeName:function(){return"jeneric"},appName:function(){return"Netscape"},appVersion:function(){return"0.1"},buildID:function(){return"2009a"},cookieEnabled:function(){return false},language:function(){return"en-US"},mimeTypes:function(){return navigator.mimeTypes},onLine:function(){return true},oscpu:function(){return navigator.oscpu},platform:function(){return navigator.platform},plugins:function(){return navigator.plugins},product:function(){return"Gecko"},productSub:function(){return"Jeneric0.1"},
securityPolicy:function(){return"process"},userAgent:function(){return"Jeneric Web Virtual Machine (Gecko translator Jeneric 0.1)"},vendor:function(){return"jeneric.net"},vendorSub:function(){return"doc.jeneric.net"}};__vrt_set=__nav_set;function __get_real_nav(a){return navigator[a]}
__vrt_get={appCodeName:__get_real_nav,appName:__get_real_nav,appVersion:__get_real_nav,buildID:__get_real_nav,cookieEnabled:__get_real_nav,language:__get_real_nav,mimeTypes:__get_real_nav,onLine:__get_real_nav,oscpu:__get_real_nav,platform:__get_real_nav,plugins:__get_real_nav,product:__get_real_nav,productSub:__get_real_nav,securityPolicy:__get_real_nav,userAgent:__get_real_nav,vendor:__get_real_nav,vendorSub:__get_real_nav};
__Window.prototype.virtual={___setters:__vrt_set,___getters:__vrt_get,vmkernel:"ratbird",vmkernelVersion:"0.1"};__Window.prototype.navigator={___setters:__nav_set,___getters:__nav_get};__Window.prototype.___getters=__window_getters;__Window.prototype.___setters=__window_setters;
__execCMDs={backColor:1,bold:1,contentReadOnly:1,copy:1,createLink:1,cut:1,decreaseFontSize:1,"delete":1,fontName:1,fontSize:1,foreColor:1,formatBlock:1,heading:1,hiliteColor:1,increaseFontSize:1,indent:1,insertHorizontalRule:1,insertImage:1,insertOrderedList:1,insertUnorderedList:1,insertParagraph:1,italic:1,justifyCenter:1,justifyLeft:1,justifyRight:1,outdent:1,paste:1,redo:1,removeFormat:1,selectAll:1,strikeThrough:1,subscript:1,superscript:1,underline:1,undo:1,unlink:1,styleWithCSS:1};
DOMDocument.prototype.execCommand=function(a,c,b){if(!__execCMDs[a])return false;return document.execCommand(a,c,b)};function __CSSStyleSheet(a){this.cssRules=[];this.disabled=false;this.href="";this.media="screen";this.parentStyleSheet=this.ownerRule=this.ownerNode=null;this.title="";this.type="text/css";this.___vm=a}
__CSSStyleSheet.prototype.insertRule=function(a,c){if(typeof c!="number"||c==-1)c=this.cssRules.length;this.cssRules[c]=new __CSSStyleRule(a);a=a.toString();a.replace(/\/\*.+\*\//g,"");if(a.match(/(})/g).length!=1)throw"wrong rule!";var b=a.split("{")[0],f="{"+a.split("{")[1];b=b.split(",");for(var d=[],g=0;g<b.length;g++)d.push("#"+this.___vm.uriId+" "+b[g]);b=d.join(",");a=b+" "+f;if(document.styleSheets[0].cssRules){d=document.styleSheets[0].cssRules.length;document.styleSheets[0].insertRule(a,
d);f=document.styleSheets[0].cssRules[d];this.___vm.cssRules.push(f)}else{d=document.styleSheets[0].rules.length;f=f.replace("{","").replace("}","");if(b.indexOf(",")>-1){b=b.split(",");for(g=0;g<b.length;g++){document.styleSheets[0].addRule(b[g],f,d+g);this.___vm.cssRules.push(document.styleSheets[0].rules[d+g])}}else document.styleSheets[0].addRule(b,f,d);f=document.styleSheets[0].rules[d]}this.cssRules[c].___idx=d;this.cssRules[c].style=f};
__CSSStyleSheet.prototype.deleteRule=function(a){var c=document.styleSheets[0].cssRules||document.styleSheets[0].rules,b;for(b=0;b<c.length;b++)if(c[b]===this.cssRules[a].style)break;document.styleSheets[0].cssRules?document.styleSheets[0].deleteRule(b):document.styleSheets[0].removeRule(b);delete this.cssRules[a]};function __CSSStyleRule(a){this.cssText=a;this.parentStyleSheet=this.parentRule=null;this.type=1;this.selectorText=a.split("{")[0]}TCPSocket=Orbited.TCPSocket;
var getStompLogger=(STOMP_DEBUG=false)?function(a){return{debug:function(){var c=Array.prototype.slice.call(arguments);c.unshift(a,": ");console.debug.apply(console,c)},dir:function(){console.debug(a,":");console.dir.apply(console,arguments)}}}:function(){return{debug:function(){},dir:function(){}}};
LineProtocol=function(a){var c=getStompLogger("LineProtocol"),b=this,f=null,d=true;a.onopen=function(){f="";d=true;b.onopen()};a.onclose=function(g){f=null;b.onclose(g)};a.onerror=function(g){b.onerror(g)};a.onread=function(g){c.debug("transport.onread: enter isLineMode=",d," buffer[",f.length,"]=",f," data[",g.length,"]=",g);if(d){f+=g;g="";for(var k=0,h;(h=f.indexOf("\n",k))>=0&&d;){k=f.slice(k,h);k=Orbited.utf8.decode(k)[0];c.debug("fire onlinereceived line[",k.length,"]=",k);b.onlinereceived(k);
k=h+1}f=f.slice(k);if(!d){g=f;f=""}}if(g.length>0){c.debug("fire onrawdatareceived data[",g.length,"]=",g);b.onrawdatareceived(g)}c.debug("transport.onread: leave")};b.setRawMode=function(){c.debug("setRawMode");d=false};b.setLineMode=function(g){c.debug("setLineMode: extra=",g);d=true;g&&g.length>0&&a.onread(g)};b.send=function(g){c.debug("send: data=",g);return a.send(g)};b.open=function(g,k,h){c.debug("open: host=",g,":",k," isBinary=",h);a.open(g,k,h)};b.close=function(){c.debug("close");a.close()};
b.reset=function(){a.reset()};b.onopen=function(){};b.onclose=function(){};b.onerror=function(){};b.onlinereceived=function(){};b.onrawdatareceived=function(){}};
STOMPClient=function(){function a(n){return n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function c(n,r){for(var w in r)n[w]=r[w];return n}function b(n){k.debug("protocol_onLineReceived: line=",n);if(n.length==0){if(q!==null){k.debug("onLineReceived: all headers:");k.dir(s);o="content-length"in s?parseInt(s["content-length"])+1:null;l.setRawMode()}}else if(q===null){k.debug("onLineReceived: begin ",n," frame");q=n;s={};m="";o=null}else{var r=n.search(":"),w=a(n.slice(0,r));n=a(n.slice(r+1));s[w]=n;
k.debug("onLineReceived: found header ",w,"=",n)}}function f(n){k.debug("protocol_onRawDataReceived");p("buffer",m);p("data",n);if(o===null){m+=n;n=m.indexOf("\u0000");if(n>=0){var r=m.slice(0,n);m=m.slice(n+1);d(r,m)}}else{var w=Math.min(n.length,o);o-=w;r=o===0?n.slice(0,w-1):n.slice(0,w);n=n.slice(w);m+=r;o===0&&d(m,n)}}function d(n,r){k.debug("doDispatch: bytes[",n.length,"]=",n," extra[",r.length,"]=",r);p("bytes",n);p("extra",r);var w={type:q,headers:s,body:Orbited.utf8.decode(n)[0]};k.debug("doDispatch: end frame; body.length=",
w.body.length);k.dir(w);h.onframe(w);m="";q=null;s={};o=null;l.setLineMode(r)}function g(){}var k=getStompLogger("STOMPClient"),h=this,l=null,m="",q=null,s=null,o=null;h.user=null;var p=STOMP_DEBUG?function(n,r){for(var w=[],u=0;u<r.length;++u)w.push(r.charCodeAt(u));k.debug(n);k.debug("length=",w.length," bytes=",w)}:function(){};h.onopen=g;h.onclose=g;h.onerror=g;h.onframe=function(n){switch(n.type){case "CONNECTED":h.onconnectedframe(n);break;case "MESSAGE":h.onmessageframe(n);break;case "RECEIPT":h.onreceiptframe(n);
break;case "ERROR":h.onerrorframe(n);break;default:h.onerror("Unknown STOMP frame type "+n.type)}};h.onconnectedframe=g;h.onreceiptframe=g;h.onmessageframe=function(n){this.onmessage&&this.onmessage(n)};h.onerrorframe=g;h.onmessage=g;h.sendFrame=function(n,r,w){n=[n];var u={};if(w&&r["content-length"]===undefined){if(r["content-type"]===undefined){n.push("content-type:text/plain");u["content-type"]=true}if(r["content-encoding"]===undefined){n.push("content-encoding:utf-8");u["content-encoding"]=true;
w=Orbited.utf8.encode(w)}n.push("content-length:"+w.length);u["content-length"]=true}for(var y in r)y in u||n.push(y+":"+r[y]);n.push("\n");r=Orbited.utf8.encode(n.join("\n"));if(w)r+=w;r+="\u0000";l.send(r)};h.send_frame=h.sendFrame;h.connect=function(n,r,w,u){h.user=w;l=h._createProtocol();l.onopen=function(){h.sendFrame("CONNECT",{login:w,passcode:u});h.onopen()};l.onclose=h.onclose;l.onerror=h.onerror;l.onlinereceived=b;l.onrawdatareceived=f;l.open(n,r,true)};h._createProtocol=function(){return new LineProtocol(new TCPSocket)};
h.disconnect=function(){h.sendFrame("DISCONNECT")};h.reset=function(){l.reset()};h.send=function(n,r,w){h.sendFrame("SEND",c({destination:r},w),n)};h.subscribe=function(n,r){h.sendFrame("SUBSCRIBE",c({destination:n},r))};h.unsubscribe=function(n,r){h.sendFrame("UNSUBSCRIBE",c({destination:n},r))};h.begin=function(n){h.sendFrame("BEGIN",{transaction:n})};h.commit=function(n){h.sendFrame("COMMIT",{transaction:n})};h.abort=function(n){h.sendFrame("ABORT",{transaction:n})};h.ack=function(){}};DEBUG=0;
E_SERVER="localhost";E_PORT=61613;HUB_PATH="/hub";ANNOUNCE_PATH="/announce";RQ_RESEND_INTERVAL=4E3;ACK_TIMEOUT=7E4;MAX_WINDOW_SIZE=6E4;KEY_LENGTH=80;PING_INTERVAL=9E4;MAXFAIL_TO_RESET=1;MAXRESEND_TO_RESET=5;STOMP_ERRORS_TO_RESET=3;STOMP_RESET_LOCK_INTERVAL=4E3;MAX_RQ_TIME=6E5;KCONFIG={host:"http://"+location.host,autorestore:false,autoswapout:false};KCONFIG_DEFAULTS={terminal_id:"~",MEMOBJECTS:1E3,saveinterval:1E4};
_isFF=navigator.product==="Gecko"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1;_isIE=navigator.userAgent.indexOf("MSIE")!=-1;_isIE8=navigator.userAgent.indexOf("MSIE 8")!=-1;if(window.opera&&opera.postError)console={log:opera.postError};function fake(){}
function jeneric_init(a){_terminal_vm=new Jnaric;_terminal_vm.name="~";_terminal_vm.TypeURI="";_terminal_vm.SecurityURI="~/security/terminal";_terminal_vm.parent={serID:0,uri:"/"};_terminal_vm.uri="~";_terminal_vm.serID=-1;_terminal_vm.childList={};_terminal_vm.global.initIPCLock=new _terminal_vm.global.Lock;_terminal_vm.global.initIPCLock.goflag=0;_terminal_vm.global.wakeupIPCLock=new _terminal_vm.global.Lock;var c=new DOMImplementation;ddocument=c.loadXML("<div/>");_dmb=ddocument.documentElement;
_dmb.___link.style.width="100%";a.appendChild(_dmb.___link);_terminal_vm.bind_dom(_dmb);_terminal_vm.bind_om();_terminal_vm.bind_terminal();window.BUNDLED_FILES&&window.BUNDLED_FILES["os/st.jn"]?_terminal_vm.evaluate(window.BUNDLED_FILES["os/st.jn"]):_terminal_vm.load("os/st.jn");__eos_objects.terminal=_terminal_vm;__eos_objects["~"]=_terminal_vm;INITOBS=_cn=0;ffoo=function(){_cn++;if(_cn==INITOBS){window.BUNDLED_FILES&&window.BUNDLED_FILES["os/terminal.jn"]?_terminal_vm.evaluate(window.BUNDLED_FILES["os/terminal.jn"]):
_terminal_vm.load("os/terminal.jn");hubConnection.connect()}};for(var b=[{name:"sys",parentURI:"~",security:"os/readonly.jn"},{name:"anarchic",parentURI:"~/sys",contenturl:"os/anarchic.jn",security:"os/readonly.jn"},{name:"security",parentURI:"~",typeurl:"os/ramstore.jn",security:"os/st.jn"},{name:"terminal",parentURI:"~/security",contenturl:"os/st.jn",security:"os/readonly.jn"},{name:"ACL",parentURI:"~/security",typeurl:"os/st_acl.jn",typeuri:"~/security/acltype",security:"os/st.jn"},{name:"acltype",
parentURI:"~/security",contenturl:"os/st_acl.jn",security:"os/readonly.jn"},{name:"ramstore",parentURI:"~/sys",contenturl:"os/ramstore.jn",security:"os/readonly.jn"},{name:"tmpstore",parentURI:"~/sys",contenturl:"os/tmpstore.jn",security:"os/readonly.jn"},{name:"ic",parentURI:"~/sys",contenturl:"os/ic.jn",security:"os/readonly.jn"},{name:"init",parentURI:"~/sys",contenturl:"os/totinit.jn",security:"os/readonly.jn"}],f=0;f<b.length;f++){nvm=manualRamstoreObject(b[f].name,__eos_objects[b[f].parentURI],
b[f].typeurl,b[f].security);if(b[f].typeuri)nvm.TypeURI=b[f].typeuri;(function(){var h=nvm;if(b[f].contenturl){var l=b[f].contenturl;h.onfinish=window.BUNDLED_FILES&&BUNDLED_FILES[l]?function(){h.onfinish=ffoo;h.global.sdata=BUNDLED_FILES[l];h.evaluate("wakeupIPCLock.release();")}:function(){h.onfinish=ffoo;h.evaluate("sdata = fetchUrl2('"+l+"');wakeupIPCLock.release();")}}else h.onfinish=function(){h.onfinish=ffoo;h.evaluate("wakeupIPCLock.release();")}})();INITOBS++}__eos_objects["~"].security.state=
{ipcIn:{hubConnectionChanged:[""]}};if(_stor=getFixedStorage()){if(c=_stor.getByURI("~/security")){a=JSON.parse(c.ChildList);for(var d in a)delete __eos_objects["~/security/"+d];__eos_objects["~/security"].ErrorConsole.log("restoring ~/security childList...");for(var g in a)__eos_objects["~/security"].childList[g]=a[g];__eos_objects["~/security"].serID=parseInt(c.rowid)}else __eos_serial_weak.push(__eos_objects["~/security"]);if(c=_stor.getByURI("~")){_terminal_vm.ErrorConsole.log("restoring ~ childList...");
d=JSON.parse(c.ChildList);for(g in d)_terminal_vm.childList[g]=d[g];_terminal_vm.serID=parseInt(c.rowid);if(c.SecurityProp&&c.SecurityProp.length>0)_terminal_vm.onfinish=function(){try{__eos_objects["~"].execf_thread(__eos_objects["~"].security.setSecurityState,[JSON.parse(c.SecurityProp)],fake,fake,undefined,__eos_objects["~"].security)}catch(h){window.console&&console.log("ERROR restoring security state of terminal object: "+h);_EEE=h}}}else __eos_serial_weak.push(_terminal_vm);_stor.close()}delete c;
delete _stor;(function(){var h=location.href.toString().split("#")[1];if(h)for(var l=h.split(","),m=0;m<l.length;m++)if(l[m].search("=")>-1){h=l[m].split("=");KCONFIG[h[0]]||(KCONFIG[h[0]]=h[1])}for(dob in KCONFIG_DEFAULTS)KCONFIG[dob]||(KCONFIG[dob]=KCONFIG_DEFAULTS[dob])})();if(window.JENERIC_HOST){Orbited.settings.hostname=JENERIC_HOST;KCONFIG.host="http://"+JENERIC_HOST}else{g=document.getElementsByTagName("SCRIPT");for(d=0;d<g.length;d++)if(g[d].src.toString().indexOf("jeneric.js")!=-1){g=g[d].src.toString().match(/http:\/\/(.+)\/os\/jeneric.js/);
var k;if(g&&(k=g[1])){Orbited.settings.hostname=k;KCONFIG.host="http://"+k}break}}setInterval(function(){if((new Date).getTime()-hubConnection.last_sent_time>PING_INTERVAL)try{hubConnection.send({id:__jn_stacks.newId(),terminal_id:KCONFIG.terminal_id,uri:"/",method:"ping",args:[]})}catch(h){}},PING_INTERVAL/2);hubConnection.init();hubConnection.receive=eos_rcvEvent}
function manualRamstoreObject(a,c,b,f){var d=new Jnaric;d.name=a;d.TypeURI="~/sys/ramstore";d.SecurityURI="~/security/terminal";d.parent=c;d.uri=d.parent.uri+"/"+a;d.serID=-1;d.childList={};d.global.initIPCLock=new d.global.Lock;d.global.initIPCLock.goflag=0;d.global.wakeupIPCLock=new d.global.Lock;d.global.wakeupIPCLock.goflag=0;d.bind_dom();d.bind_om();d.global.fetchUrl2=d.global.fetchUrl;if(f)window.BUNDLED_FILES&&window.BUNDLED_FILES[f]?d.evaluate(window.BUNDLED_FILES[f]):d.load(f);else window.BUNDLED_FILES&&
window.BUNDLED_FILES["os/readonly.jn"]?d.evaluate(window.BUNDLED_FILES["os/readonly.jn"]):d.load("os/readonly.jn");if(b)window.BUNDLED_FILES&&window.BUNDLED_FILES[b]?d.evaluate(window.BUNDLED_FILES[b]):d.load(b);else window.BUNDLED_FILES&&window.BUNDLED_FILES["os/tmpstore.jn"]?d.evaluate(window.BUNDLED_FILES["os/tmpstore.jn"]):d.load("os/tmpstore.jn");c.childList[a]=d;return __eos_objects[d.uri]=d}
function randomString(a){for(var c="",b=0;b<a;b++){var f=Math.floor(Math.random()*61);c+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".substring(f,f+1)}return c}function createCookie(a,c,b){if(b){var f=new Date;f.setTime(f.getTime()+b*24*60*60*1E3);b="; expires="+f.toGMTString()}else b="";document.cookie=a+"="+c+b+"; path=/"}
function readCookie(a){a=a+"=";for(var c=document.cookie.split(";"),b=0;b<c.length;b++){for(var f=c[b];f.charAt(0)==" ";)f=f.substring(1,f.length);if(f.indexOf(a)==0)return f.substring(a.length,f.length)}return null}
hubConnection={receive:null,fresh:true,___SESSIONKEY:readCookie("session")?readCookie("session"):randomString(KEY_LENGTH),stomp:new STOMPClient,rqe:{},acks:{},last_sent_time:0,last_ack:(new Date).getTime(),fail_count:0,resend_count:0,stomperror_count:0,send_lock:true,announce:function(){var a={session:this.___SESSIONKEY};if(KCONFIG.terminal_id&&KCONFIG.terminal_key){a.terminal_id=KCONFIG.terminal_id;a.terminal_key=KCONFIG.terminal_key}window.console&&console.log("announcing... "+a.terminal_id);this.stomp.send(JSON.stringify(a),
ANNOUNCE_PATH)},init:function(){this.stomp.onopen=function(){};this.stomp.onclose=function(c){setTimeout(function(){hubConnection.connect()},2E3);window.console&&console.log("Lost Connection, Code: "+c)};this.stomp.onerror=function(c){window.console&&console.log("Error: "+c)};this.stomp.onerrorframe=function(c){window.console&&console.log("Errorframe: "+c.body)};this.stomp.onconnectedframe=function(){if(hubConnection.fresh){hubConnection.fresh=false;hubConnection.announce()}hubConnection.stomp.subscribe(hubConnection.___SESSIONKEY);
clearInterval(hubConnection.si);hubConnection.si=setInterval(function(){hubConnection.send_real()},RQ_RESEND_INTERVAL);hubConnection.stomperror_count=0;if(hubConnection.send_lock){hubConnection.send_lock=false;hubConnection.send_real()}createCookie("session",hubConnection.___SESSIONKEY)};var a=this;this.stomp.onmessageframe=function(c){var b={n:0},f={},d=function(h,l){return blob_parse(h,l,b,f)};DEBUG&&console.log("Input!: "+c.body);try{var g=JSON.parse(c.body,d)}catch(k){window.console&&console.log("Invalid JSON data received: "+
c.body+"; producing error: "+k+":"+k.message+"  "+k.lineNumber);return}f.rq=g;if(g.ack)a.ack_rcv(g.ack);else if(g.error&&g.error=="NOSESSION"){window.console&&console.log("no session, doing announce");hubConnection.announce();hubConnection.send_real(true)}else if(a.ack_snd(g.id))if(b.n==0){a.receive(g);DEBUG&&window.console&&console.log(c.body)}else if(window.console){console.log("Delayed blob receipt:");console.log(c.body)}}},lock_release:function(){if(hubConnection.send_lock){hubConnection.send_lock=
false;hubConnection.send_real()}},safe_reset:function(){this.stomp.reset();this.send_lock=true;clearTimeout(this.locktm);this.locktm=setTimeout(hubConnection.lock_release,STOMP_RESET_LOCK_INTERVAL)},connect:function(){window.console&&console.log("starting HUB connection...");this.stomp.connect(E_SERVER,E_PORT,"eos","eos")},send:function(a){a.terminal_id=KCONFIG.terminal_id;this.rqe[a.id]={r:a,t:(new Date).getTime()};this.send_lock||this.send_real()},send_real:function(a){var c=(new Date).getTime();
if(c-this.last_ack>PING_INTERVAL*1.5){DEBUG&&window.console&&console.log("Resetting STOMP due to last_ack hit");this.last_ack=c;this.safe_reset()}for(var b in this.rqe)if(c-this.rqe[b].t>ACK_TIMEOUT){if(!("response"in this.rqe[b].r)){this.rqe[b].r.status="ECONN";this.rqe[b].r.result="Too much resend to HUB fails. Giving up.";this.receive(this.rqe[b].r)}this.fail_count+=1;if(this.fail_count>=MAXFAIL_TO_RESET){DEBUG&&window.console&&console.log("Resetting STOMP due to fail_count hit");this.safe_reset();
this.fail_count=0}delete this.rqe[b]}else if(this.rqe[b].r.timeout<100)delete this.rqe[b];else if(!(!a&&this.rqe[b].last_resend&&c-this.rqe[b].last_resend<RQ_RESEND_INTERVAL)){if(this.rqe[b].r.timeout)this.rqe[b].r.timeout="last_resend"in this.rqe[b]?this.rqe[b].r.timeout-(c-this.rqe[b].t-(this.rqe[b].last_resend-this.rqe[b].t)):this.rqe[b].r.timeout-(c-this.rqe[b].t);this.rqe[b].last_resend=c;if(this.rqe[b].resend_count)this.rqe[b].resend_count+=1;else this.rqe[b].resend_count=1;if(this.rqe[b].resend_count>=
MAXRESEND_TO_RESET){DEBUG&&window.console&&console.log("Resetting STOMP due to resend_count hit");for(var f in this.rqe)this.rqe[f].resend_count=0;this.rqe[b].resend_count=0;this.safe_reset()}this.rqe[b].r.session=this.___SESSIONKEY;var d=this.rqe[b].r,g=function(m,q){return blob_replacer(m,q,d)};try{var k=JSON.stringify(this.rqe[b].r,g);DEBUG&&window.console&&console.log("Sending "+k)}catch(h){this.rqe[b].r.status="EEXCP";this.rqe[b].r.result="Could not parse JSON to send: "+h;this.receive(this.rqe[b].r);
delete this.rqe[b];window.console&&console.log("Error! Could not parse JSON to send: "+h)}try{this.stomp.send(k,HUB_PATH);this.last_sent_time=(new Date).getTime()}catch(l){window.console&&console.log("STOMP SEND Error occured: "+l);if(this.stomperror_count>=STOMP_ERRORS_TO_RESET){window.console&&console.log("Resetting connection due to STOMP_ERRORS_TO_RESET hit");hubConnection.safe_reset();this.stomperror_count=0}else this.stomperror_count++}}for(b in this.acks)c-this.acks[b]>MAX_WINDOW_SIZE&&delete this.acks[b]},
ack_rcv:function(a){this.resend_count=this.fail_count=0;this.last_ack=(new Date).getTime();DEBUG&&window.console&&console.log("ack!");delete this.rqe[a]},ack_snd:function(a){var c=true;if(a in this.acks)c=false;this.acks[a]=(new Date).getTime();DEBUG&&window.console&&console.log("sending ack");this.stomp.send(JSON.stringify({ack:a}),HUB_PATH,{ack:a});return c},abort:function(a){delete this.rqe[a]}};
function blob_replacer(a,c,b){if(c&&c.getBytes&&c.toString()=="[object GearsBlob]"){a="Blob("+a+"."+randomString(10)+")";c.hasOwnProperty("wrappedString")?sendWrappedBlob(a,c,b):sendBlob(a,c,b);return a}return c}
function sendBlob(a,c,b){var f=google.gears.factory.create("beta.httprequest");f.open("POST",KCONFIG.host+"/blobsend?blobid="+a+"&blob_session="+hubConnection.___SESSIONKEY);f.onreadystatechange=function(){if(f.readyState==4)if(f.status!=200){b.status="ECONN";b.result="blob send failed with status "+f.status;hubConnection.receive(b);window.console&&console.log("blob send failure for request "+b.id+" status "+f.status+" msg "+f.responseText)}};f.send(c.___blob)}
function sendWrappedBlob(a,c,b){var f=new DataRequestor;console.log("wrappedBlob working");f.onfail=function(d){b.status="ECONN";b.result="blob send failed with status "+d;hubConnection.receive(b);window.console&&console.log("wrappedBlob send failure for request "+b.id+" with status "+d)};f.addArg(_POST,"data",c.wrappedString);f.addArg(_POST,"blob_session",hubConnection.___SESSIONKEY);f.addArg(_POST,"blobid",a);f.getURL(KCONFIG.host+"/base64send")}
function getBlob(a,c,b,f){var d=google.gears.factory.create("beta.httprequest");d.open("GET",KCONFIG.host+"/blobget?blobid="+a+"&blob_session="+hubConnection.___SESSIONKEY);d.onreadystatechange=function(){if(d.readyState==4)if(d.status==200){b.___blob=d.responseBlob;c.n-=1;c.n==0&&hubConnection.receive(f.rq)}else{f.rq.status="ECONN";f.rq.result="blob GET failed with status "+d.status;delete f.rq.args;hubConnection.send(f.rq);window.console&&console.log("blob receive failure for request "+f.rq.id)}};
d.send()}function getWrappedBlob(a,c,b,f){var d=new DataRequestor;d.onload=function(g){b.wrappedString=g;c.n-=1;c.n==0&&hubConnection.receive(f.rq)};d.onfail=function(g){f.rq.status="ECONN";f.rq.result="blob send failed with status "+g;delete f.rq.args;hubConnection.send(f.rq);window.console&&console.log("wrappedBlob get failure for request "+f.rq.id+" with status "+g)};d.addArg(_GET,"blob_session",hubConnection.___SESSIONKEY);d.addArg(_GET,"blobid",a);d.getURL(KCONFIG.host+"/base64get")}
function blob_parse(a,c,b,f){if(typeof c=="string"&&c.slice(0,5)=="Blob("&&c.slice(-1)==")"){c.slice(5,-1).split(".");b.n+=1;a=new BlobObject;window.google&&google.gears?getBlob(c,b,a,f):getWrappedBlob(c,b,a,f);return a}return c};

// fixed.js: fix fixed positioning and fixed backgrounds in IE/Win
// version 1.8, 08-Aug-2003
// written by Andrew Clover <and@doxdesk.com>, use freely

/*@cc_on
@if (@_win32 && @_jscript_version>4)

var fixed_positions= new Array();
var fixed_backgrounds= new Array();
var fixed_viewport;

// Initialisation. Called when the <body> tag arrives. Set up viewport so the
// rest of the script knows we're going, and add a measurer div, used to detect
// font size changes and measure image sizes for backgrounds later   

function fixed_init() {
  fixed_viewport= (document.compatMode=='CSS1Compat') ?
    document.documentElement : document.body;
  var el= document.createElement('div');
  el.setAttribute('id', 'fixed-measure');
  el.style.position= 'absolute';
  el.style.top= '0'; el.style.left= '0';
  el.style.overflow= 'hidden'; el.style.visibility= 'hidden';
  el.style.fontSize= 'xx-large'; el.style.height= '5em';
  el.style.setExpression('width', 'fixed_measureFont()');
  document.body.insertBefore(el, document.body.firstChild);
}

// Binding. Called every time an element is added to the document, check it
// for fixed features, if found add to our lists and set initial props   

function fixed_bind(el) {
  var needLayout= false;
  var tag= el.tagName.toLowerCase();
  var st= el.style;
  var cst= el.currentStyle;
  var anc;

  // find fixed-position elements
  if (cst.position=='fixed' || st.position=='fixed') {
    needLayout= true;
    fixed_positions[fixed_positions.length]= el;
    // store original positioning as we'll overwrite it
    st.position= 'absolute';
    st.fixedPLeft=   cst.left;
    st.fixedPTop=    cst.top;
    st.fixedPRight=  cst.right;
    st.fixedPBottom= cst.bottom;
    st.fixedPWidth=  fixed_parseLength(cst.width);
    st.fixedPHeight= fixed_parseLength(cst.height);
    // find element that will act as containing box, for convenience later
    st.fixedCB= null;
    for (anc= el; (anc= anc.parentElement).parentElement;) {
      if (anc.currentStyle.position!='static') {
        st.fixedCB= anc;
        break;
    } }
    // detect nested fixed positioning (only ancestor need move)
    st.fixedNest= false;
    for (anc= el; anc= anc.parentElement;) {
      if (anc.style.fixedNest!=null)
        st.fixedNest= true;
        break;
    }
  }

  // find fixed-background elements (not body/html which IE already gets right)
  if (cst.backgroundAttachment=='fixed' && tag!='body' && tag!='html') {
    needLayout= true;
    fixed_backgrounds[fixed_backgrounds.length]= el;
    // get background offset, converting from keyword if necessary
    st.fixedBLeft= fixed_parseLength(cst.backgroundPositionX);
    st.fixedBTop=  fixed_parseLength(cst.backgroundPositionY);
    // if it's a non-zero %age, need to know size of image for layout
    if (st.fixedBLeft[1]=='%' || st.fixedBTop[1]=='%') {
      st.fixedBWidth= 0; st.fixedBHeight= 0;
      fixed_measureBack(el);
    }
  }
  if (needLayout) fixed_layout();
}

// Layout. On every window or font size change, recalculate positioning   

// Request re-layout at next free moment
var fixed_delaying= false;
function fixed_delayout() {
  if (fixed_delaying) return;
  fixed_delaying= true;
  window.setTimeout(fixed_layout, 0);
}

var fixed_ARBITRARY= 200;

function fixed_layout() {
  fixed_delaying= false;
  if (!fixed_viewport) return;
  var i, el, st, j, pr, tmp, A= 'auto';
  var cb, cbLeft, cbTop, cbRight, cbBottom, oLeft, oTop, oRight, oBottom;
  var vpWidth=fixed_viewport.clientWidth, vpHeight=fixed_viewport.clientHeight;

  // calculate initial position for fixed-position elements [black magic]
  for (i= fixed_positions.length; i-->0;) {
    el= fixed_positions[i]; st= el.style;
    // find positioning of containing block
    cb= st.fixedCB; if (!cb) cb= fixed_viewport;
    cbLeft= fixed_pageLeft(cb); cbTop= fixed_pageTop(cb);
    if (cb!=fixed_viewport) { cbLeft+= cb.clientLeft; cbTop+= cb.clientTop; }
    cbRight= fixed_viewport.clientWidth-cbLeft-cb.clientWidth;
    cbBottom= fixed_viewport.clientHeight-cbTop-cb.clientHeight;
    // if size is in %, must recalculate relative to viewport
    if (st.fixedPWidth[1]=='%')
      st.width= Math.round(vpWidth*st.fixedPWidth[0]/100)+'px';
    if (st.fixedPHeight[1]=='%')
      st.height= Math.round(vpHeight*st.fixedPHeight[0]/100)+'px';
    // find out offset values at max size, to account for margins
    st.left= A; st.right= '0'; st.top= A; st.bottom= '0';
    oRight= el.offsetLeft+el.offsetWidth; oBottom= el.offsetTop+el.offsetHeight;
    st.left= '0'; st.right= A; st.top= '0'; st.bottom= A;
    oLeft= el.offsetLeft; oTop= el.offsetTop;
    // use this to convert all edges to pixels
    st.left= A; st.right= st.fixedPRight;
    st.top= A; st.bottom= st.fixedPBottom;
    oRight-= el.offsetLeft+el.offsetWidth;
    oBottom-= el.offsetTop+el.offsetHeight;
    st.left= st.fixedPLeft; st.top= st.fixedPTop;
    oLeft= el.offsetLeft-oLeft; oTop= el.offsetTop-oTop;
    // edge positioning fix
    if (st.fixedPWidth[1]==A && st.fixedPLeft!=A && st.fixedPRight!=A) {
      tmp= el.offsetLeft; st.left= A; st.width= fixed_ARBITRARY+'px';
      tmp= fixed_ARBITRARY+el.offsetLeft-tmp+cbLeft+cbRight;
      st.left= st.fixedPLeft; st.width= ((tmp<1)?1:tmp)+'px';
    }
    if (st.fixedPHeight[1]==A && st.fixedPTop!=A && st.fixedPBottom!=A) {
      tmp= el.offsetTop; st.top= A; st.height= fixed_ARBITRARY+'px';
      tmp= fixed_ARBITRARY+el.offsetTop-tmp+cbTop+cbBottom;
      st.top= st.fixedPTop; st.height= ((tmp<1)?1:tmp)+'px';
    }
    // move all non-auto edges relative to the viewport
    st.fixedCLeft= (st.fixedPLeft=='auto') ? oLeft : oLeft-cbLeft;
    st.fixedCTop= (st.fixedPTop=='auto') ? oTop : oTop-cbTop;
    st.fixedCRight= (st.fixedPRight=='auto') ? oRight : oRight-cbRight;
    st.fixedCBottom= (st.fixedPBottom=='auto') ? oBottom : oBottom-cbBottom;
    // remove left-positioning of right-positioned elements
    if (st.fixedPLeft=='auto' && st.fixedPRight!='auto') st.fixedCLeft= 'auto';
    if (st.fixedPTop=='auto' && st.fixedPBottom!='auto') st.fixedCTop= 'auto';
  }


  // calculate initial positioning of fixed backgrounds
  for (i= fixed_backgrounds.length; i-->0;) {
    el= fixed_backgrounds[i]; st= el.style;
    tmp= st.fixedBImage;
    if (tmp) {
      if (tmp.readyState!='uninitialized') {
        st.fixedBWidth= tmp.offsetWidth;
        st.fixedBHeight= tmp.offsetHeight;
        st.fixedBImage= window.undefined;
      }
    }
    st.fixedBX= fixed_length(el, st.fixedBLeft, vpWidth-st.fixedBWidth);
    st.fixedBY= fixed_length(el, st.fixedBTop, vpHeight-st.fixedBHeight);
  }

  // now call scroll() to set the positions from the values just calculated
  fixed_scroll();
}

// Scrolling. Offset fixed elements relative to viewport scrollness

var fixed_lastX, fixed_lastY;
var fixed_PATCHDELAY= 300;
var fixed_patching= false;

// callback function after a scroll, because incorrect scroll position is
// often reported first go!
function fixed_patch() {
  fixed_patching= false;
  var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop;
  if (scrollX!=fixed_lastX && scrollY!=fixed_lastY) fixed_scroll();
}

function fixed_scroll() {
  if (!fixed_viewport) return;
  var i, el, st, viewportX, viewportY;
  var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop;
  fixed_lastX= scrollX; fixed_lastY= scrollY;

  // move non-nested fixed-position elements
  for (i= fixed_positions.length; i-->0;) {
    st= fixed_positions[i].style;
    viewportX= (st.fixedNest) ? 0 : scrollX;
    viewportY= (st.fixedNest) ? 0 : scrollY;
    if (st.fixedCLeft!='auto') st.left= (st.fixedCLeft+viewportX)+'px';
    if (st.fixedCTop!='auto') st.top= (st.fixedCTop+viewportY)+'px';
    // IE8 warning: this just seems to be unnesessary?!?! at least for elements relative to page body
    //viewportX= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportX;
    //viewportY= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportY;
    st.right= (st.fixedCRight-viewportX+1)+'px'; st.right= (st.fixedCRight-viewportX)+'px';
    st.bottom= (st.fixedCBottom-viewportY+1)+'px'; st.bottom= (st.fixedCBottom-viewportY)+'px';
  }

  // align fixed backgrounds to viewport
  for (i= fixed_backgrounds.length; i-->0;) {
    el= fixed_backgrounds[i]; st= el.style;
    viewportX= scrollX;
    viewportY= scrollY;
    while (el.offsetParent) {
      viewportX-= el.offsetLeft+el.clientLeft;
      viewportY-= el.offsetTop +el.clientTop;
      el= el.offsetParent;
    }
    st.backgroundPositionX= (st.fixedBX+viewportX)+'px';
    st.backgroundPositionY= (st.fixedBY+viewportY)+'px';
  }

  // call back again in a tic
  if (!fixed_patching) {
    fixed_patching= true;
    window.setTimeout(fixed_patch, fixed_PATCHDELAY);
  }
}

// Measurement. Load bg-image into an invisible element on the page, when
// loaded write the width/height to an element's style for layout use; detect
// when font size changes

function fixed_measureBack(el) {
  var measure= document.getElementById('fixed-measure');
  var img= document.createElement('img');
  img.setAttribute('src', fixed_parseURL(el.currentStyle.backgroundImage));
  measure.appendChild(img);
  el.style.fixedBImage= img;
  if (img.readyState=='uninitialized')
    img.attachEvent('onreadystatechange', fixed_measureBackImage_ready);
}

function fixed_measureBackImage_ready() {
  var img= event.srcElement;
  if (img && img.readyState!='uninitialized') {
    img.detachEvent('onreadystatechange', fixed_measureBackImage_ready);
    fixed_layout();
  }
}

var fixed_fontsize= 0;
function fixed_measureFont() {
  var fs= document.getElementById('fixed-measure').offsetHeight;
  if (fixed_fontsize!=fs && fixed_fontsize!=0)
    fixed_delayout();
  fixed_fontsize= fs;
  return '5em';
}

// Utility. General-purpose functions

// parse url() to get value inside

function fixed_parseURL(v) {
  v= v.substring(4, v.length-1);
  if (v.charAt(0)=='"' && v.charAt(v.length-1)=='"' ||
      v.charAt(0)=="'" && v.charAt(v.length-1)=="'")
    return v.substring(1, v.length-1);
  else return v;
}

// parse length or auto or background-position keyword into number and unit

var fixed_numberChars= '+-0123456789.';
var fixed_ZERO= new Array(0, 'px');
var fixed_50PC= new Array(50, '%');
var fixed_100PC= new Array(100, '%');
var fixed_AUTO= new Array(0, 'auto');

function fixed_parseLength(v) {
  var num, i;
  if (v=='left'  || v=='top')    return fixed_ZERO;
  if (v=='right' || v=='bottom') return fixed_100PC;
  if (v=='center') return fixed_50PC;
  if (v=='auto')   return fixed_AUTO;
  i= 0;
  while (i<v.length && fixed_numberChars.indexOf(v.charAt(i))!=-1)
    i++;
  num= parseFloat(v.substring(0, i));
  if (num==0) return fixed_ZERO;
  else return new Array(num, v.substring(i));
}

// convert parsed (number, unit) into a number of pixels

function fixed_length(el, l, full) {
  var tmp, x;
  if (l[1]=='px') return l[0];
  if (l[1]=='%')  return Math.round(full*l[0]/100);
  // other units - measure by setting position; this is rather inefficient
  // but then these units are used for background-position so seldom...
  tmp= el.currentStyle.left;
  el.style.left= '0';
  x= el.offsetLeft;
  el.style.left= l[0]+l[1];
  x= el.offsetLeft-x;
  el.style.left= tmp;
  return x;
}

// convert stupid IE offsetLeft/Top to page-relative values

function fixed_pageLeft(el) {
  var v= 0;
  while (el.offsetParent) {
    v+= el.offsetLeft;
    el= el.offsetParent;
  }
  return v;
}
function fixed_pageTop(el) {
  var v= 0;
  while (el.offsetParent) {
    v+= el.offsetTop;
    el= el.offsetParent;
  }
  return v;
}

// Scanning. Check document every so often until it has finished loading. Do
// nothing until <body> arrives, then call main init. Pass any new elements
// found on each scan to be bound   

var fixed_SCANDELAY= 1000;

function fixed_scan() {
  if (!document.body) return;
  if (!fixed_viewport) {
    try {
      fixed_init();
    } catch (e) {
      // warning! an ugly way to detect IE8 in standards mode!
      return false;
    }
  }
  var el;
  for (var i= 0; i<document.all.length; i++) {
    el= document.all[i];
    if (!el.fixed_bound) {
      el.fixed_bound= true;
      fixed_bind(el);
  } }
  return true;
}

var fixed_scanner;
function fixed_stop() {
  window.clearInterval(fixed_scanner);
  fixed_scan();
}

if(fixed_scan()) {
  fixed_scanner= window.setInterval(fixed_scan, fixed_SCANDELAY);
  //window.attachEvent('onload', fixed_stop);
  window.attachEvent('onresize', fixed_delayout);
  window.attachEvent('onscroll', fixed_scroll);
}

@end @*/


BUNDLED_FILES={"os/readonly.jn": '{"0":{"0":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"setSecurityState"},"length":2,"type":35,"v":"setSecurityState","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"state","length":1,"params":{}},"body":{"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"1":{"1":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"getSecurityState"},"length":2,"type":35,"v":"getSecurityState","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"params":{}},"body":{"0":{"0":{},"type":80,"v":{"type":50,"v":{"v":"{"}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"2":{"2":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"validateRequest"},"length":2,"type":35,"v":"validateRequest","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"rq","length":1,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"method"},"length":2,"type":35,"v":"method"},"1":{"1":{},"type":58,"v":"write"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":80,"v":{"type":71,"v":{"v":"false"}},"tP":{}},"elsePart":null},"1":{"1":{},"type":80,"v":{"type":84,"v":{"v":"true"}}},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"3":{"3":{},"type":2,"v":"delete","e":{"0":{"0":{},"type":56,"v":"security"},"length":1,"type":67,"v":"delete","e":{}}},"length":4,"type":42,"fD":{},"vD":{}}',"os/anarchic.jn": '// anarchic.jn\n\
// LICENSE: GPL v.3 or later (C) 2010 Andrew Gryaznov realgrandrew@gmail.com, a.gryaznov@svoyaset.ru\n\
security.setSecurityState = function (state) {\n\
    wakeupIPCLock.release(); // this should be the only place to release wakeupIPCLock!! TQLW here too (the code is first loaded then security)\n\
};\n\
\n\
security.getSecurityState = function() {\n\
    return {};\n\
};\n\
\n\
security.validateRequest = function (rq) {\n\
    return true; // always allow...\n\
};\n\
\n\
delete security; // nobody will notice ;-)\n\
\n\
\n\
',"os/ramstore.jn": '{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"length":1,"type":29,"v":"!","c":{}},"tP":{"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"1":{},"type":58,"v":""},"length":2,"type":4,"v":"=","e":{}},"tP":{}},"elsePart":null},"1":{"1":{},"type":74,"v":"function","name":"getState","params":{"params":{}},"body":{"0":{"0":{},"type":80,"v":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":{"v":"data"}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"2":{"2":{},"type":74,"v":"function","name":"setState","params":{"0":"data","length":1,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"0":{"0":{},"type":56,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"length":2,"type":4,"v":"=","e":{}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"3":{"3":{},"type":74,"v":"function","name":"read","params":{"0":"rq","1":"offset","2":"len","length":3,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"offset"},"length":1,"type":29,"v":"!","c":{}},"tP":{"type":2,"v":"offset","e":{"0":{"0":{},"type":56,"v":"offset","assignOp":null},"1":{"1":{},"type":57,"v":0},"length":2,"type":4,"v":"=","e":{}},"tP":{}},"elsePart":null},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"len"},"length":1,"type":29,"v":"!","c":{}},"tP":{"type":2,"v":"len","e":{"0":{"0":{},"type":56,"v":"len","assignOp":null},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":2,"type":4,"v":"=","e":{}},"tP":{}},"elsePart":null},"2":{"2":{},"type":80,"v":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"substr"},"length":2,"type":35,"v":"substr"},"1":{"0":{"0":{},"type":56,"v":"offset"},"1":{"1":{},"type":56,"v":"len"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":{"v":"("}}},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"4":{"4":{},"type":74,"v":"function","name":"write","params":{"0":"rq","1":"data","2":"offset","length":3,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"offset"},"length":1,"type":86,"v":"typeof"},"1":{"1":{},"type":58,"v":"undefined"},"length":2,"type":14,"v":"!=","c":{}},"tP":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"offset"},"1":{"0":{"0":{},"type":57,"v":1},"1":{},"length":1,"type":32,"v":"-"},"length":2,"type":13,"v":"==","c":{}},"tP":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"concat"},"length":2,"type":35,"v":"concat"},"1":{"0":{"0":{"0":{},"type":56,"v":"data"},"1":{"1":{},"type":56,"v":"wrappedString"},"length":2,"type":35,"v":"wrappedString"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"length":2,"type":4,"v":"=","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"2":{"2":{},"type":80,"v":{"type":84,"v":{"v":"true"}}},"length":3,"type":43,"v":"{","tP":{}},"elsePart":null},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"0":{"0":{"0":{},"type":58,"v":""},"1":{"1":{},"type":56,"v":"concat"},"length":2,"type":35,"v":"concat"},"1":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"substr"},"length":2,"type":35,"v":"substr"},"1":{"0":{"0":{},"type":57,"v":0},"1":{"1":{},"type":56,"v":"offset"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"("},"1":{"1":{},"type":56,"v":"data"},"2":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"substr"},"length":2,"type":35,"v":"substr"},"1":{"0":{"0":{"0":{},"type":56,"v":"offset"},"1":{"0":{"0":{},"type":56,"v":"data"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":2,"type":24,"v":"+"},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":2,"type":55,"v":","},"2":{},"length":2,"type":46,"v":"("},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"("},"length":2,"type":4,"v":"=","e":{}}},"length":2,"type":43,"v":"{","tP":{}},"elsePart":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":4,"v":"=","e":{}}},"length":1,"type":43,"v":"{","elsePart":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"2":{"2":{},"type":80,"v":{"type":84,"v":{"v":"true"}}},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"5":{"5":{},"type":74,"v":"function","name":"ipc_addAsChild","params":{"0":"rq","1":"name","2":"uri","length":3,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"linkChild"},"length":2,"type":35,"v":"linkChild"},"1":{"0":{"0":{},"type":56,"v":"name"},"1":{"1":{},"type":56,"v":"uri"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"6":{"6":{},"type":74,"v":"function","name":"ipc_createChild","params":{"0":"rq","1":"name","2":"type","3":"sec","length":4,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"createChild"},"length":2,"type":35,"v":"createChild"},"1":{"0":{"0":{},"type":56,"v":"name"},"1":{"1":{},"type":56,"v":"type"},"2":{"2":{},"type":56,"v":"sec"},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"7":{"7":{},"type":74,"v":"function","name":"ipc_deleteChild","params":{"0":"rq","1":"name","length":2,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"deleteChild"},"length":2,"type":35,"v":"deleteChild"},"1":{"0":{"0":{},"type":56,"v":"name"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"8":{"8":{},"type":74,"v":"function","name":"ipc_listChildren","params":{"0":"rq","length":1,"params":{}},"body":{"0":{"0":{},"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"enumerateChildren"},"length":2,"type":35,"v":"enumerateChildren"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":{"v":")"}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"9":{"9":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":58,"v":"read"},"length":2,"type":48,"v":"[","assignOp":null},"1":{"1":{},"type":56,"v":"read"},"length":2,"type":4,"v":"=","e":{}}},"10":{"10":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":58,"v":"write"},"length":2,"type":48,"v":"[","assignOp":null},"1":{"1":{},"type":56,"v":"write"},"length":2,"type":4,"v":"=","e":{}}},"11":{"11":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":58,"v":"addAsChild"},"length":2,"type":48,"v":"[","assignOp":null},"1":{"1":{},"type":56,"v":"ipc_addAsChild"},"length":2,"type":4,"v":"=","e":{}}},"12":{"12":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":58,"v":"createChild"},"length":2,"type":48,"v":"[","assignOp":null},"1":{"1":{},"type":56,"v":"ipc_createChild"},"length":2,"type":4,"v":"=","e":{}}},"13":{"13":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":58,"v":"deleteChild"},"length":2,"type":48,"v":"[","assignOp":null},"1":{"1":{},"type":56,"v":"ipc_deleteChild"},"length":2,"type":4,"v":"=","e":{}}},"14":{"14":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":58,"v":"listChildren"},"length":2,"type":48,"v":"[","assignOp":null},"1":{"1":{},"type":56,"v":"ipc_listChildren"},"length":2,"type":4,"v":"=","e":{}}},"15":{"15":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"wakeupIPCLock"},"1":{"1":{},"type":56,"v":"check"},"length":2,"type":35,"v":"check"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":1,"type":29,"v":"!","c":{}},"tP":{"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}},"tP":{}},"elsePart":null},"16":{"16":{},"type":2,"v":"initIPCLock","e":{"0":{"0":{"0":{},"type":56,"v":"initIPCLock"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"length":17,"type":42,"fD":{"0":{"0":{},"type":74,"v":"function","name":"getState","params":{"params":{}},"body":{"0":{"0":{},"type":80,"v":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":{"v":"data"}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"1":{"1":{},"type":74,"v":"function","name":"setState","params":{"0":"data","length":1,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"0":{"0":{},"type":56,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"length":2,"type":4,"v":"=","e":{}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"2":{"2":{},"type":74,"v":"function","name":"read","params":{"0":"rq","1":"offset","2":"len","length":3,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"offset"},"length":1,"type":29,"v":"!","c":{}},"tP":{"type":2,"v":"offset","e":{"0":{"0":{},"type":56,"v":"offset","assignOp":null},"1":{"1":{},"type":57,"v":0},"length":2,"type":4,"v":"=","e":{}},"tP":{}},"elsePart":null},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"len"},"length":1,"type":29,"v":"!","c":{}},"tP":{"type":2,"v":"len","e":{"0":{"0":{},"type":56,"v":"len","assignOp":null},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":2,"type":4,"v":"=","e":{}},"tP":{}},"elsePart":null},"2":{"2":{},"type":80,"v":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"substr"},"length":2,"type":35,"v":"substr"},"1":{"0":{"0":{},"type":56,"v":"offset"},"1":{"1":{},"type":56,"v":"len"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":{"v":"("}}},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"3":{"3":{},"type":74,"v":"function","name":"write","params":{"0":"rq","1":"data","2":"offset","length":3,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"offset"},"length":1,"type":86,"v":"typeof"},"1":{"1":{},"type":58,"v":"undefined"},"length":2,"type":14,"v":"!=","c":{}},"tP":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"offset"},"1":{"0":{"0":{},"type":57,"v":1},"1":{},"length":1,"type":32,"v":"-"},"length":2,"type":13,"v":"==","c":{}},"tP":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"concat"},"length":2,"type":35,"v":"concat"},"1":{"0":{"0":{"0":{},"type":56,"v":"data"},"1":{"1":{},"type":56,"v":"wrappedString"},"length":2,"type":35,"v":"wrappedString"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"length":2,"type":4,"v":"=","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"2":{"2":{},"type":80,"v":{"type":84,"v":{"v":"true"}}},"length":3,"type":43,"v":"{","tP":{}},"elsePart":null},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"0":{"0":{"0":{},"type":58,"v":""},"1":{"1":{},"type":56,"v":"concat"},"length":2,"type":35,"v":"concat"},"1":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"substr"},"length":2,"type":35,"v":"substr"},"1":{"0":{"0":{},"type":57,"v":0},"1":{"1":{},"type":56,"v":"offset"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"("},"1":{"1":{},"type":56,"v":"data"},"2":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"substr"},"length":2,"type":35,"v":"substr"},"1":{"0":{"0":{"0":{},"type":56,"v":"offset"},"1":{"0":{"0":{},"type":56,"v":"data"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":2,"type":24,"v":"+"},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":2,"type":55,"v":","},"2":{},"length":2,"type":46,"v":"("},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"("},"length":2,"type":4,"v":"=","e":{}}},"length":2,"type":43,"v":"{","tP":{}},"elsePart":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data"},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":35,"v":"data","assignOp":null},"1":{"1":{},"type":56,"v":"data"},"length":2,"type":4,"v":"=","e":{}}},"length":1,"type":43,"v":"{","elsePart":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"2":{"2":{},"type":80,"v":{"type":84,"v":{"v":"true"}}},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"4":{"4":{},"type":74,"v":"function","name":"ipc_addAsChild","params":{"0":"rq","1":"name","2":"uri","length":3,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"linkChild"},"length":2,"type":35,"v":"linkChild"},"1":{"0":{"0":{},"type":56,"v":"name"},"1":{"1":{},"type":56,"v":"uri"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"5":{"5":{},"type":74,"v":"function","name":"ipc_createChild","params":{"0":"rq","1":"name","2":"type","3":"sec","length":4,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"createChild"},"length":2,"type":35,"v":"createChild"},"1":{"0":{"0":{},"type":56,"v":"name"},"1":{"1":{},"type":56,"v":"type"},"2":{"2":{},"type":56,"v":"sec"},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"6":{"6":{},"type":74,"v":"function","name":"ipc_deleteChild","params":{"0":"rq","1":"name","length":2,"params":{}},"body":{"0":{"0":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"deleteChild"},"length":2,"type":35,"v":"deleteChild"},"1":{"0":{"0":{},"type":56,"v":"name"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":2,"v":"object","e":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"7":{"7":{},"type":74,"v":"function","name":"ipc_listChildren","params":{"0":"rq","length":1,"params":{}},"body":{"0":{"0":{},"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"enumerateChildren"},"length":2,"type":35,"v":"enumerateChildren"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":{"v":")"}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":0},"length":8},"vD":{}}',"os/st.jn": '{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"length":1,"type":29,"v":"!"},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{},"length":1,"type":29,"v":"!"},"length":2,"type":8,"v":"||","c":{}},"tP":{"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state","assignOp":null},"1":{"0":{"0":{"0":{},"type":56,"v":"ipcIn"},"1":{"1":{},"type":58,"v":"inherit"},"length":2,"type":51,"v":"inherit"},"1":{},"length":1,"type":50,"v":"{"},"length":2,"type":4,"v":"=","e":{}},"tP":{}},"elsePart":null},"1":{"1":{},"type":2,"v":"_include","e":{"0":{"0":{},"type":56,"v":"_include","assignOp":null},"1":{"1":{},"type":56,"v":"include"},"length":2,"type":4,"v":"=","e":{}}},"2":{"2":{},"type":2,"v":"PATH","e":{"0":{"0":{},"type":56,"v":"PATH","assignOp":null},"1":{"0":{"0":{"0":{},"type":58,"v":"~/lib"},"1":{"1":{},"type":57,"v":1},"length":2,"type":51,"v":1},"1":{"0":{"0":{},"type":58,"v":"/lib"},"1":{"1":{},"type":57,"v":1},"length":2,"type":51,"v":1},"2":{"0":{"0":{},"type":58,"v":"/jeneric.net/lib"},"1":{"1":{},"type":57,"v":1},"2":{},"length":2,"type":51,"v":1},"length":3,"type":50,"v":"{"},"length":2,"type":4,"v":"=","e":{}}},"3":{"3":{},"type":2,"v":"include","e":{"0":{"0":{},"type":56,"v":"include","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"SCRIPT_PATH","length":1,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"SCRIPT_PATH"},"1":{"1":{},"type":56,"v":"match"},"length":2,"type":35,"v":"match"},"1":{"0":{"0":{},"type":58,"v":"^\\\\/|^\\\\.|^~"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":79,"v":"null"},"length":2,"type":14,"v":"!=","c":{}},"tP":{"0":{"0":{},"type":2,"v":"_include","e":{"0":{"0":{},"type":56,"v":"_include"},"1":{"0":{"0":{},"type":56,"v":"SCRIPT_PATH"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}}},"length":1,"type":43,"v":"{","tP":{}},"elsePart":{"0":{"0":{},"type":45,"v":"for","isLoop":true,"iterator":{"type":56,"v":"o","name":"o","readOnly":false,"iterator":{}},"varDecl":{"0":{"0":{},"type":56,"v":"o","name":"o","readOnly":false},"length":1,"type":87,"v":"var","varDecl":{}},"object":{"type":56,"v":"PATH","object":{}},"body":{"0":{"0":{},"type":85,"v":"try","tryBlock":{"0":{"0":{},"type":2,"v":"_include","e":{"0":{"0":{},"type":56,"v":"_include"},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"o"},"1":{"1":{},"type":58,"v":"/"},"length":2,"type":24,"v":"+"},"1":{"1":{},"type":56,"v":"SCRIPT_PATH"},"length":2,"type":24,"v":"+"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":80,"v":"return"},"length":2,"type":43,"v":"{","tryBlock":{}},"catchClauses":{"0":{"0":{},"type":62,"v":"catch","varName":"e","guard":null,"block":{"type":43,"v":"{","block":{}}},"length":1,"catchClauses":{}}},"length":1,"type":43,"v":"{","body":{}}},"1":{"1":{},"type":83,"v":"throw","exception":{"0":{"0":{},"type":58,"v":"Could not find/include script: "},"1":{"1":{},"type":56,"v":"SCRIPT_PATH"},"length":2,"type":24,"v":"+","exception":{}}},"length":2,"type":43,"v":"{","elsePart":{}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"0":{"0":{},"type":56,"v":"o","name":"o","readOnly":false},"length":1,"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"4":{"4":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"fetchUrl"},"length":2,"type":35,"v":"fetchUrl","assignOp":null},"1":{"1":{},"type":56,"v":"fetchUrl"},"length":2,"type":4,"v":"=","e":{}}},"5":{"5":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"load"},"length":2,"type":35,"v":"load","assignOp":null},"1":{"1":{},"type":56,"v":"load"},"length":2,"type":4,"v":"=","e":{}}},"6":{"6":{},"type":2,"v":"delete","e":{"0":{"0":{},"type":56,"v":"fetchUrl"},"length":1,"type":67,"v":"delete","e":{}}},"7":{"7":{},"type":2,"v":"delete","e":{"0":{"0":{},"type":56,"v":"load"},"length":1,"type":67,"v":"delete","e":{}}},"8":{"8":{},"type":2,"v":"(","e":{"0":{"0":{"0":{},"type":74,"v":"function","params":{"params":{}},"body":{"0":{"0":{"0":{},"type":56,"v":"cchild","name":"cchild","iz":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"createChild"},"length":2,"type":35,"v":"createChild","iz":{}},"readOnly":false},"length":1,"type":87,"v":"var"},"1":{"0":{"0":{},"type":56,"v":"csec","name":"csec","iz":{"type":56,"v":"security","iz":{}},"readOnly":false},"1":{},"length":1,"type":87,"v":"var"},"2":{"2":{},"type":2,"v":"createChild","e":{"0":{"0":{},"type":56,"v":"createChild","assignOp":null},"1":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"createChild"},"length":2,"type":35,"v":"createChild","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"name","1":"typeURI","2":"secURI","3":"DOMElement","length":4,"params":{}},"body":{"0":{"0":{},"type":80,"v":{"0":{"0":{},"type":56,"v":"cchild"},"1":{"0":{"0":{},"type":56,"v":"name"},"1":{"1":{},"type":56,"v":"typeURI"},"2":{"0":{"0":{"0":{"0":{},"type":56,"v":"csec"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMySecurityURI"},"length":2,"type":35,"v":"getMySecurityURI"},"1":{"1":{},"type":55,"v":")"},"2":{},"length":2,"type":46,"v":")"},"3":{"3":{},"type":56,"v":"DOMElement"},"length":4,"type":55,"v":","},"length":2,"type":46,"v":{"v":"("}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"="},"length":2,"type":4,"v":"=","e":{}}},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"0":{"0":{},"type":56,"v":"cchild","name":"cchild","iz":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"createChild"},"length":2,"type":35,"v":"createChild","iz":{}},"readOnly":false},"1":{"1":{},"type":56,"v":"csec","name":"csec","iz":{"type":56,"v":"security","iz":{}},"readOnly":false},"length":2,"vD":{}},"body":{}},"functionForm":1},"length":1,"type":54,"v":"("},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"9":{"9":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"setSecurityState"},"length":2,"type":35,"v":"setSecurityState","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"state","length":1,"params":{}},"body":{"0":{"0":{},"type":2,"v":"delete","e":{"0":{"0":{"0":{},"type":56,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent"},"length":1,"type":67,"v":"delete","e":{}}},"1":{"1":{},"type":2,"v":"this","e":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state","assignOp":null},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":4,"v":"=","e":{}}},"2":{"2":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"wakeupIPCLock"},"1":{"1":{},"type":56,"v":"check"},"length":2,"type":35,"v":"check"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","c":{}},"tP":{"type":2,"v":"wakeupIPCLock","e":{"0":{"0":{"0":{},"type":56,"v":"wakeupIPCLock"},"1":{"1":{},"type":56,"v":"release"},"length":2,"type":35,"v":"release"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}},"tP":{}},"elsePart":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"isSerialized"},"length":2,"type":35,"v":"isSerialized"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","c":{}},"tP":{"type":2,"v":"this","e":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"serialize"},"length":2,"type":35,"v":"serialize"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}},"tP":{}},"elsePart":null},"length":1,"type":43,"v":"{","elsePart":{}}},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"10":{"10":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"getSecurityState"},"length":2,"type":35,"v":"getSecurityState","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"params":{}},"body":{"0":{"0":{},"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"ipcIn"},"1":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"length":2,"type":51,"v":"ipcIn"},"length":1,"type":50,"v":{"v":"{"}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"11":{"11":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"checkInherit"},"length":2,"type":35,"v":"checkInherit","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"rq","length":1,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent","c":{}},"tP":{"0":{"0":{},"type":85,"v":"try","tryBlock":{"0":{"0":{},"type":80,"v":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"execIPC"},"length":2,"type":35,"v":"execIPC"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent"},"1":{"1":{},"type":58,"v":"validateRequest"},"2":{"0":{"0":{},"type":56,"v":"rq"},"2":{},"length":1,"type":49,"v":"["},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"("},"1":{"1":{},"type":56,"v":"result"},"length":2,"type":35,"v":{"v":"result"}}},"length":1,"type":43,"v":"{","tryBlock":{}},"catchClauses":{"0":{"0":{},"type":62,"v":"catch","varName":"e","guard":null,"block":{"0":{"0":{},"type":80,"v":{"type":71,"v":{"v":"false"}}},"length":1,"type":43,"v":"{","block":{}}},"length":1,"catchClauses":{}}},"length":1,"type":43,"v":"{","tP":{}},"elsePart":null},"1":{"0":{"0":{},"type":56,"v":"lp","name":"lp","iz":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"1":{"1":{},"type":56,"v":"split"},"length":2,"type":35,"v":"split"},"1":{"0":{"0":{},"type":58,"v":"/"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"1":{},"length":1,"type":87,"v":"var"},"2":{"2":{},"type":2,"v":"lp","e":{"0":{"0":{"0":{},"type":56,"v":"lp"},"1":{"1":{},"type":56,"v":"pop"},"length":2,"type":35,"v":"pop"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}}},"3":{"3":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"lp"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":1,"type":29,"v":"!","c":{}},"tP":{"0":{"0":{},"type":2,"v":"console","e":{"0":{"0":{"0":{},"type":56,"v":"console"},"1":{"1":{},"type":56,"v":"log"},"length":2,"type":35,"v":"log"},"1":{"0":{"0":{},"type":58,"v":"returning false!"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":80,"v":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent","assignOp":null},"1":{"1":{},"type":71,"v":"false"},"length":2,"type":4,"v":{"v":"="}}},"length":2,"type":43,"v":"{","tP":{}},"elsePart":null},"4":{"0":{"0":{},"type":56,"v":"d","name":"d","iz":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"execURI"},"length":2,"type":35,"v":"execURI"},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"lp"},"1":{"1":{},"type":56,"v":"join"},"length":2,"type":35,"v":"join"},"1":{"0":{"0":{},"type":58,"v":"/"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"validateRequest"},"2":{"0":{"0":{},"type":56,"v":"rq"},"2":{},"length":1,"type":49,"v":"["},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"4":{},"length":1,"type":87,"v":"var"},"5":{"5":{},"type":2,"v":"this","e":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent","assignOp":null},"1":{"0":{"0":{},"type":56,"v":"d"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent"},"length":2,"type":4,"v":"=","e":{}}},"6":{"6":{},"type":80,"v":{"0":{"0":{},"type":56,"v":"d"},"1":{"1":{},"type":56,"v":"result"},"length":2,"type":35,"v":{"v":"result"}}},"length":7,"type":42,"v":"{","fD":{"fD":{}},"vD":{"0":{"0":{},"type":56,"v":"lp","name":"lp","iz":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"1":{"1":{},"type":56,"v":"split"},"length":2,"type":35,"v":"split"},"1":{"0":{"0":{},"type":58,"v":"/"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"1":{"1":{},"type":56,"v":"d","name":"d","iz":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"execURI"},"length":2,"type":35,"v":"execURI"},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"lp"},"1":{"1":{},"type":56,"v":"join"},"length":2,"type":35,"v":"join"},"1":{"0":{"0":{},"type":58,"v":"/"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"validateRequest"},"2":{"0":{"0":{},"type":56,"v":"rq"},"2":{},"length":1,"type":49,"v":"["},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"length":2,"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"12":{"12":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"rpath"},"length":2,"type":35,"v":"rpath","assignOp":null},"1":{"0":{"0":{},"type":56,"v":"RegExp"},"1":{"0":{"0":{},"type":58,"v":"^\\\\/bin|^\\\\/test|^\\\\/jeneric.net\\\\/bin"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":47,"v":"new"},"length":2,"type":4,"v":"=","e":{}}},"13":{"13":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"rslash"},"length":2,"type":35,"v":"rslash","assignOp":null},"1":{"0":{"0":{},"type":56,"v":"RegExp"},"1":{"0":{"0":{},"type":58,"v":"\\\\/"},"1":{"1":{},"type":58,"v":"g"},"length":2,"type":55,"v":","},"length":2,"type":47,"v":"new"},"length":2,"type":4,"v":"=","e":{}}},"14":{"14":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"signRequest"},"length":2,"type":35,"v":"signRequest","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"rq","length":1,"params":{}},"body":{"0":{"0":{"0":{},"type":56,"v":"type","name":"type","iz":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyTypeURI"},"length":2,"type":35,"v":"getMyTypeURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","iz":{}},"readOnly":false},"length":1,"type":87,"v":"var"},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"type"},"1":{"1":{},"type":56,"v":"charAt"},"length":2,"type":35,"v":"charAt"},"1":{"0":{"0":{},"type":57,"v":0},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"/"},"length":2,"type":13,"v":"=="},"1":{"0":{"0":{"0":{"0":{},"type":56,"v":"type"},"1":{"1":{},"type":56,"v":"indexOf"},"length":2,"type":35,"v":"indexOf"},"1":{"0":{"0":{},"type":58,"v":"~/insecure"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"0":{"0":{},"type":57,"v":1},"1":{},"length":1,"type":32,"v":"-"},"length":2,"type":14,"v":"!="},"length":2,"type":8,"v":"||","c":{}},"tP":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"hasOwnProperty"},"length":2,"type":35,"v":"hasOwnProperty"},"1":{"0":{"0":{},"type":58,"v":"path_allowed"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","c":{}},"tP":{"type":80,"v":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"path_allowed"},"length":2,"type":35,"v":{"v":"path_allowed"}},"tP":{}},"elsePart":null},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"type"},"1":{"1":{},"type":56,"v":"match"},"length":2,"type":35,"v":"match"},"1":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"rpath"},"length":2,"type":35,"v":"rpath"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","c":{}},"tP":{"type":80,"v":{"type":84,"v":{"v":"true"}},"tP":{}},"elsePart":null},"2":{"0":{"0":{},"type":56,"v":"ohash","name":"ohash","iz":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"uri2id"},"length":2,"type":35,"v":"uri2id"},"1":{"0":{"0":{},"type":56,"v":"type"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"2":{},"length":1,"type":87,"v":"var"},"3":{"3":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"uri"},"length":2,"type":35,"v":"uri"},"1":{"0":{"0":{},"type":58,"v":"/bin/checked/"},"1":{"1":{},"type":56,"v":"ohash"},"length":2,"type":24,"v":"+"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":80,"v":{"type":84,"v":{"v":"true"}},"tP":{}},"elsePart":null},"4":{"4":{},"type":85,"v":"try","tryBlock":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"execURI"},"length":2,"type":35,"v":"execURI"},"1":{"0":{"0":{"0":{},"type":58,"v":"/bin/checked/"},"1":{"1":{},"type":56,"v":"ohash"},"length":2,"type":24,"v":"+"},"1":{"1":{},"type":58,"v":"read"},"2":{"2":{},"type":49,"v":"["},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"(","c":{}},"tP":{"0":{"0":{},"type":2,"v":"this","e":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"path_allowed"},"length":2,"type":35,"v":"path_allowed","assignOp":null},"1":{"1":{},"type":84,"v":"true"},"length":2,"type":4,"v":"=","e":{}}},"1":{"1":{},"type":80,"v":{"type":84,"v":{"v":"true"}}},"length":2,"type":43,"v":"{","tP":{}},"elsePart":null},"length":1,"type":43,"v":"{","tryBlock":{}},"catchClauses":{"0":{"0":{},"type":62,"v":"catch","varName":"e","guard":null,"block":{"type":43,"v":"{","block":{}}},"length":1,"catchClauses":{}}},"5":{"0":{"0":{},"type":56,"v":"stype","name":"stype","iz":{"0":{"0":{"0":{},"type":56,"v":"type"},"1":{"1":{},"type":56,"v":"replace"},"length":2,"type":35,"v":"replace"},"1":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"rslash"},"length":2,"type":35,"v":"rslash"},"1":{"1":{},"type":58,"v":"_"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"5":{},"length":1,"type":87,"v":"var"},"6":{"6":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"uri"},"length":2,"type":35,"v":"uri"},"1":{"1":{},"type":56,"v":"toString"},"length":2,"type":35,"v":"toString"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"1":{"1":{},"type":56,"v":"charAt"},"length":2,"type":35,"v":"charAt"},"1":{"0":{"0":{},"type":57,"v":0},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"~"},"length":2,"type":13,"v":"=="},"1":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"uri"},"length":2,"type":35,"v":"uri"},"1":{"1":{},"type":56,"v":"toString"},"length":2,"type":35,"v":"toString"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"1":{"1":{},"type":56,"v":"indexOf"},"length":2,"type":35,"v":"indexOf"},"1":{"0":{"0":{"0":{},"type":58,"v":"~/insecure/"},"1":{"1":{},"type":56,"v":"stype"},"length":2,"type":24,"v":"+"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"0":{"0":{},"type":57,"v":1},"1":{},"length":1,"type":32,"v":"-"},"length":2,"type":13,"v":"=="},"length":2,"type":9,"v":"&&"},"length":1,"type":54,"v":"("},"1":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"uri"},"length":2,"type":35,"v":"uri"},"1":{"1":{},"type":56,"v":"toString"},"length":2,"type":35,"v":"toString"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"1":{"1":{},"type":56,"v":"indexOf"},"length":2,"type":35,"v":"indexOf"},"1":{"0":{"0":{"0":{},"type":58,"v":"/home/"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"kconfig"},"length":2,"type":35,"v":"kconfig"},"1":{"0":{"0":{},"type":58,"v":"terminal_id"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"length":2,"type":24,"v":"+"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"0":{"0":{},"type":57,"v":1},"1":{},"length":1,"type":32,"v":"-"},"length":2,"type":14,"v":"!="},"length":2,"type":8,"v":"||","c":{}},"tP":{"0":{"0":{},"type":80,"v":{"type":58,"v":{"v":"signRenuest: only access to ~/insecure/* (local) and not /home/<terminal_id> (global) is allowed by this security policy"}}},"length":1,"type":43,"v":"{","tP":{}},"elsePart":null},"7":{"7":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"uri"},"length":2,"type":35,"v":"uri"},"1":{"1":{},"type":56,"v":"toString"},"length":2,"type":35,"v":"toString"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"1":{"1":{},"type":56,"v":"charAt"},"length":2,"type":35,"v":"charAt"},"1":{"0":{"0":{},"type":57,"v":0},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"~"},"length":2,"type":13,"v":"=="},"1":{"0":{"0":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"method"},"length":2,"type":35,"v":"method"},"1":{"1":{},"type":58,"v":"read"},"length":2,"type":16,"v":"!=="},"1":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"method"},"length":2,"type":35,"v":"method"},"1":{"1":{},"type":58,"v":"write"},"length":2,"type":16,"v":"!=="},"length":2,"type":9,"v":"&&"},"1":{},"length":1,"type":54,"v":"("},"length":2,"type":9,"v":"&&","c":{}},"tP":{"0":{"0":{},"type":80,"v":{"type":58,"v":{"v":"signRequest: only \'read\' and \'write\' requests are allowed locally"}}},"length":1,"type":43,"v":"{","tP":{}},"elsePart":null},"length":8,"type":43,"v":"{","tP":{}},"elsePart":null},"2":{"2":{},"type":75,"v":"if","c":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"method"},"length":2,"type":35,"v":"method"},"1":{"1":{},"type":58,"v":"acl_validate"},"length":2,"type":15,"v":"===","c":{}},"tP":{"type":80,"v":{"type":71,"v":{"v":"false"}},"tP":{}},"elsePart":null},"3":{"3":{},"type":80,"v":{"type":84,"v":{"v":"true"}}},"length":4,"type":42,"v":"{","fD":{"fD":{}},"vD":{"0":{"0":{},"type":56,"v":"type","name":"type","iz":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyTypeURI"},"length":2,"type":35,"v":"getMyTypeURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","iz":{}},"readOnly":false},"1":{"1":{},"type":56,"v":"ohash","name":"ohash","iz":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"uri2id"},"length":2,"type":35,"v":"uri2id"},"1":{"0":{"0":{},"type":56,"v":"type"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"2":{"2":{},"type":56,"v":"stype","name":"stype","iz":{"0":{"0":{"0":{},"type":56,"v":"type"},"1":{"1":{},"type":56,"v":"replace"},"length":2,"type":35,"v":"replace"},"1":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"rslash"},"length":2,"type":35,"v":"rslash"},"1":{"1":{},"type":58,"v":"_"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"(","iz":{}},"readOnly":false},"length":3,"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"15":{"15":{},"type":2,"v":"security","e":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"validateRequest"},"length":2,"type":35,"v":"validateRequest","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"rq","length":1,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"caller_uri"},"length":2,"type":35,"v":"caller_uri"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":13,"v":"=="},"1":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"method"},"length":2,"type":35,"v":"method"},"1":{"1":{},"type":58,"v":"securitySet"},"length":2,"type":13,"v":"=="},"length":2,"type":9,"v":"&&","c":{}},"tP":{"type":80,"v":{"type":71,"v":{"v":"false"}},"tP":{}},"elsePart":null},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"terminal_id"},"length":2,"type":35,"v":"terminal_id"},"1":{"1":{},"type":58,"v":"~"},"length":2,"type":13,"v":"=="},"1":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"terminal_id"},"length":2,"type":35,"v":"terminal_id"},"1":{"0":{"0":{"0":{},"type":56,"v":"object"},"1":{"1":{},"type":56,"v":"kconfig"},"length":2,"type":35,"v":"kconfig"},"1":{"0":{"0":{},"type":58,"v":"terminal_id"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"length":2,"type":13,"v":"=="},"length":2,"type":8,"v":"||","c":{}},"tP":{"type":80,"v":{"type":84,"v":{"v":"true"}},"tP":{}},"elsePart":null},"2":{"2":{},"type":80,"v":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":56,"v":"validateRequest"},"length":2,"type":35,"v":"validateRequest"},"1":{"1":{},"type":56,"v":"call"},"length":2,"type":35,"v":"call"},"1":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":79,"v":"null"},"2":{"2":{},"type":56,"v":"rq"},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"("},"1":{"1":{},"type":56,"v":"result"},"length":2,"type":35,"v":{"v":"result"}}},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"16":{"16":{},"type":2,"v":"security","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":56,"v":"validateRequest"},"length":2,"type":35,"v":"validateRequest","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"obj","1":"rq","length":2,"params":{}},"body":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"length":1,"type":29,"v":"!"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{},"length":1,"type":29,"v":"!"},"length":2,"type":8,"v":"||","c":{}},"tP":{"type":2,"v":"this","e":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state","assignOp":null},"1":{"0":{"0":{"0":{},"type":56,"v":"ipcIn"},"1":{"1":{},"type":58,"v":"inherit"},"length":2,"type":51,"v":"inherit"},"1":{},"length":1,"type":50,"v":"{"},"length":2,"type":4,"v":"=","e":{}},"tP":{}},"elsePart":null},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{"1":{},"type":58,"v":"inherit"},"length":2,"type":15,"v":"===","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"checkInherit"},"length":2,"type":35,"v":"checkInherit"},"1":{"1":{},"type":56,"v":"call"},"length":2,"type":35,"v":"call"},"1":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"rq"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"("},"length":2,"type":51,"v":")"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent"},"length":2,"type":51,"v":"inheritParent"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":null},"2":{"2":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{"1":{},"type":58,"v":"*"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"1":{},"type":84,"v":"true"},"length":2,"type":51,"v":"true"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":51,"v":")"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":null},"3":{"3":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{"1":{},"type":56,"v":"hasOwnProperty"},"length":2,"type":35,"v":"hasOwnProperty"},"1":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"method"},"length":2,"type":35,"v":"method"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"length":1,"type":29,"v":"!"},"1":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{"1":{},"type":56,"v":"hasOwnProperty"},"length":2,"type":35,"v":"hasOwnProperty"},"1":{"0":{"0":{},"type":58,"v":"*"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"length":2,"type":9,"v":"&&","c":{}},"tP":{"0":{"0":{},"type":56,"v":"md","name":"md","iz":{"type":58,"v":"*","iz":{}},"readOnly":false},"length":1,"type":87,"v":"var","tP":{}},"elsePart":{"type":2,"v":"md","e":{"0":{"0":{},"type":56,"v":"md","assignOp":null},"1":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"method"},"length":2,"type":35,"v":"method"},"length":2,"type":4,"v":"=","e":{}},"elsePart":{}}},"4":{"4":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{"1":{},"type":56,"v":"hasOwnProperty"},"length":2,"type":35,"v":"hasOwnProperty"},"1":{"0":{"0":{},"type":56,"v":"md"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","c":{}},"tP":{"0":{"0":{"0":{},"type":56,"v":"t","name":"t","readOnly":false},"1":{"1":{},"type":56,"v":"acls","name":"acls","iz":{"type":49,"v":"[","iz":{}},"readOnly":false},"2":{"2":{},"type":56,"v":"neg_acls","name":"neg_acls","iz":{"type":49,"v":"[","iz":{}},"readOnly":false},"length":3,"type":87,"v":"var"},"1":{"1":{},"type":73,"v":"for","isLoop":true,"setup":{"0":{"0":{},"type":56,"v":"i","name":"i","iz":{"type":57,"v":0,"iz":{}},"readOnly":false},"length":1,"type":87,"v":"var","setup":{}},"c":{"0":{"0":{},"type":56,"v":"i"},"1":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{"1":{},"type":56,"v":"md"},"length":2,"type":48,"v":"["},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length"},"length":2,"type":17,"v":"<","c":{}},"update":{"0":{"0":{},"type":56,"v":"i"},"length":1,"type":33,"v":"++","postfix":true,"update":{}},"body":{"0":{"0":{},"type":2,"v":"t","e":{"0":{"0":{},"type":56,"v":"t","assignOp":null},"1":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"ipcIn"},"length":2,"type":35,"v":"ipcIn"},"1":{"1":{},"type":56,"v":"md"},"length":2,"type":48,"v":"["},"1":{"1":{},"type":56,"v":"i"},"length":2,"type":48,"v":"["},"length":2,"type":4,"v":"=","e":{}}},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"t"},"1":{"1":{},"type":56,"v":"charAt"},"length":2,"type":35,"v":"charAt"},"1":{"0":{"0":{},"type":57,"v":0},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"!"},"length":2,"type":13,"v":"==","c":{}},"tP":{"0":{"0":{},"type":2,"v":"t","e":{"0":{"0":{},"type":56,"v":"t","assignOp":null},"1":{"0":{"0":{"0":{},"type":56,"v":"t"},"1":{"1":{},"type":56,"v":"slice"},"length":2,"type":35,"v":"slice"},"1":{"0":{"0":{},"type":57,"v":1},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"length":2,"type":4,"v":"=","e":{}}},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"t"},"1":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"terminal_id"},"length":2,"type":35,"v":"terminal_id"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"1":{},"type":71,"v":"false"},"length":2,"type":51,"v":"false"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":51,"v":")"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":null},"2":{"2":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"t"},"1":{"1":{},"type":56,"v":"charAt"},"length":2,"type":35,"v":"charAt"},"1":{"0":{"0":{},"type":57,"v":0},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"#"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":2,"v":"neg_acls","e":{"0":{"0":{"0":{},"type":56,"v":"neg_acls"},"1":{"1":{},"type":56,"v":"push"},"length":2,"type":35,"v":"push"},"1":{"0":{"0":{},"type":56,"v":"t"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}},"tP":{}},"elsePart":null},"length":3,"type":43,"v":"{","tP":{}},"elsePart":{"0":{"0":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"t"},"1":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"terminal_id"},"length":2,"type":35,"v":"terminal_id"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"1":{},"type":84,"v":"true"},"length":2,"type":51,"v":"true"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":51,"v":")"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":null},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":56,"v":"t"},"1":{"1":{},"type":56,"v":"charAt"},"length":2,"type":35,"v":"charAt"},"1":{"0":{"0":{},"type":57,"v":0},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"("},"1":{"1":{},"type":58,"v":"#"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":2,"v":"acls","e":{"0":{"0":{"0":{},"type":56,"v":"acls"},"1":{"1":{},"type":56,"v":"push"},"length":2,"type":35,"v":"push"},"1":{"0":{"0":{},"type":56,"v":"t"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}},"tP":{}},"elsePart":null},"length":2,"type":43,"v":"{","elsePart":{}}},"2":{"2":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"t"},"1":{"1":{},"type":58,"v":"inherit"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"checkInherit"},"length":2,"type":35,"v":"checkInherit"},"1":{"1":{},"type":56,"v":"call"},"length":2,"type":35,"v":"call"},"1":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"rq"},"length":2,"type":55,"v":","},"length":2,"type":46,"v":"("},"length":2,"type":51,"v":")"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent"},"length":2,"type":51,"v":"inheritParent"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":null},"3":{"3":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"t"},"1":{"1":{},"type":58,"v":"*"},"length":2,"type":13,"v":"==","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"1":{},"type":84,"v":"true"},"length":2,"type":51,"v":"true"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":51,"v":")"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":null},"length":4,"type":43,"v":"{","body":{}}},"2":{"2":{},"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"acls"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"execIPC"},"length":2,"type":35,"v":"execIPC"},"1":{"0":{"0":{},"type":58,"v":"~/security/ACL"},"1":{"1":{},"type":58,"v":"acl_validate"},"2":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"terminal_id"},"length":2,"type":35,"v":"terminal_id"},"1":{"1":{},"type":56,"v":"acls"},"2":{},"length":2,"type":49,"v":"["},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"("},"length":2,"type":51,"v":")"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":51,"v":")"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":{"type":75,"v":"if","c":{"0":{"0":{},"type":56,"v":"neg_acls"},"1":{"1":{},"type":56,"v":"length"},"length":2,"type":35,"v":"length","c":{}},"tP":{"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"0":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"execIPC"},"length":2,"type":35,"v":"execIPC"},"1":{"0":{"0":{},"type":58,"v":"~/security/ACL"},"1":{"1":{},"type":58,"v":"acl_validate"},"2":{"0":{"0":{"0":{},"type":56,"v":"rq"},"1":{"1":{},"type":56,"v":"terminal_id"},"length":2,"type":35,"v":"terminal_id"},"1":{"1":{},"type":56,"v":"acls"},"2":{},"length":2,"type":49,"v":"["},"length":3,"type":55,"v":","},"length":2,"type":46,"v":"("},"1":{},"length":1,"type":29,"v":"!"},"length":2,"type":51,"v":")"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":51,"v":")"},"length":2,"type":50,"v":{"v":"{"}},"tP":{}},"elsePart":{"elsePart":null}}},"length":3,"type":43,"v":"{","tP":{}},"elsePart":null},"5":{"5":{},"type":80,"v":{"0":{"0":{"0":{},"type":56,"v":"result"},"1":{"1":{},"type":71,"v":"false"},"length":2,"type":51,"v":"false"},"1":{"0":{"0":{},"type":56,"v":"inheritParent"},"1":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"getMyURI"},"length":2,"type":35,"v":"getMyURI"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")"},"length":2,"type":51,"v":")"},"length":2,"type":50,"v":{"v":"{"}}},"length":6,"type":42,"v":"{","fD":{"fD":{}},"vD":{"0":{"0":{},"type":56,"v":"md","name":"md","iz":{"type":58,"v":"*","iz":{}},"readOnly":false},"1":{"1":{},"type":56,"v":"t","name":"t","readOnly":false},"2":{"2":{},"type":56,"v":"acls","name":"acls","iz":{"type":49,"v":"[","iz":{}},"readOnly":false},"3":{"3":{},"type":56,"v":"neg_acls","name":"neg_acls","iz":{"type":49,"v":"[","iz":{}},"readOnly":false},"4":{"4":{},"type":56,"v":"i","name":"i","iz":{"type":57,"v":0,"iz":{}},"readOnly":false},"length":5,"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"17":{"17":{},"type":2,"v":"security","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":56,"v":"securityGet"},"length":2,"type":35,"v":"securityGet","assignOp":null},"1":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"getSecurityState"},"length":2,"type":35,"v":"getSecurityState"},"length":2,"type":4,"v":"=","e":{}}},"18":{"18":{},"type":2,"v":"security","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":56,"v":"securitySet"},"length":2,"type":35,"v":"securitySet","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"rq","1":"newState","length":2,"params":{}},"body":{"0":{"0":{},"type":2,"v":"this","e":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"setSecurityState"},"length":2,"type":35,"v":"setSecurityState"},"1":{"0":{"0":{},"type":56,"v":"newState"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}}},"length":1,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"19":{"19":{},"type":2,"v":"security","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":56,"v":"securityFlushCache"},"length":2,"type":35,"v":"securityFlushCache","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"params":{}},"body":{"0":{"0":{},"type":2,"v":"delete","e":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"state"},"length":2,"type":35,"v":"state"},"1":{"1":{},"type":56,"v":"inheritParent"},"length":2,"type":35,"v":"inheritParent"},"length":1,"type":67,"v":"delete","e":{}}},"1":{"1":{},"type":2,"v":"delete","e":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"path_allowed"},"length":2,"type":35,"v":"path_allowed"},"length":1,"type":67,"v":"delete","e":{}}},"2":{"2":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"isSerialized"},"length":2,"type":35,"v":"isSerialized"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","c":{}},"tP":{"type":2,"v":"this","e":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"serialize"},"length":2,"type":35,"v":"serialize"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}},"tP":{}},"elsePart":null},"length":3,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"20":{"20":{},"type":2,"v":"security","e":{"0":{"0":{"0":{"0":{},"type":56,"v":"security"},"1":{"1":{},"type":56,"v":"ipc"},"length":2,"type":35,"v":"ipc"},"1":{"1":{},"type":56,"v":"changeSecurityURI"},"length":2,"type":35,"v":"changeSecurityURI","assignOp":null},"1":{"1":{},"type":74,"v":"function","params":{"0":"rq","1":"newURI","length":2,"params":{}},"body":{"0":{"0":{},"type":2,"v":"this","e":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"changeSecurityURI"},"length":2,"type":35,"v":"changeSecurityURI"},"1":{"0":{"0":{},"type":56,"v":"newURI"},"1":{},"length":1,"type":55,"v":")"},"length":2,"type":46,"v":"(","e":{}}},"1":{"1":{},"type":75,"v":"if","c":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"isSerialized"},"length":2,"type":35,"v":"isSerialized"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","c":{}},"tP":{"type":2,"v":"this","e":{"0":{"0":{"0":{"0":{},"type":82,"v":"this"},"1":{"1":{},"type":56,"v":"object"},"length":2,"type":35,"v":"object"},"1":{"1":{},"type":56,"v":"serialize"},"length":2,"type":35,"v":"serialize"},"1":{"1":{},"type":55,"v":")"},"length":2,"type":46,"v":")","e":{}},"tP":{}},"elsePart":null},"length":2,"type":42,"v":"{","fD":{"fD":{}},"vD":{"vD":{}},"body":{}},"functionForm":1},"length":2,"type":4,"v":"=","e":{}}},"21":{"21":{},"type":2,"v":"delete","e":{"0":{"0":{},"type":56,"v":"security"},"length":1,"type":67,"v":"delete","e":{}}},"length":22,"type":42,"fD":{},"vD":{}}',"os/st_acl.jn": '// LICENSE: GPL v.3 or later (C) 2010 Andrew Gryaznov realgrandrew@gmail.com, a.gryaznov@svoyaset.ru\n\
// ACL control object for terminal-based security\n\
\n\
if(!object.data.acls) {\n\
    object.data.acls = {};\n\
    object.data.trustList = [];\n\
}\n\
\n\
MAXCACHE = 100;\n\
cache = {};\n\
cachelen = 0;\n\
\n\
// main interaction method: \n\
// XXX Information leak here!!\n\
object.ipc.acl_validate = function (rq, terminal_id, acls, ttl) {\n\
    if(ttl < 1) return "acl recursion ttl expired";\n\
    ttl = ttl || 5;\n\
    var act = [];\n\
    for(var i =0; i< acls.length;i++) {\n\
        if(acls[i] in object.data.acls) {\n\
            if(object.data.acls[acls[i]].hasOwnProperty(terminal_id)) return true;\n\
            // now check if there are links to other ACLs:\n\
            for(var ta in object.data.acls[acls[i]]) {\n\
                if(ta.charAt(0) == "#") { // acl\n\
                    act.push(ta);\n\
                }\n\
            }\n\
        } \n\
    }\n\
    if(act.length > 0) {\n\
        var r = object.ipc.acl_validate(null, terminal_id, act, --ttl);\n\
        if(r) return r;\n\
    }\n\
    // check cache\n\
    if(cache[JSON.stringify(acls)+terminal_id]) return true;\n\
    // todo: cache access denials?\n\
    // now check next host\n\
    \n\
    for(var i=0; i<object.data.trustList.length;i++) {\n\
        var r = object.execURI("/"+object.data.trustList[i]+"/security/ACL", "acl_validate", [terminal_id, acls, --ttl]) \n\
        if(r === true) {\n\
            // add to cache\n\
            cache[JSON.stringify(acls)+terminal_id] = true;\n\
            cachelen++;\n\
            if(cachelen > MAXCACHE) {\n\
                for(ob in cache) {\n\
                    delete ob; // delete last object\n\
                    break;\n\
                }\n\
            }\n\
            return true;\n\
        } else {\n\
            return r;\n\
        }\n\
    }\n\
    return false; // a long way to return false... better cache requests at object\'s sec\n\
};\n\
\n\
\n\
\n\
// ACL lists control\n\
\n\
object.ipc.addACL = function (rq, aclname) { // : add new ACL to the list, either starting with "#" or not\n\
    if(aclname.charAt(0) != "#") aclname = "#"+aclname;\n\
    if(object.data.acls.hasOwnProperty(aclname)) throw "ACL with that name aready exists!";\n\
    object.data.acls[aclname] = {};\n\
    object.serialize();\n\
};\n\
\n\
object.ipc.deleteACL = function (rq, aclname) { // :\n\
    if(aclname.charAt(0) != "#") aclname = "#"+aclname;\n\
    if(object.data.acls.hasOwnProperty(aclname)) {\n\
        delete object.data.acls[aclname];\n\
        object.serialize();\n\
    }\n\
    else throw "ACL with that name does not exist";\n\
};\n\
\n\
object.ipc.listACL = function (rq) { //  : list all ACL names available \n\
    var ob = [];\n\
    for(var o in object.data.acls) {\n\
        ob.push(o);\n\
    }\n\
    return ob;\n\
};\n\
\n\
\n\
\n\
// ACL content control\n\
\n\
object.ipc.ACLappend = function (rq, aclname, terminalID) { // : append a terminal_id to this ACL\n\
    if(aclname.charAt(0) != "#") aclname = "#"+aclname;\n\
    if(!object.data.acls.hasOwnProperty(aclname)) throw "no ACL with that name";\n\
    if(object.data.acls[aclname].hasOwnProperty(terminalID)) throw "member with that name already exists";\n\
    object.data.acls[aclname][terminalID] = null;\n\
    object.serialize();\n\
};\n\
\n\
object.ipc.ACLremove = function (rq, aclname, terminalID) { // : remove\n\
    if(aclname.charAt(0) != "#") aclname = "#"+aclname;\n\
    if(!object.data.acls.hasOwnProperty(aclname)) throw "no ACL with that name";\n\
    if(!object.data.acls[aclname].hasOwnProperty(terminalID)) throw "member with that name does not exist";\n\
    delete object.data.acls[aclname][terminalID];\n\
    object.serialize();\n\
};\n\
\n\
object.ipc.ACLlist = function (rq, aclname) { // : get a listing of this ACL\'s terminals \n\
    if(aclname.charAt(0) != "#") aclname = "#"+aclname;\n\
    if(!object.data.acls.hasOwnProperty(aclname)) throw "no ACL with that name";\n\
    var l = [];\n\
    for(var o in object.data.acls[aclname]) {\n\
        l.push(o);\n\
    }\n\
    return l\n\
};\n\
\n\
\n\
\n\
// Trusted connections control: allow access only from ~/security/icaclc\n\
\n\
object.ipc.setTrustList = function (rq, trustList) { // : list of terminal_id\'s for validate to ask\n\
    if(trustList instanceof Array) object.data.trustList = trustList;\n\
    else throw "trust list must be array of strings";\n\
    object.serialize();\n\
};\n\
\n\
object.ipc.getTrustList = function (rq) {\n\
    return object.data.trustList;\n\
};\n\
\n\
object.ipc.flushcache = function (rq) {\n\
    cache = {};\n\
    cachelen = 0;\n\
};\n\
\n\
// everything has been defined. unlock.\n\
initIPCLock.release();',"os/tmpstore.jn": '// tmpstore.jn\n\
// stores data in memory and never serializes\n\
// LICENSE: GPL v.3 or later (C) 2010 Andrew Gryaznov realgrandrew@gmail.com, a.gryaznov@svoyaset.ru\n\
// TODO: error checking everywhere!!\n\
\n\
sdata = "";\n\
\n\
function read(rq, offset, len) {\n\
    // TODO: error checking?\n\
    //ErrorConsole.log("ramstore: returning data: "+sdata.substr(offset, len) + " params: "+offset+" l "+len);\n\
    if(!offset) offset = 0;\n\
    if(!len) len = sdata.length;\n\
    var r = sdata.substr(offset, len);\n\
    //ErrorConsole.log(object.getMyURI()+" o/l: "+offset+"/"+len+" real len: "+sdata.length+" real data typeof: "+typeof(sdata)+" ; returning data "+r);\n\
    return r;\n\
}\n\
\n\
function write(rq, data, offset) {\n\
    // TODO: error checking?\n\
    // TODO: APPEND call!!!\n\
    if(offset == -1) {\n\
            object.data.data = object.data.data.concat(data.wrappedString);\n\
            return true;\n\
    }\n\
    if(!offset) sdata = data;\n\
    else sdata = "".concat(sdata.substr(0, offset), data, sdata.substr(offset+data.length, sdata.length));\n\
    return true;\n\
}\n\
\n\
function ipc_addAsChild(rq, name, uri) {\n\
    // add as child the object of uri URI named name\n\
    object.linkChild(name, uri);\n\
}\n\
\n\
function ipc_createChild(rq, name, type, sec, dbind) {\n\
    object.createChild(name, type, sec, dbind); // DOC: only tmpstore is allowed to create DOM bindings now (see TQLW)\n\
                                                // cross-terminal bindings still unsupported and behaviour untested\n\
}\n\
\n\
function ipc_deleteChild(rq, name) {\n\
    object.deleteChild(name);\n\
}\n\
\n\
function ipc_listChildren(rq) {\n\
    return object.enumerateChildren(); // will return an Array object\n\
}\n\
\n\
object.ipc["read"] = read;\n\
object.ipc["write"] = write;\n\
object.ipc["addAsChild"] = ipc_addAsChild;\n\
object.ipc["createChild"] = ipc_createChild;\n\
object.ipc["deleteChild"] = ipc_deleteChild;\n\
object.ipc["listChildren"] = ipc_listChildren;\n\
\n\
\n\
// TODO: this should be set in security method\n\
//       as well as wakeupIPCLock (in setSecurityState())\n\
initIPCLock.release();// = false; // ready for IPC...\n\
',"os/ic.jn": '// LICENSE: GPL v.3 or later (C) 2010 Andrew Gryaznov realgrandrew@gmail.com, a.gryaznov@svoyaset.ru\n\
// ic.jn\n\
// TODO: auto-hide closebox\n\
WRITE_ON = true;\n\
OutTo = document.body;\n\
object.ipc["write"] = function(rq, data) {\n\
    // write \n\
    if(WRITE_ON) {\n\
        brDOM(); printDOM("Message from /"+rq["terminal_id"]+rq["caller_uri"].slice(1)+": "+data.substr(0, 1000)); brDOM(); // the RQ may contain \'username\' if we use the right security model..\n\
    }\n\
}\n\
\n\
function CommandHistory() {\n\
    this.ch = [""];\n\
    this.MAXLEN = 100;\n\
    this.index = 0;\n\
}\n\
CommandHistory.prototype.add = function (cmd) {\n\
    this.ch.pop();\n\
    this.ch.push(cmd);\n\
    this.ch.push("");\n\
    if(this.ch.length > this.MAXLEN) this.ch.shift();\n\
    this.index = 0;\n\
};\n\
CommandHistory.prototype.get = function (indx) { // safe get\n\
    if(typeof(indx) == "undefined") {\n\
        if(this.index >= this.ch.length) this.index=this.ch.length-1;\n\
        if(this.index < 0) this.index=0;\n\
        indx = this.index;\n\
    }\n\
    return this.ch[this.ch.length-(1+indx)];\n\
};\n\
CommandHistory.prototype.set = function (value, index) { // safe get\n\
    if(typeof(index) == "undefined") {\n\
        if(this.index >= this.ch.length) this.index=this.ch.length-1;\n\
        if(this.index < 0) this.index=0;\n\
        index = this.index;\n\
    }\n\
    this.ch[this.ch.length-(1+index)] = value;\n\
};\n\
CH = new CommandHistory();\n\
\n\
object.ipc["listChildren"] = function (rq) {\n\
    return object.enumerateChildren(); // will return an Array object\n\
}\n\
\n\
function printDOM( txt ) {\n\
    var x = document.createElement("DIV");\n\
    x.style.display = "inline";\n\
    x.style.fontFamily = "courier";\n\
    var t = document.createTextNode(txt);\n\
    x.appendChild(t);\n\
    OutTo.appendChild(x);\n\
    window.scrollTo(0,1000000);\n\
}\n\
\n\
function preDOM( txt ) {\n\
    var x = document.createElement("PRE");\n\
    var t = document.createTextNode(txt);\n\
    x.appendChild(t);\n\
    OutTo.appendChild(x);\n\
    window.scrollTo(0,1000000);\n\
}\n\
\n\
\n\
function brDOM() {\n\
    var x = document.createElement("DIV");\n\
    OutTo.appendChild(x);\n\
    window.scrollTo(0,1000000);\n\
}\n\
\n\
function insertCurrent(el, txt) {\n\
    var x = document.createElement("DIV");\n\
    //x.style.display = "inline";\n\
    x.style.fontFamily = "courier";\n\
    var t = document.createTextNode(txt);\n\
    x.appendChild(t);\n\
    el.parentNode.insertBefore(x, el);\n\
    window.scrollTo(0,1000000);\n\
}\n\
\n\
function inputDOM() {\n\
    var x = document.createElement("INPUT");\n\
    x.style.display = "inline";\n\
    x.style.fontFamily = "courier";\n\
    x.style.fontSize = "100%";\n\
    x.style.width = "60%";\n\
    x.style.border = "0px none"; \n\
    x.style.outline = "0"; // WebKit fix\n\
    OutTo.appendChild(x);\n\
    x.focus();    \n\
    // now history part...\n\
    var history_back = function history_back (e) {\n\
        if(e.keyCode == 38) { // up\n\
            CH.set(x.value);\n\
            CH.index++;\n\
            x.value = CH.get();\n\
        } else if (e.keyCode == 40) { // down            \n\
            CH.set(x.value);\n\
            CH.index--;\n\
            x.value = CH.get();\n\
        } else if (e.keyCode == 9) { // tab\n\
            var v=x.value.split(" ").pop();\n\
            if(v.charAt(0) == "/" || v.charAt(0) == "~") {\n\
                // now get data\n\
                var lURI=v.split("/");\n\
                var oname = lURI.pop();\n\
                var oparent = lURI.join("/");\n\
                x.style.backgroundColor="#e6e6e6";\n\
                try {\n\
                    var ldata = execURI(oparent, "listChildren", [], 2000);\n\
                    //var ss = "/"+ldata.join("/\\n/")+"/";\n\
                    var ss = ldata.join("\\n");\n\
                    if(oname.length > 0) {\n\
                        var re = new RegExp("^("+oname+".+)", "gm");\n\
                        var m = ss.match(re);\n\
                        //var m = re.exec(ss);\n\
                        if(m && m.length == 1) {\n\
                            x.value = x.value.replace(v, oparent+"/"+m[0]);\n\
                        } else if (m && m.length > 1) {\n\
                            insertCurrent(x, m.join(" "));\n\
                        } else {\n\
                            //insertCurrent(x, ss);\n\
                        }\n\
                    } else {\n\
                        insertCurrent(x, ss);\n\
                    }\n\
                } catch (e) {\n\
                    ErrorConsole.log(e); // todo remove this\n\
                }\n\
                x.style.backgroundColor="white"; // TBD: "normal" color?\n\
            }\n\
        }\n\
    };\n\
    x.addEventListener("keydown", history_back, false, true);\n\
    \n\
    // ----\n\
    \n\
    \n\
    do { // the loop is entirely unnesessary here\n\
        e = x.waitEvent("keydown", 0, {"keyCode": [13, 9]}, true); // will temporarily bind an event to the node and wait for it (bind_dom method)\n\
                                     // this should be used with caution: there is no event queue for the object and it may miss some events\n\
    } while (e.keyCode != 13)\n\
    \n\
    x.removeEventListener("keydown", history_back);\n\
    x.readOnly=true;\n\
    var x2 = document.createElement("DIV");\n\
    x2.style.display = "inline";\n\
    x2.style.fontFamily = "courier";\n\
    var v = x.value;\n\
    var t = document.createTextNode(v);\n\
    x2.appendChild(t);\n\
    x.parentNode.replaceChild(x2,x);\n\
    CH.add(v);\n\
    brDOM();\n\
    return v;\n\
}\n\
\n\
\n\
function editDOM(txt) {\n\
    if(typeof txt == "undefined") txt = "";\n\
    var x = document.createElement("DIV");\n\
    x.style.display = "inline";\n\
    x.style.fontFamily = "courier";\n\
    x.style.outline = "0";\n\
    x.contentEditable = true;\n\
    var t = document.createTextNode(txt);\n\
    x.appendChild(t);\n\
    OutTo.appendChild(x);\n\
    x.focus();\n\
    //do {\n\
        e = x.waitEvent("keydown",0, {"keyCode": 13, "ctrlKey" : true }); // will temporarily bind an event to the node and wait for it (bind_dom method)\n\
                                     // this should be used with caution: there is no event queue for the object and it may miss some events\n\
    //} while ( !( e.keyCode == 13 && e.ctrlKey == true) )\n\
    x.contentEditable = false;\n\
    var s = x.innerHTML;\n\
    s = s.replace(/<br>|<\\/p>/g, "\\n"); // no other tags are allowed\n\
    s = s.replace(/&gt;/g, ">"); // no other special chars allowed\n\
    s = s.replace(/&lt;/g, "<");\n\
    s = s.replace(/&nbsp;|<p>/g, " ");\n\
    s = s.replace(/&amp;/g, "&");\n\
    return s;\n\
}\n\
\n\
function execChild(childPath, progPath, argv) {\n\
    // TODO: killChild ;-)\n\
    try {\n\
        object.execURI(childPath, "__ic_main", [argv]); // start in a thread??\n\
    } catch (e) {\n\
        printDOM("ic#: exception at main() in "+progPath+" (progId: "+childPath + ") - delete stale object manually!"); brDOM(); // TODO HERE\n\
        printDOM(":: "+e); brDOM();\n\
    }\n\
    \n\
}\n\
\n\
function set_param_box (el) {\n\
    el.style.border="1px dotted white";\n\
    el.style.width = "100%";\n\
    el.onmouseover = param_box_on;\n\
    el.onmouseout = param_box_off;\n\
    var d = document.createElement("DIV");\n\
    //d.innerHTML = "<button>X</button>";\n\
    \n\
    el.appendChild(d);\n\
    //need more fixes for FF, Opera, others.. for \'float\' tag\n\
    d.style.cssFloat = "right";// TODO: need to fix IE!\n\
    d.style.styleFloat = "right";// this is IE way! DOC: currenty we dont fix css\n\
    d.style.visibility = "hidden";\n\
    \n\
    d.innerHTML = "x";\n\
    d.style.cursor = "pointer";\n\
    d.style.fontFamily = "arial";\n\
    d.style.fontSize = "10px";\n\
    d.style.paddingRight = "5px";\n\
    \n\
    d.onclick = close_click;\n\
    \n\
    el.closeButton = d;\n\
    d.onmouseover = param_box_on;\n\
    d.onmouseout = param_box_off;\n\
}\n\
function close_click(e) {\n\
    if(this.parentNode.prog) {\n\
        try {\n\
            if(conform_st) execURI("~/run", "deleteChild", [this.parentNode.prog]);\n\
            else object.deleteChild(this.parentNode.prog);\n\
        } catch (e) {\n\
            ErrorConsole.log("IC: failed to remove child: "+e);\n\
        }\n\
    }\n\
    //if(this.parentNode.onmouseout)\n\
        this.parentNode.parentNode.removeChild(this.parentNode);\n\
}\n\
function param_box_on(e) {\n\
    if(this.closeButton && this != this.parentNode.lastChild) { \n\
        this.style.borderColor = "#c0c0c0";\n\
        this.closeButton.style.visibility="visible";\n\
    } \n\
}\n\
\n\
function param_box_off(e) {\n\
    if(this.closeButton) { \n\
        //if((e.relatedTarget != null) && (e.target != null)) ErrorConsole.log(e.target.compareDocumentPosition(e.relatedTarget));\n\
        if((e.relatedTarget != null) && (e.target != null) && !(e.target.compareDocumentPosition(e.relatedTarget) & 0x10)) {\n\
            this.style.borderColor = "white";\n\
            this.closeButton.style.visibility="hidden";\n\
        }\n\
    } \n\
}\n\
\n\
//document.body.innerHTML = "";\n\
box = document.createElement("DIV");\n\
set_param_box(box);\n\
document.body.appendChild(box);\n\
OutTo = box;\n\
crun = object.kconfig("run")\n\
if(!crun) printDOM("Welcome to ic# - an Interactive Commandline. Type \'help\' for help.");\n\
brDOM();\n\
// TODO: write Google Gears hint - if not detected\n\
/*\n\
if(!object.FixedStorage && !crun)\n\
{  \n\
    printDOM("Google Gears not installed. Reduced functionality mode. Please check http://gears.google.com/");\n\
    brDOM();\n\
}\n\
*/\n\
// IC# will try to act like an installer when finds there is no \'~/run\' object\n\
conform_st = false; // conform to ST (security terminal)\n\
if(object.getMySecurityURI() == "~/security/terminal") {\n\
    try {\n\
        l = execURI("~/run", "listChildren", [], 5000);\n\
        conform_st = true;\n\
    } catch(e){\n\
        if(e.toString().indexOf("found") != -1) {\n\
            // try to install\n\
            try {\n\
                execURI("~", "createChild", ["run", "~/sys/tmpstore", "~/sys/anarchic"], 20000);\n\
                execURI("~", "createChild", ["insecure", "~/sys/tmpstore", "~/sys/anarchic"], 20000);\n\
                conform_st = true;\n\
            } catch (e) {\n\
                printDOM("Could not initialize default security-terminal launch environment, falling back to old-fashioned way");\n\
            }\n\
        }\n\
    }\n\
}\n\
\n\
pc = 0;\n\
initIPCLock.release(); // = false; // ready for IPC...\n\
var s,c,p1, p2;\n\
\n\
if(crun) {\n\
    try {\n\
        c = crun;\n\
        var xd = document.createElement("DIV");\n\
        xd.style.width="100%";\n\
        xd.style.fontSize="100%";\n\
        OutTo.appendChild(xd);    \n\
        pfx = "~/run/";\n\
        pname = c.split("/")[c.split("/").length-1];\n\
        OutTo.prog = pname;\n\
        if(conform_st) {\n\
            execURI("~/run", "createChild", [pname, c, "~/sys/anarchic", xd]);\n\
            start_new_thread(function() {execURI(pfx+pname, "securitySet", [{"ipcIn": {"*":["*"]}}], 50000)});\n\
        }\n\
        else object.createChild(pname, c, "~/sys/anarchic", xd); \n\
        var pid = start_new_thread(execChild, [pfx+pname, c, []]); // use pid?? use argv??\n\
    } catch (e) {\n\
        printDOM("Failed to execute initial program from "+c+" : "+e); brDOM();\n\
    }\n\
}\n\
\n\
while(true) {\n\
    box = document.createElement("DIV");\n\
    set_param_box(box);\n\
    document.body.appendChild(box);\n\
    OutTo = box;\n\
    printDOM("ic# ");\n\
    s = inputDOM();\n\
    s = s.split("<br>")[0]; // wipe out system BREAK\n\
    c = s.split(" ")[0];\n\
    switch(c) {\n\
      case "exit":\n\
        printDOM("quitting...");\n\
        object.destroyInstance(); // or process.destroy()? XXX renaimng proposed\n\
        break;\n\
      case "help":\n\
        // TODO: move this to ic.doc or \'ichelp\' program\n\
        printDOM("URI locations:");\n\
        brDOM();\n\
        printDOM("  ~ current terminal; . current object; / hub root; .. parent of current object; default /");\n\
        brDOM();      \n\
        printDOM("built-in commands: for others see /bin");\n\
        brDOM();\n\
        printDOM("  ls <URI> - try to list children of the object at <URI>. Example: ls ~/sys");\n\
        brDOM();\n\
        printDOM("  cat <URI> - try to read() the object at <URI> as if it was a ramstore-like object.");\n\
        brDOM();\n\
        printDOM("  typeto <URI> - write() the text typed next, to specified <URI> ramstore object, create if nesessary. You may also type to another ic# console: like typeto /mycomp/console");\n\
        brDOM();\n\
        printDOM("  delete <URI> - call deleteChild on ramstore");\n\
        brDOM();\n\
        printDOM("  copy <From-URI> <To-URI> - perform a bytecopy of a ramstore");\n\
        brDOM();\n\
        printDOM("  link <What-URI> <As-URI> - link an object URI creating a \'link\' child at <As-URI>");\n\
        brDOM();\n\
        printDOM("  terminal_register <name> <password> <email@address> - register a terminal at HUB");\n\
        brDOM();\n\
        printDOM("  terminal_auth <name> <password>  - authenticate a terminal at HUB");\n\
        brDOM();\n\
        printDOM("  terminal_logout - deauthenticate a terminal at HUB");\n\
        brDOM();\n\
        printDOM("  version - print detailed system version information");\n\
        brDOM();\n\
\n\
         \n\
        // write() IPC method: used to notify of events; HUB Connected: termname; HUB connection lost\n\
        // readlog - show ErrorConsole log; ping URI - time the exception callback periodically\n\
        // set ... - set various ic# parameters: write allow, app search PATH\n\
        // xedit - highlighting text editor; determine filetype by name/ext or by mimetype, if any returned\n\
        break;\n\
      case "version":\n\
        printDOM("Version ic# 0.0.1 pre-alpha; registered as "+object.getMyAbsoluteURI() + "; Running on kernel version "+object.version);\n\
        brDOM();\n\
        break;\n\
      case "ls":\n\
        if( s.split(" ")[1] ) p1 = s.split(" ")[1];\n\
        else p1 = "~";\n\
        // TODO!!! p1 = s.split(" ")[1] || p1; does not work (evals to bool) for unknown reason!\n\
        try {\n\
            ldata = execURI(p1, "listChildren", [], 10000);\n\
            printDOM("List of objects at \'"+p1+"\':"); brDOM();\n\
            for(var i=0; i<ldata.length; i++) {\n\
                printDOM(ldata[i]); brDOM();\n\
            }\n\
        } catch (e) {\n\
            printDOM("ls: fetch failed with: "+e); brDOM();\n\
        }\n\
        break;\n\
      case "cat":\n\
        p1 = s.split(" ")[1];\n\
        if(!p1) {\n\
            printDOM("cat: not enough arguments"); brDOM();\n\
            break;\n\
        }\n\
        try {\n\
            data = execURI(p1, "read", [], 10000);\n\
            preDOM(data);\n\
        } catch (e) {\n\
            printDOM("cat: fetch failed with: "+e); brDOM();\n\
        }     \n\
        break;   \n\
      case "rm":\n\
      case "delete":\n\
        p1 = s.split(" ")[1];\n\
        if(!p1) {\n\
            printDOM("delete: not enough arguments"); brDOM();\n\
            break;\n\
        }\n\
        try {\n\
                lURI=p1.split("/");\n\
                oname = lURI[(lURI.length-1)];\n\
                lURI.pop();\n\
                oparent = lURI.join("/");\n\
                //printDOM("Creating "+oname+" at "+oparent); brDOM();\n\
                execURI(oparent, "deleteChild", [oname], 10000);\n\
                //printDOM("object deleted"); brDOM();\n\
        } catch (e) {\n\
            printDOM("delete: failed with: "+e); brDOM();\n\
        }     \n\
        break;   \n\
\n\
      case "typeto":\n\
        p1 = s.split(" ")[1];\n\
        if(!p1) {\n\
            printDOM("typeto: not enough arguments"); brDOM();\n\
            break;\n\
        }\n\
\n\
        printDOM("Input text; type CTRL-Enter to stop:"); brDOM();\n\
        p2 = editDOM(">");\n\
        brDOM();\n\
 \n\
        try {\n\
            execURI(p1, "write", [p2], 20000);\n\
        } catch (e) {\n\
            if(e.toString().indexOf("not found") == -1) {\n\
                printDOM("typeto: write() failed with: "+e); brDOM();\n\
                break;\n\
            }\n\
            try {\n\
                // get name and get parent\n\
                lURI=p1.split("/");\n\
                oname = lURI[(lURI.length-1)];\n\
                lURI.pop();\n\
                oparent = lURI.join("/");\n\
                //printDOM("Creating "+oname+" at "+oparent); brDOM();\n\
                execURI(oparent, "createChild", [oname, "~/sys/ramstore", "~/sys/anarchic"], 20000);\n\
                execURI(p1, "write", [p2], 20000);\n\
            } catch (e) {\n\
                printDOM("typeto: failed with: "+e); brDOM();\n\
            }\n\
        }     \n\
\n\
        \n\
        break;\n\
      case "copy":\n\
        p1 = s.split(" ")[1];\n\
        p2 = s.split(" ")[2];\n\
        if(!p1 || !p2) {\n\
            printDOM("copy: not enough parameters"); brDOM();\n\
            break;\n\
        }\n\
\n\
        try {\n\
            data = execURI(p1, "read", [], 10000);\n\
        } catch (e) {\n\
            printDOM("copy: object read failed with: "+e); brDOM();\n\
            break;\n\
        }\n\
        \n\
        try {\n\
            execURI(p2, "write", [data], 20000); // TODO: inefficient: will send full request then fail and resend...\n\
        } catch (e) {\n\
            printDOM("copy: trying to create new ramstore"); brDOM();\n\
            try {\n\
                lURI=p2.split("/");\n\
                oname = lURI[(lURI.length-1)];\n\
                lURI.pop();\n\
                oparent = lURI.join("/");\n\
                execURI(oparent, "createChild", [oname, "~/sys/ramstore", "~/sys/anarchic"], 10000);\n\
                execURI(p2, "write", [data], 10000);\n\
            } catch (e) {\n\
                printDOM("typeto: failed with: "+e); brDOM();\n\
            }\n\
        }     \n\
\n\
        \n\
        break;\n\
      case "link":\n\
        p1 = s.split(" ")[1];\n\
        p2 = s.split(" ")[2];\n\
        if(!p1 || !p2) {\n\
            printDOM("link: not enough parameters"); brDOM();\n\
            break;\n\
        }\n\
        \n\
        lURI=p2.split("/");\n\
        oname = lURI[(lURI.length-1)];\n\
        lURI.pop();\n\
        oparent = lURI.join("/");\n\
        \n\
        try {\n\
            execURI(oparent, "addAsChild", [ oname, p1], 10000);\n\
        } catch (e) {\n\
            printDOM("link: object link failed with: "+e); brDOM();\n\
            break;\n\
        }\n\
        \n\
        break;\n\
\n\
      case "terminal_register":\n\
        p1 = s.split(" ")[1];\n\
        p2 = s.split(" ")[2];\n\
        var p3 = s.split(" ")[3]; // TODO: need multi-word support. like braces or smth?\n\
        if(!p3) p3 = "";\n\
        if(!p1 || !p2 || !p3) {\n\
            printDOM("register: not enough parameters"); brDOM();\n\
            break;\n\
        }\n\
        \n\
        \n\
        try {\n\
            execURI("/", "register", [ p1, p2, p3 ], 20000);\n\
        } catch (e) {\n\
            printDOM("register: failed with: "+e); brDOM();\n\
            break; // does not break out...\n\
        }\n\
        printDOM("register OK"); brDOM();\n\
        break;\n\
\n\
\n\
      case "terminal_auth":\n\
        p1 = s.split(" ")[1];\n\
        p2 = s.split(" ")[2];\n\
        if(!p1 || !p2 ) {\n\
            printDOM("auth: not enough parameters"); brDOM();\n\
            break;\n\
        }\n\
        \n\
        \n\
        try {\n\
            execURI("~", "auth", [ p1, p2 ], 20000);\n\
        } catch (e) {\n\
            printDOM("auth: failed with: "+e); brDOM();\n\
            break; // does not break out...\n\
        }\n\
        printDOM("auth OK"); brDOM();\n\
        break;\n\
\n\
      case "terminal_logout":\n\
        try {\n\
            execURI("~", "logout", [ ], 20000);\n\
        } catch (e) {\n\
            printDOM("logout: failed with: "+e); brDOM();\n\
            break; // does not break out...\n\
        }\n\
        printDOM("logout OK"); brDOM();\n\
      \n\
      \n\
      case "":\n\
        break;\n\
      \n\
      default:\n\
        // TODO: search for commands at PATH?\n\
        argv = s.split(" ");\n\
        //p1.shift(); // pass a full array to main\n\
\n\
        try {\n\
            \n\
            if(conform_st) {\n\
                pname_orig = c.split("/")[c.split("/").length-1];\n\
                pname = pname_orig;\n\
                pfx = "~/run/";\n\
                var padd = 1;\n\
                var allprogs = execURI("~/run", "listChildren", []);\n\
                for(var j=0;j<allprogs.length;j++) {\n\
                    if(allprogs[j] == pname) {\n\
                        pname = pname_orig+padd;\n\
                        padd++;\n\
                        j=0;\n\
                    }\n\
                }\n\
            } else {\n\
                pc++;\n\
                pname = p+pc;\n\
                pfx = "./";\n\
            }\n\
            var xd = document.createElement("DIV");\n\
            xd.style.width="100%";\n\
            xd.style.fontSize="100%";\n\
            OutTo.appendChild(xd);    \n\
            OutTo.prog = pname;\n\
            \n\
            if(c.charAt(0) == "/" || c.charAt(0) == "~") {\n\
                if(conform_st) execURI("~/run", "createChild", [pname, c, "~/sys/anarchic", xd]);\n\
                else object.createChild(pname, c, "~/sys/anarchic", xd); \n\
            }\n\
            else {\n\
                var try_paths = ["~/bin/", "/bin/", "/jeneric.net/bin/"];\n\
                for(var k=0; k<try_paths.length; k++) {\n\
                    lc = try_paths[k]+c;\n\
                    try {\n\
                        if(conform_st) execURI("~/run", "createChild", [pname, lc, "~/sys/anarchic", xd]);\n\
                        else object.createChild(pname, lc, "~/sys/anarchic", xd); \n\
                        c = lc;\n\
                        ok = true;\n\
                        break;\n\
                    } catch (e) {\n\
                        // do nothing\n\
                    }\n\
                }\n\
                if(k == try_paths.length) throw "not found by URI";\n\
                  \n\
            }    \n\
            // now set security to allow-everything-in\n\
            if(conform_st) {\n\
                start_new_thread(function() {execURI(pfx+pname, "securitySet", [{"ipcIn": {"securitySet": [], "securityGet": [], "*": ["*"]}}], 50000)}); // never allow to fail...\n\
            }\n\
            \n\
            var pid = start_new_thread(execChild, [pfx+pname, c, argv]); // use pid??\n\
\n\
        } catch (e) {\n\
            if(e && e.toString().indexOf("found") > -1) { // + defeat undefiend exception bug\n\
                printDOM("ic#: command not found by path: "+c); brDOM();\n\
                break;               \n\
            } else {\n\
                printDOM("ic#: another error: "+e); brDOM();\n\
                break; \n\
            }\n\
            \n\
        }\n\
\n\
        \n\
    }\n\
}\n\
',"os/totinit.jn": '// LICENSE: GPL v.3 or later (C) 2010 Andrew Gryaznov realgrandrew@gmail.com, a.gryaznov@svoyaset.ru\n\
// total init for jeneric project\n\
// initIPCLock = true; // XXX not needed since security DOES NOT set initIPCLock to false by itself!\n\
\n\
// initialize the serializer\n\
// create the serializer daemon threads\n\
\n\
s_working = false;\n\
\n\
function do_serialize_all() {\n\
        if(s_working) return; // many race conditions\n\
        \n\
        s_working = true; // is not even atomic\n\
        var i = 0;\n\
        for(var j = 0; j<object.getSerializeLength(); j++) {\n\
            suri = object.getSerializeObj(i); // to not check every 5 secs...\n\
            while (suri) {\n\
                    try {\n\
                        ErrorConsole.log("s_agent: saving "+suri);\n\
                        object.serializeURI(suri, true);\n\
                        // if success\n\
                        //ErrorConsole.log("s_agent: success, deleting "+suri);\n\
                        object.delSerializeObj(suri);\n\
                    } catch (e) {\n\
                        ErrorConsole.log("requested serialization of \'"+suri+"\' failed with exception: "+e);\n\
                    }\n\
                    //ErrorConsole.log("s_agent: now doing for "+i);\n\
                    suri = object.getSerializeObj(++i);\n\
            }\n\
        }\n\
        s_working = false;\n\
}\n\
\n\
\n\
function s_agent() {\n\
    ErrorConsole.log("Starting s_agent");\n\
    var suri, i;\n\
    while(true) {\n\
        // swapout is done automatically... so we only need to periodically serialize\n\
        // TODO: watch for fails\n\
        // TODO: \'release\' priorititzation\n\
        // rename the conventions: \'weak\' is object to be released, \'save\' is object to be serialized\n\
        if(!s_working) do_serialize_all();\n\
        sleep(object.kconfig("saveinterval")); // 5-second interval?\n\
    }\n\
}\n\
\n\
// now run init tasks from ~/conf/init ramdir\n\
// DOC this\n\
initdir = object.kconfig("initdir") ? object.kconfig("initdir") : "~/conf/init";\n\
console.log("initdir is: "+object.kconfig("initdir"));\n\
objs = [];\n\
try {\n\
    objs = execURI(initdir, "listChildren", []);\n\
} catch (e) {\n\
    ErrorConsole.log("totinit: running "+initdir+" : "+e);\n\
}\n\
\n\
var i=0;\n\
for(i=0; i<objs.length; i++) {\n\
    object.createChild(objs[i], initdir+"/"+objs[i], "~/sys/anarchic", document.body); \n\
}\n\
\n\
// the workaround for working init + ic as default init\n\
if(i == 0) {\n\
    // TODO: IC# should not come in kernel distribution; load it dynamically!\n\
    //        either from server or from locally stored object in /var...\n\
    ErrorConsole.log("totinit: nothing to run! launching reserved IC#");\n\
\n\
    object.createChild("console", "~/sys/ic", "~/sys/anarchic", document.body);\n\
    start_new_thread(function() {execURI("./console", "securitySet", [{"ipcIn": {"write":["*"]}}], 50000)});\n\
}\n\
// and finally create init folder and this init at /sys/init location (folder-store!!)\n\
\n\
// first, set autorestore to true\n\
function start_s_agent ( rq ) {\n\
    if(object.serializeURI) {\n\
        object.kconfig("autorestore", true); // currently se assume that (de)serialization is always preferrable\n\
        object.kconfig("autoswapout", true);\n\
        start_new_thread(s_agent);\n\
        object.register_serializer(do_serialize_all); // does not actually work very well: requires another normal timeout pass for newly created ramstores\n\
    } else {\n\
        ErrorConsole.log("not starting s_agent; no serialization available");\n\
    }\n\
}\n\
\n\
object.ipc["start_s_agent"] = start_s_agent;\n\
\n\
initIPCLock.release();// = false;\n\
',"os/terminal.jn": '// LICENSE: GPL v.3 or later (C) 2010 Andrew Gryaznov realgrandrew@gmail.com, a.gryaznov@svoyaset.ru\n\
\n\
function _ipc_createObject(rq, name, typeURI, secURI, DOMElement) {\n\
    // TODO TODO: security here - watch for rq - only sys rq is allowed!\n\
    // now, do get the code\n\
    code = execURI(typeURI, "read", []);\n\
    sec = execURI(secURI, "read", []);\n\
    // WARNING! potential security issue here! -> typeURI&secURI may be altered by an object...\n\
    //          this needs a rewrite!\n\
    return __createObject(name, code, sec, rq.object_uri, typeURI, secURI, DOMElement); // will now create the wrapper object; attached to DOM\n\
}\n\
object.ipc["createObject"] = _ipc_createObject;\n\
\n\
\n\
function ipc_listChildren(rq) {\n\
    return object.enumerateChildren(); // will return an Array object\n\
}\n\
object.ipc["listChildren"] = ipc_listChildren;\n\
\n\
// now methods for child object creation\n\
function ipc_addAsChild(rq, name, uri) {\n\
    // add as child the object of uri URI named name\n\
    object.linkChild(name, uri);\n\
    object.serialize();\n\
}\n\
\n\
function ipc_createChild(rq, name, type, sec) {\n\
    object.createChild(name, type, sec); // create without any DOM binding!! (of course)\n\
    object.serialize();\n\
}\n\
\n\
function ipc_deleteChild(rq, name) {\n\
    object.deleteChild(name);\n\
    object.serialize();\n\
}\n\
object.ipc["addAsChild"] = ipc_addAsChild;\n\
object.ipc["createChild"] = ipc_createChild;\n\
object.ipc["deleteChild"] = ipc_deleteChild;\n\
\n\
function ipc_hubConnectionChanged(rq, name) {\n\
    // set the kconfig terminal_id value. Nothing else seems to be required \n\
    object.kconfig("terminal_id", name);\n\
}\n\
object.ipc["hubConnectionChanged"] = ipc_hubConnectionChanged;\n\
\n\
\n\
function ipc_authterminal(rq, name, key) {\n\
    execURI("/", "auth", [ name, key ], 20000);\n\
    // all went ok..\n\
    object.kconfig("terminal_id", name);\n\
    object.kconfig("terminal_key", key);\n\
}\n\
object.ipc["auth"] = ipc_authterminal;\n\
\n\
function ipc_logout_terminal(rq) {\n\
    execURI("/", "logout", [ ], 20000);\n\
    // all went ok..\n\
    //object.kconfig("terminal_id", );\n\
    object.kconfig("terminal_key", null);\n\
}\n\
object.ipc["logout"] = ipc_logout_terminal;\n\
\n\
\n\
initIPCLock.release();// = false;\n\
\n\
ErrorConsole.log("creating dom DIV");\n\
xd = document.createElement("DIV");\n\
xd.style.width="100%";\n\
xd.style.fontSize="100%";\n\
document.body.appendChild(xd);\n\
xd.appendChild(document.createTextNode("starting..."));\n\
\n\
\n\
/*\n\
\n\
terminal: \n\
  - run init from KCONFIG - typically some home autorun script. \n\
  - if failed, run init2 from KCONFIG \n\
  - ~/var/init\n\
//  - /sys/ic \n\
  - ~/sys/ic - ic is a basic software piece available in any configuration as a ramstore object code\n\
\n\
*/\n\
\n\
// XXX SECURITY MODEL!!\n\
ok = 0;\n\
/*try {\n\
    ok = object.createChild("init", object.kconfig("init"), "~/sys/anarchic", xd);\n\
} catch (e) {\n\
    try {\n\
        ok = object.createChild("init", object.kconfig("init2"), "~/sys/anarchic", xd);\n\
    } catch (e) {\n\
        // TODO: error reporting here!!! in case SMTH not available, etc! //  TODO: TEST it without sleep!\n\
*/\n\
        try {\n\
            ok = object.createChild("init", "~/sys/init", "~/sys/anarchic", xd); // XXX or /var/init??\n\
        } catch (e) {\n\
            ok = object.createChild("init", "~/sys/ic", "~/sys/anarchic", xd); // this may not fail\n\
        }\n\
/*\n\
    }\n\
}\n\
*/\n\
if(ok) {\n\
    // XXX maybe bind terminal to init?\n\
    object.kbind("init", ["bind_serial"], ["autorestore", "saveinterval", "autoswapout"], ["autorestore", "autoswapout"]);\n\
    object.execURI("./init", "start_s_agent", []);\n\
    xd.removeChild(xd.firstChild);\n\
} else {\n\
    ErrorConsole.log("PANIC: could not start init. Try passing init= kernel parameter.");\n\
}\n\
\n\
// TODO: do announce with new credentials if the hubConnectionChanged hook is received\n\
//       this is rather a terminal issue!\n\
'};