Updating orion-plugin-HEAD.js to the latest protocol
diff --git a/resources/orion/orion-plugin-HEAD.js b/resources/orion/orion-plugin-HEAD.js
new file mode 100644
index 0000000..68874c6
--- /dev/null
+++ b/resources/orion/orion-plugin-HEAD.js
@@ -0,0 +1,95 @@
+if(!window.OpenAjax){OpenAjax=new function(){var a=this.hub={};a.implementer="http://openajax.org";a.implVersion="2.0.3";a.specVersion="2.0";a.implExtraData={};var b={};a.libraries=b;a.registerLibrary=function(c,j,r,g){b[c]={prefix:c,namespaceURI:j,version:r,extraData:g};this.publish("org.openajax.hub.registerLibrary",b[c])};a.unregisterLibrary=function(c){this.publish("org.openajax.hub.unregisterLibrary",b[c]);delete b[c]}};OpenAjax.hub.Error={BadParameters:"OpenAjax.hub.Error.BadParameters",Disconnected:"OpenAjax.hub.Error.Disconnected",
+Duplicate:"OpenAjax.hub.Error.Duplicate",NoContainer:"OpenAjax.hub.Error.NoContainer",NoSubscription:"OpenAjax.hub.Error.NoSubscription",NotAllowed:"OpenAjax.hub.Error.NotAllowed",WrongProtocol:"OpenAjax.hub.Error.WrongProtocol"};OpenAjax.hub.SecurityAlert={LoadTimeout:"OpenAjax.hub.SecurityAlert.LoadTimeout",FramePhish:"OpenAjax.hub.SecurityAlert.FramePhish",ForgedMsg:"OpenAjax.hub.SecurityAlert.ForgedMsg"};OpenAjax.hub._debugger=function(){};OpenAjax.hub.ManagedHub=function(a){if(!a||!a.onPublish||
+!a.onSubscribe)throw Error(OpenAjax.hub.Error.BadParameters);this._p=a;this._onUnsubscribe=a.onUnsubscribe?a.onUnsubscribe:null;this._scope=a.scope||window;if(a.log){var b=this;this._log=function(c){try{a.log.call(b._scope,"ManagedHub: "+c)}catch(j){OpenAjax.hub._debugger()}}}else this._log=function(){};this._subscriptions={c:{},s:null};this._containers={};this._seq=0;this._active=true;this._isPublishing=false;this._pubQ=[]};OpenAjax.hub.ManagedHub.prototype.subscribeForClient=function(a,b,c){this._assertConn();
+if(this._invokeOnSubscribe(b,a))return this._subscribe(b,this._sendToClient,this,{c:a,sid:c});throw Error(OpenAjax.hub.Error.NotAllowed);};OpenAjax.hub.ManagedHub.prototype.unsubscribeForClient=function(a,b){this._unsubscribe(b);this._invokeOnUnsubscribe(a,b)};OpenAjax.hub.ManagedHub.prototype.publishForClient=function(a,b,c){this._assertConn();this._publish(b,c,a)};OpenAjax.hub.ManagedHub.prototype.disconnect=function(){this._active=false;for(var a in this._containers)this.removeContainer(this._containers[a])};
+OpenAjax.hub.ManagedHub.prototype.getContainer=function(a){return(a=this._containers[a])?a:null};OpenAjax.hub.ManagedHub.prototype.listContainers=function(){var a=[],b;for(b in this._containers)a.push(this._containers[b]);return a};OpenAjax.hub.ManagedHub.prototype.addContainer=function(a){this._assertConn();var b=a.getClientID();if(this._containers[b])throw Error(OpenAjax.hub.Error.Duplicate);this._containers[b]=a};OpenAjax.hub.ManagedHub.prototype.removeContainer=function(a){var b=a.getClientID();
+if(!this._containers[b])throw Error(OpenAjax.hub.Error.NoContainer);a.remove();delete this._containers[b]};OpenAjax.hub.ManagedHub.prototype.subscribe=function(a,b,c,j,r){this._assertConn();this._assertSubTopic(a);if(!b)throw Error(OpenAjax.hub.Error.BadParameters);if(this._invokeOnSubscribe(a,null)){c=c||window;var g=this;a=this._subscribe(a,function(l,k,d,e){if(g._invokeOnPublish(l,k,e,null))try{b.call(c,l,k,r)}catch(n){OpenAjax.hub._debugger();g._log("caught error from onData callback to Hub.subscribe(): "+
+n.message)}},c,r);this._invokeOnComplete(j,c,a,true);return a}else this._invokeOnComplete(j,c,null,false,OpenAjax.hub.Error.NotAllowed)};OpenAjax.hub.ManagedHub.prototype.publish=function(a,b){this._assertConn();this._assertPubTopic(a);this._publish(a,b,null)};OpenAjax.hub.ManagedHub.prototype.unsubscribe=function(a,b,c){this._assertConn();if(!a)throw Error(OpenAjax.hub.Error.BadParameters);this._unsubscribe(a);this._invokeOnUnsubscribe(null,a);this._invokeOnComplete(b,c,a,true)};OpenAjax.hub.ManagedHub.prototype.isConnected=
+function(){return this._active};OpenAjax.hub.ManagedHub.prototype.getScope=function(){return this._scope};OpenAjax.hub.ManagedHub.prototype.getSubscriberData=function(a){this._assertConn();a=a.split(".");var b=a.pop();if(a=this._getSubscriptionObject(this._subscriptions,a,0,b))return a.data;throw Error(OpenAjax.hub.Error.NoSubscription);};OpenAjax.hub.ManagedHub.prototype.getSubscriberScope=function(a){this._assertConn();a=a.split(".");var b=a.pop();if(a=this._getSubscriptionObject(this._subscriptions,
+a,0,b))return a.scope;throw Error(OpenAjax.hub.Error.NoSubscription);};OpenAjax.hub.ManagedHub.prototype.getParameters=function(){return this._p};OpenAjax.hub.ManagedHub.prototype._sendToClient=function(a,b,c,j){this.isConnected()&&this._invokeOnPublish(a,b,j,c.c)&&c.c.sendToClient(a,b,c.sid)};OpenAjax.hub.ManagedHub.prototype._assertConn=function(){if(!this.isConnected())throw Error(OpenAjax.hub.Error.Disconnected);};OpenAjax.hub.ManagedHub.prototype._assertPubTopic=function(a){if(!a||a===""||a.indexOf("*")!=
+-1||a.indexOf("..")!=-1||a.charAt(0)=="."||a.charAt(a.length-1)==".")throw Error(OpenAjax.hub.Error.BadParameters);};OpenAjax.hub.ManagedHub.prototype._assertSubTopic=function(a){if(!a)throw Error(OpenAjax.hub.Error.BadParameters);a=a.split(".");for(var b=a.length,c=0;c<b;c++){var j=a[c];if(j===""||j.indexOf("*")!=-1&&j!="*"&&j!="**")throw Error(OpenAjax.hub.Error.BadParameters);if(j=="**"&&c<b-1)throw Error(OpenAjax.hub.Error.BadParameters);}};OpenAjax.hub.ManagedHub.prototype._invokeOnComplete=
+function(a,b,c,j,r){if(a)try{b=b||window;a.call(b,c,j,r)}catch(g){OpenAjax.hub._debugger();this._log("caught error from onComplete callback: "+g.message)}};OpenAjax.hub.ManagedHub.prototype._invokeOnPublish=function(a,b,c,j){try{return this._p.onPublish.call(this._scope,a,b,c,j)}catch(r){OpenAjax.hub._debugger();this._log("caught error from onPublish callback to constructor: "+r.message)}return false};OpenAjax.hub.ManagedHub.prototype._invokeOnSubscribe=function(a,b){try{return this._p.onSubscribe.call(this._scope,
+a,b)}catch(c){OpenAjax.hub._debugger();this._log("caught error from onSubscribe callback to constructor: "+c.message)}return false};OpenAjax.hub.ManagedHub.prototype._invokeOnUnsubscribe=function(a,b){if(this._onUnsubscribe){var c=b.slice(0,b.lastIndexOf("."));try{this._onUnsubscribe.call(this._scope,c,a)}catch(j){OpenAjax.hub._debugger();this._log("caught error from onUnsubscribe callback to constructor: "+j.message)}}};OpenAjax.hub.ManagedHub.prototype._subscribe=function(a,b,c,j){var r=a+"."+this._seq;
+b={scope:c,cb:b,data:j,sid:this._seq++};this._recursiveSubscribe(this._subscriptions,a.split("."),0,b);return r};OpenAjax.hub.ManagedHub.prototype._recursiveSubscribe=function(a,b,c,j){var r=b[c];if(c==b.length){j.next=a.s;a.s=j}else{if(typeof a.c=="undefined")a.c={};if(typeof a.c[r]=="undefined")a.c[r]={c:{},s:null};this._recursiveSubscribe(a.c[r],b,c+1,j)}};OpenAjax.hub.ManagedHub.prototype._publish=function(a,b,c){if(this._isPublishing)this._pubQ.push({t:a,d:b,p:c});else for(this._safePublish(a,
+b,c);this._pubQ.length>0;){a=this._pubQ.shift();this._safePublish(a.t,a.d,a.p)}};OpenAjax.hub.ManagedHub.prototype._safePublish=function(a,b,c){this._isPublishing=true;this._recursivePublish(this._subscriptions,a.split("."),0,a,b,c);this._isPublishing=false};OpenAjax.hub.ManagedHub.prototype._recursivePublish=function(a,b,c,j,r,g){if(typeof a!="undefined"){if(c==b.length)a=a;else{this._recursivePublish(a.c[b[c]],b,c+1,j,r,g);this._recursivePublish(a.c["*"],b,c+1,j,r,g);a=a.c["**"]}if(typeof a!="undefined")for(a=
+a.s;a;){b=a.scope;c=a.cb;var l=a.data;if(typeof c=="string")c=b[c];c.call(b,j,r,l,g);a=a.next}}};OpenAjax.hub.ManagedHub.prototype._unsubscribe=function(a){a=a.split(".");var b=a.pop();if(!this._recursiveUnsubscribe(this._subscriptions,a,0,b))throw Error(OpenAjax.hub.Error.NoSubscription);};OpenAjax.hub.ManagedHub.prototype._recursiveUnsubscribe=function(a,b,c,j){if(typeof a=="undefined")return false;if(c<b.length){var r=a.c[b[c]];if(!r)return false;this._recursiveUnsubscribe(r,b,c+1,j);if(!r.s){for(var g in r.c)return true;
+delete a.c[b[c]]}}else{b=a.s;c=null;for(r=false;b;){if(j==b.sid){r=true;if(b==a.s)a.s=b.next;else c.next=b.next;break}c=b;b=b.next}if(!r)return false}return true};OpenAjax.hub.ManagedHub.prototype._getSubscriptionObject=function(a,b,c,j){if(typeof a!="undefined"){if(c<b.length)return this._getSubscriptionObject(a.c[b[c]],b,c+1,j);for(a=a.s;a;){if(j==a.sid)return a;a=a.next}}return null};OpenAjax.hub._hub=new OpenAjax.hub.ManagedHub({onSubscribe:function(){return true},onPublish:function(){return true}});
+OpenAjax.hub.subscribe=function(a,b,c,j){if(typeof b==="string"){c=c||window;b=c[b]||null}return OpenAjax.hub._hub.subscribe(a,b,c,null,j)};OpenAjax.hub.unsubscribe=function(a){return OpenAjax.hub._hub.unsubscribe(a)};OpenAjax.hub.publish=function(a,b){OpenAjax.hub._hub.publish(a,b)};OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","2.0",{})}if(typeof OpenAjax==="undefined")window.OpenAjax={};if(typeof OpenAjax.hub==="undefined")window.OpenAjax.hub={};
+(function(){function a(){if(!l){b("unload",function(){g=true},false);l=true}}function b(d,e,n){if(window.addEventListener)window.addEventListener(d,e,n);else window.attachEvent&&window.attachEvent("on"+d,e)}function c(d,e,n){window.removeEventListener?window.removeEventListener(d,e,n):window.detachEvent("on"+d,e)}function j(){if(!k){var d=window.postMessage?"PM":window.ActiveXObject?"NIX":"FIM";k=new OpenAjax.hub.IframeContainer["_"+d];k.type=d}return k}function r(d,e,n,t){if(!OpenAjax.hub.IframeContainer._prng){var s=
+(new Date).getTime()+Math.random()+document.cookie;OpenAjax.hub.IframeContainer._prng=OpenAjax._smash.crypto.newPRNG(s)}if((d=d.IframeContainer||d.IframeHubClient)&&d.seed)try{var f=d.seed.call(e);OpenAjax.hub.IframeContainer._prng.addSeed(f)}catch(q){OpenAjax.hub._debugger();n("caught error from 'seed' callback: "+q.message)}return OpenAjax.hub.IframeContainer._prng.nextRandomB64Str(t||d&&d.tokenLength||6)}OpenAjax.hub.IframeContainer=function(d,e,n){function t(o,w){y.sendMsg(u,{m:o,i:u,r:"..",t:v,
+p:w})}function s(){if(C&&F){B=true;clearTimeout(E);document.getElementById(u).style.visibility="visible";t("con_ack",null);if(n.Container.onConnect)try{n.Container.onConnect.call(x,p)}catch(o){OpenAjax.hub._debugger();D("caught error from onConnect callback to constructor: "+o.message)}}}function f(){if(B){B=false;document.getElementById(u).style.visibility="hidden";for(var o in z)d.unsubscribeForClient(p,z[o]);z={}}}function q(){B&&!g&&h(OpenAjax.hub.SecurityAlert.FramePhish)}function h(o){try{n.Container.onSecurityAlert.call(x,
+p,o)}catch(w){OpenAjax.hub._debugger();D("caught error from onSecurityAlert callback to constructor: "+w.message)}}function m(){E=setTimeout(function(){h(OpenAjax.hub.SecurityAlert.LoadTimeout);p.receiveMsg=function(){}},H)}if(!d||!e||!n||!n.Container||!n.Container.onSecurityAlert||!n.IframeContainer||!n.IframeContainer.parent||!n.IframeContainer.uri||!n.IframeContainer.tunnelURI)throw Error(OpenAjax.hub.Error.BadParameters);var p=this,x=n.Container.scope||window,B=false,F=false,C=false,z={},I,v,
+u,y,H=n.IframeContainer.timeout||15E3,E,D=n.Container.log?function(o){try{n.Container.log.call(x,"IframeContainer::"+e+": "+o)}catch(w){OpenAjax.hub._debugger()}}:function(){};this._init=function(){d.addContainer(this);y=j();for(var o=e;OpenAjax.hub.IframeContainer._containers[o];)o+="_"+(32767*Math.random()|0).toString(16);OpenAjax.hub.IframeContainer._containers[o]=this;u=o;v=r(n,x,D,y.type==="FIM"?6:null);o={receiver:this,receiverId:u,securityToken:v,uri:n.IframeContainer.uri,tunnelURI:n.IframeContainer.tunnelURI,
+log:D};if(e!==u)o.name=e;y.addReceiver(o);o=document.createElement("iframe");o.id=u;o.name=u;var w=n.IframeContainer.iframeAttrs;if(w)for(var A in w)switch(A){case "id":case "name":D("Ignoring 'id' or 'name' property in 'iframeAttrs' -- these attributes on the iframe are used for internal purposes.");break;case "style":for(var G in w.style)o.style[G]=w.style[G];break;default:o[A]=w[A]}o.style.visibility="hidden";o.src='javascript:"<html></html>"';n.IframeContainer.parent.appendChild(o);o.src=y.getURI();
+n.IframeContainer.parent=null;y.postAdd(u,document.getElementById(u));m()};this.sendToClient=function(o,w,A){t("pub",{t:o,d:w,s:A})};this.remove=function(){f();y.removeReceiver(u);clearTimeout(E);J(u)};this.isConnected=function(){return B};this.getClientID=function(){return e};this.getPartnerOrigin=function(){if(B)return I;return null};this.getParameters=function(){return n};this.getHub=function(){return d};this.getIframe=function(){return document.getElementById(u)};this.transportReady=function(o,
+w,A,G){if(A)I=G.partnerOrigin;else G.securityAlert&&h(G.securityAlert)};this.receiveMsg=function(o){switch(o.m){case "pub":d.publishForClient(this,o.p.t,o.p.d);break;case "sub":var w="";try{z[o.p.s]=d.subscribeForClient(this,o.p.t,o.p.s)}catch(A){w=A.message}t("sub_ack",{s:o.p.s,e:w});break;case "uns":d.unsubscribeForClient(this,z[o.p.s]);delete z[o.p.s];t("uns_ack",{s:o.p.s});break;case "con":F=true;s();break;case "dis":m();f();t("dis_ack",null);if(n.Container.onDisconnect)try{n.Container.onDisconnect.call(x,
+this)}catch(G){OpenAjax.hub._debugger();D("caught error from onDisconnect callback to constructor: "+G.message)}}};this.securityAlert=function(o){h(o)};var J=function(){return navigator.appName==="Microsoft Internet Explorer"?function(o){var w=document.getElementById(o);w.onreadystatechange=function(){if(w.readyState=="complete"){w.onreadystatechange=null;w.outerHTML="";w=null}};w.src=""}:function(o){o=document.getElementById(o);o.parentNode.removeChild(o)}}();this._tunnelLoaded=function(o){o.onunload=
+q;C=true;a();s()};this._init()};OpenAjax.hub.IframeHubClient=function(d){function e(){if(!h)throw Error(OpenAjax.hub.Error.Disconnected);}function n(v,u){I.sendMsg("..",{m:v,i:B,t:F,p:u})}function t(v){try{d.HubClient.onSecurityAlert.call(f,s,v)}catch(u){OpenAjax.hub._debugger();z("caught error from onSecurityAlert callback to constructor: "+u.message)}}if(!d||!d.HubClient||!d.HubClient.onSecurityAlert)throw Error(OpenAjax.hub.Error.BadParameters);var s=this,f=d.HubClient.scope||window,q=false,h=
+false,m={},p=0,x,B,F,C,z=d.HubClient.log?function(v){try{d.HubClient.log.call(f,"IframeHubClient::"+x+": "+v)}catch(u){OpenAjax.hub._debugger()}}:function(){},I;this._init=function(){I=j();F=r(d,f,z,I.type==="FIM"?6:null);x=I.addReceiver({receiver:this,receiverId:"..",securityToken:F,log:z});if(!x)throw Error(OpenAjax.hub.Error.WrongProtocol);};this.connect=function(v,u){u=u||window;if(h)throw Error(OpenAjax.hub.Error.Duplicate);if(v)this._connectCallback={func:v,scope:u};if(q)n("con",null);else this._connectPending=
+true};this.disconnect=function(v,u){u=u||window;if(!h)throw Error(OpenAjax.hub.Error.Disconnected);h=false;if(v)this._disconnectCallback={func:v,scope:u};n("dis",null)};this.getPartnerOrigin=function(){if(h)return C;return null};this.getClientID=function(){return x};this.subscribe=function(v,u,y,H,E){e();if(!v)throw Error(OpenAjax.hub.Error.BadParameters);for(var D=v.split("."),J=D.length,o=0;o<J;o++){var w=D[o];if(w===""||w.indexOf("*")!=-1&&w!="*"&&w!="**")throw Error(OpenAjax.hub.Error.BadParameters);
+if(w=="**"&&o<J-1)throw Error(OpenAjax.hub.Error.BadParameters);}if(!u)throw Error(OpenAjax.hub.Error.BadParameters);y=y||window;D=""+p++;m[D]={cb:u,sc:y,d:E,oc:H};n("sub",{t:v,s:D});return D};this.publish=function(v,u){e();if(!v||v===""||v.indexOf("*")!=-1||v.indexOf("..")!=-1||v.charAt(0)=="."||v.charAt(v.length-1)==".")throw Error(OpenAjax.hub.Error.BadParameters);n("pub",{t:v,d:u})};this.unsubscribe=function(v,u,y){e();if(!v)throw Error(OpenAjax.hub.Error.BadParameters);if(!m[v]||m[v].uns)throw Error(OpenAjax.hub.Error.NoSubscription);
+y=y||window;m[v].uns={cb:u,sc:y};n("uns",{s:v})};this.isConnected=function(){return h};this.getScope=function(){return f};this.getSubscriberData=function(v){e();if(m[v])return m[v].d;throw Error(OpenAjax.hub.Error.NoSubscription);};this.getSubscriberScope=function(v){e();if(m[v])return m[v].sc;throw Error(OpenAjax.hub.Error.NoSubscription);};this.getParameters=function(){return d};this.transportReady=function(v,u,y,H){if(y){B=v;C=H.partnerOrigin;q=true;if(this._connectPending){delete this._connectPending;
+n("con",null)}}else H.securityAlert&&t(H.securityAlert)};this.receiveMsg=function(v){var u,y;switch(v.m){case "pub":u=v.p.s;if(m[u]&&!m[u].uns)try{m[u].cb.call(m[u].sc,v.p.t,v.p.d,m[u].d)}catch(H){OpenAjax.hub._debugger();z("caught error from onData callback to subscribe(): "+H.message)}break;case "sub_ack":u=v.p.s;if(y=m[u].oc)try{delete m[u].oc;y.call(m[u].sc,u,v.p.e==="",v.p.e)}catch(E){OpenAjax.hub._debugger();z("caught error from onComplete callback to subscribe(): "+E.message)}break;case "uns_ack":u=
+v.p.s;if(m[u]){if(y=m[u].uns.cb)try{y.call(m[u].uns.sc,u,true)}catch(D){OpenAjax.hub._debugger();z("caught error from onComplete callback to unsubscribe(): "+D.message)}delete m[u]}break;case "con_ack":h=true;if(this._connectCallback){try{this._connectCallback.func.call(this._connectCallback.scope,this,true)}catch(J){OpenAjax.hub._debugger();z("caught error from onComplete callback to connect(): "+J.message)}delete this._connectCallback}break;case "dis_ack":if(this._disconnectCallback){try{this._disconnectCallback.func.call(this._disconnectCallback.scope,
+this,true)}catch(o){OpenAjax.hub._debugger();z("caught error from onComplete callback to disconnect(): "+o.message)}delete this._disconnectCallback}}};this.securityAlert=function(v){t(v)};this._init()};OpenAjax.hub.IframeContainer._containers={};OpenAjax.hub.IframeContainer._tunnelLoaded=function(){var d=j().tunnelLoaded();window.parent.parent.OpenAjax.hub.IframeContainer._containers[d]._tunnelLoaded(window)};OpenAjax.hub.IframeContainer._queryURLParam=function(d){if(d=RegExp("[\\?&]"+d+"=([^&#]*)").exec(window.location.search))return decodeURIComponent(d[1].replace(/\+/g,
+"%20"));return null};OpenAjax.hub.IframeContainer._createTunnelIframe=function(d){var e=document.createElement("iframe");e.src=d;document.body.appendChild(e);e.style.position="absolute";e.style.left=e.style.top="-10px";e.style.height=e.style.width="1px";e.style.visibility="hidden"};OpenAjax.hub.IframeContainer._getTargetWin=function(d){if(typeof d==="undefined"||d==="..")return window.parent;d=String(d);var e=window.frames[d];if(e)return e;if((e=document.getElementById(d))&&e.contentWindow)return e.contentWindow;
+return null};var g=false,l=false,k;OpenAjax.hub.IframeContainer._PM=function(){function d(){function h(p){if(p.data=="postmessage.test"){m=true;if(typeof p.origin==="undefined")s+="d"}}s="";var m=false;b("message",h,false);window.postMessage("postmessage.test","*");if(m)s+="s";c("message",h,false)}function e(){f=s.indexOf("s")===-1?function(h,m,p){h.postMessage(m,p)}:function(h,m,p){setTimeout(function(){h.postMessage(m,p)},0)}}function n(h){if(s.indexOf("d")!==-1)return/^.+:\/\/([^:]+).*/.exec(h)[1];
+return h}var t={},s,f,q;b("message",function(h){try{var m=JSON.parse(h.data),p=m.r||m.i;if(typeof p!=="undefined")if(t[p])t[p].m!==(h.origin||h.domain)?t[p].r.securityAlert(OpenAjax.hub.SecurityAlert.ForgedMsg):t[p].r.receiveMsg(m);else typeof m.m!=="undefined"&&typeof m.p!=="undefined"&&t[".."].r.securityAlert(OpenAjax.hub.SecurityAlert.ForgedMsg)}catch(x){}},false);this.addReceiver=function(h){var m;t[h.receiverId]={r:h.receiver};if(h.receiverId===".."){var p=OpenAjax.hub.IframeContainer._queryURLParam("oahpv");
+if(!p||p!=="openajax-2.0.2")return null;var x=OpenAjax.hub.IframeContainer._queryURLParam("oahu"),B=OpenAjax.hub.IframeContainer._queryURLParam("oahi"),F=OpenAjax.hub.IframeContainer._queryURLParam("oahn");p=OpenAjax.hub.IframeContainer._queryURLParam("oaht");if(!B||!p||!x)return null;s=OpenAjax.hub.IframeContainer._queryURLParam("oahpm");e();var C=/^([a-zA-Z]+:\/\/[^\/?#]+).*/.exec(x)[1];t[".."].o=C;t[".."].m=n(C);var z="oahi="+encodeURIComponent(B)+"&oaht="+p;x=x.split("#");x[0]=x[0]+(x[0].indexOf("?")!=
+-1?"&":"?")+z;x=x.length===1?x[0]:x[0]+"#"+x[1];OpenAjax.hub.IframeContainer._createTunnelIframe(x);m={partnerOrigin:/^([a-zA-Z]+:\/\/[^:]+).*/.exec(C)[1],securityToken:p};setTimeout(function(){h.receiver.transportReady(B,F,true,m)},0);return F||B}if(typeof s==="undefined"){d();e()}C=/^([a-zA-Z]+:\/\/[^\/?#]+).*/.exec(h.uri)[1];t[h.receiverId].o=C;t[h.receiverId].m=n(C);m={partnerOrigin:/^([a-zA-Z]+:\/\/[^:]+).*/.exec(C)[1]};setTimeout(function(){h.receiver.transportReady(h.receiverId,h.name,true,
+m)},0);z="oahpv="+encodeURIComponent("openajax-2.0.2")+"&oahi="+encodeURIComponent(h.receiverId)+(h.name?"&oahn="+encodeURIComponent(h.name):"")+"&oaht="+h.securityToken+"&oahu="+encodeURIComponent(h.tunnelURI)+"&oahpm="+s;x=h.uri.split("#");x[0]=x[0]+(x[0].indexOf("?")!=-1?"&":"?")+z;q=x.length===1?x[0]:x[0]+"#"+x[1];return null};this.getURI=function(){return q};this.postAdd=function(){};this.sendMsg=function(h,m){if(t[h]){var p=OpenAjax.hub.IframeContainer._getTargetWin(h);f(p,JSON.stringify(m),
+t[h].o)}return true};this.tunnelLoaded=function(){return OpenAjax.hub.IframeContainer._queryURLParam("oahi")};this.removeReceiver=function(h){delete t[h]}}})();
+OpenAjax.hub.IframeContainer._FIM=function(){function a(l,k){this.messageReceived=function(d){var e={i:l},n=new g.SECommMessage;n.deserialize(d);switch(n.type){case g.SECommMessage.PUBLISH:case g.SECommMessage.DISTRIBUTE:e.m="pub";if(n.additionalHeader){e.p={t:n.topic,d:n.payload};if(n.additionalHeader.f==="J")e.p.d=JSON.parse(n.payload);if(n.type===g.SECommMessage.DISTRIBUTE)e.p.s=n.additionalHeader.s}break;case g.SECommMessage.SUBSCRIBE:e.m="sub";if(n.additionalHeader)e.p={t:n.topic,s:n.additionalHeader.subId};
+break;case g.SECommMessage.SUBSCRIBE_ACK:e.m="sub_ack";if(n.additionalHeader)e.p={s:n.additionalHeader.subId,e:n.additionalHeader.isOk?"":n.additionalHeader.err};break;case g.SECommMessage.UNSUBSCRIBE:e.m="uns";if(n.additionalHeader)e.p={s:n.additionalHeader.subId};break;case g.SECommMessage.UNSUBSCRIBE_ACK:e.m="uns_ack";if(n.additionalHeader)e.p={s:n.additionalHeader.subId};break;case g.SECommMessage.CONNECT:e.m="con";break;case g.SECommMessage.CONNECT_ACK:e.m="con_ack";break;case g.SECommMessage.DISCONNECT:e.m=
+"dis";break;case g.SECommMessage.DISCONNECT_ACK:e.m="dis_ack"}b[l].r.receiveMsg(e)};this.initializationFinished=function(d,e,n,t,s,f,q){s=j[l];var h=b[l],m={partnerOrigin:/^([a-zA-Z]+:\/\/[^\/?#:]+).*/.exec(n)[1]};if(l==="..")m.debug=q;else{if(t!==h.tok||n!==h.uri){this.handleSecurityError(g.SecurityErrors.TOKEN_VERIFICATION_FAILED);return false}k("Tunnel commLib initialization finished. Processing outgoing queue. Security token: "+t);s.lib=f}for(s.initialized=true;s.queueOut.length>0;)s.lib.send(s.queueOut.shift());
+h.r.transportReady(d,e,true,m);return true};this.handleSecurityError=function(){b[l].r.securityAlert(OpenAjax.hub.SecurityAlert.ForgedMsg)};this.log=function(d){k(d)}}var b={},c={},j={},r;OpenAjax.hub.IframeContainer._FIM.instances=c;this.addReceiver=function(l){b[l.receiverId]={r:l.receiver};j[l.receiverId]={initialized:false,queueOut:[],lib:null};if(l.receiverId===".."){var k=window.location.href.split("#");if(k[1]){var d=k[1].split(":",3),e=d[0];if(e!==g._protocolID)l=null;else{k=k[0]+"#"+k[1].substring(e.length+
+1);window.location.replace(k);g._clientSecurityToken=l.securityToken;c[".."]=new a("..",l.log);j[".."].lib=new g.CommLib(true,c);l=decodeURIComponent(d[2])}}else l=null;return l}c[l.receiverId]=new a(l.receiverId,l.log);b[l.receiverId].tok=l.securityToken;b[l.receiverId].uri=l.uri;d=l.name||l.receiverId;r=l.uri+"#"+g._protocolID+":100"+l.securityToken+l.securityToken+"000"+encodeURIComponent(l.receiverId)+":"+encodeURIComponent(d)+":"+encodeURIComponent(l.tunnelURI);return null};this.getURI=function(){return r};
+this.postAdd=function(){return true};this.sendMsg=function(l,k){var d=new g.SECommMessage;switch(k.m){case "con":d.type=g.SECommMessage.CONNECT;d.payload=window.location.href.split("#")[0];break;case "con_ack":d.type=g.SECommMessage.CONNECT_ACK;break;case "dis":d.type=g.SECommMessage.DISCONNECT;break;case "dis_ack":d.type=g.SECommMessage.DISCONNECT_ACK;break;case "pub":if(k.p.s){d.type=g.SECommMessage.DISTRIBUTE;d.additionalHeader={s:k.p.s}}else{d.type=g.SECommMessage.PUBLISH;d.additionalHeader={}}d.topic=
+k.p.t;if(typeof k.p.d==="string"){d.additionalHeader.f="S";d.payload=k.p.d}else{d.additionalHeader.f="J";d.payload=JSON.stringify(k.p.d)}break;case "sub":d.type=g.SECommMessage.SUBSCRIBE;d.topic=k.p.t;d.additionalHeader={subId:k.p.s};break;case "sub_ack":d.type=g.SECommMessage.SUBSCRIBE_ACK;d.additionalHeader={subId:k.p.s,isOk:k.p.e==="",err:k.p.e};break;case "uns":d.type=g.SECommMessage.UNSUBSCRIBE;d.additionalHeader={subId:k.p.s};break;case "uns_ack":d.type=g.SECommMessage.UNSUBSCRIBE_ACK;d.additionalHeader=
+{subId:k.p.s}}var e=j[l];e.initialized?e.lib.send(d.serialize()):e.queueOut.push(d.serialize());return true};this.tunnelLoaded=function(){new g.CommLib(false,window.parent.parent.OpenAjax.hub.IframeContainer._FIM.instances);var l=window.location.href.split("#")[1];return decodeURIComponent(l.substring(g._securityTokenOverhead+6).split(":")[0])};this.removeReceiver=function(l){delete b[l];delete j[l];delete c[l]};if(typeof OpenAjax._smash=="undefined")OpenAjax._smash={};var g=OpenAjax._smash;g._protocolID=
+"openajax-2.0.2";g._securityTokenLength=6;g._securityTokenOverhead=null;g._computeOtherTokenConstants=function(){g._securityTokenOverhead=2*g._securityTokenLength};g._computeOtherTokenConstants();g.SecurityErrors={INVALID_TOKEN:0,TOKEN_VERIFICATION_FAILED:1,TUNNEL_UNLOAD:2,COMPONENT_LOAD:3};g.SECommMessage=function(){this.payload=this.additionalHeader=this.topic=this.type=null;this.serialize=function(){var l="y="+this.type;if(this.topic!=null){var k=encodeURIComponent(this.topic);l+="&t="+k}if(this.additionalHeader!=
+null){k=encodeURIComponent(JSON.stringify(this.additionalHeader));l+="&h="+k}if(this.payload!=null){k=encodeURIComponent(this.payload);l+="&p="+k}return l};this.deserialize=function(l){l=l.split("&");for(var k=0;k<l.length;k++){var d=l[k].split("=");switch(d[0]){case "y":this.type=d[1];break;case "t":this.topic=decodeURIComponent(d[1]);break;case "h":d=decodeURIComponent(d[1]);this.additionalHeader=JSON.parse(d);break;case "p":this.payload=decodeURIComponent(d[1])}}}};g.SECommMessage.CONNECT="con";
+g.SECommMessage.CONNECT_ACK="cac";g.SECommMessage.DISCONNECT="xcon";g.SECommMessage.DISCONNECT_ACK="xac";g.SECommMessage.PUBLISH="pub";g.SECommMessage.DISTRIBUTE="dis";g.SECommMessage.SUBSCRIBE="sub";g.SECommMessage.UNSUBSCRIBE="uns";g.SECommMessage.SUBSCRIBE_ACK="sac";g.SECommMessage.UNSUBSCRIBE_ACK="uac";g.SECommMessage.ERROR="err";g.CommLib=function(l,k){function d(){if(p.type==n)return true;if(p.msn==q.ackMsn&&q.ack==1)return true;e("Waiting for ACK : "+p.msn);return false}function e(o){if(E){for(;D.length>
+0;)E.log(D.shift());E.log(o)}else D.push(o)}var n="2",t=this,s=0,f=null,q=null,h=null,m=null,p=null,x=null,B=null,F=[],C=0,z="",I=null,v=null,u=null,y=null,H=null,E=null,D=[],J=false;this.send=function(o){if(x==null)e("Trying to send without proper initialization. Message will be discarded. "+o);else{e("Sending: "+o);var w=3994-g._securityTokenOverhead-x.length;for(o=o;o.length>0;){var A=o.substr(0,w);o=o.substr(w);o==0?F.push({type:"4",payload:A}):F.push({type:"3",payload:A})}}};I=setInterval(function(){var o;
+a:{o=window.location.href.split("#");if(o.length==2){o=o[1];if(o!=""&&o!=f){f=o;o=true;break a}}o=false}if(o){o=f.substr(0,1);var w=f.substr(1,2),A=3,G=f.substr(A,g._securityTokenLength);A+=g._securityTokenLength;var K=f.substr(A,g._securityTokenLength);A+=g._securityTokenLength;var L=f.substr(A,1);A+=1;var M=f.substr(A,2);A+=2;A=f.substr(A);e("In : Type: "+o+" msn: "+w+" tokenParent: "+G+" tokenChild: "+K+" ack: "+L+" msn: "+M+" payload: "+A);q={type:o,msn:w,tokenParent:G,tokenChild:K,ack:L,ackMsn:M,
+payload:A};if(q.type!="1"&&(q.tokenParent!=v||q.tokenChild!=u)){e("Security token error: Invalid security token received. The message will be discarded.");o=g.SecurityErrors.INVALID_TOKEN;clearInterval(I);E.handleSecurityError(o);o=false}else o=true;if(o){s=1;q.type!="1"&&l&&p.type=="1"&&q.ack=="1"&&p.msn==q.ackMsn&&E.initializationFinished(y,H,x,v,u,null,J);switch(q.type){case "1":o=q.payload.split(":");y=decodeURIComponent(o[0]);H=decodeURIComponent(o[1]);x=decodeURIComponent(o[2]);v=q.tokenParent;
+u=q.tokenChild;if(l){u=g._clientSecurityToken;w=document.createElement("iframe");G=encodeURIComponent(window.location.href.split("#")[0]);G=encodeURIComponent(y)+":"+encodeURIComponent(H)+":"+G;w.src=x+"#100"+v+u+"100"+G;w.name="3827816c-f3b1-11db-8314-0800200c9a66";w.id="3827816c-f3b1-11db-8314-0800200c9a66";document.body.appendChild(w);w.style.position="absolute";w.style.left=w.style.top="-10px";w.style.height=w.style.width="1px";w.style.visibility="hidden";s=0;B=window.frames["3827816c-f3b1-11db-8314-0800200c9a66"];
+p={type:"1",msn:"00",tokenParent:v,tokenChild:u,ack:"0",ackMsn:"00",payload:G};E=k[".."];J=o[3]&&o[3]==="debug"}else{B=window.parent;E=k[y];E.initializationFinished(y,H,x,v,u,t)||(s=0);p={type:"1",msn:"00",tokenParent:v,tokenChild:u,ack:"0",ackMsn:"00",payload:encodeURIComponent(y)+":"+encodeURIComponent(H)+":"+encodeURIComponent(window.location.href.split("#")[0])}}B==null&&e("Init failed.");break;case n:s=0;break;case "3":z+=q.payload;break;case "4":z+=q.payload;e("Received: "+z);E.messageReceived(z);
+z=""}h=q}}if(d()){F.length==0&&s==1&&F.push({type:n,payload:""});if(F.length!=0){m=F.shift();m.tokenParent=v;m.tokenChild=u;o=m;C++;if(C==100)C=0;w=C<10?"0"+C:""+C;o.msn=w;m.ack="1";m.ackMsn=h.msn;s=0;B.location.replace(x+"#"+m.type+m.msn+m.tokenParent+m.tokenChild+m.ack+m.ackMsn+m.payload);p=m;e("Out: Type: "+m.type+" msn: "+m.msn+" tokenParent: "+m.tokenParent+" tokenChild: "+m.tokenChild+" ack: "+m.ack+" msn: "+m.ackMsn+" payload: "+m.payload)}}},100)}};
+OpenAjax.hub.IframeContainer._NIX=function(){function a(){var f=k[".."].nix_channel;if(!f)if(++d>g)c("..",false,"nix");else{if(!f&&window.opener&&"GetAuthToken"in window.opener){f=window.opener;var q=b("..");if(f.GetAuthToken()==q){f.CreateChannel(window[r]("..",q),q);k[".."].nix_channel=f;window.opener=null;c("..",true,"nix");return}}window.setTimeout(function(){a()},l)}}function b(f){if(!k[f].authToken&&f==="..")k[".."].authToken=OpenAjax.hub.IframeContainer._queryURLParam("oaht");return k[f].authToken}
+function c(f,q,h,m){if(k[f]){var p=k[f],x=f===".."?OpenAjax.hub.IframeContainer._queryURLParam("oahi"):f;if(q){p["ready_"+h]=true;if(p.ready_nix&&p.ready_fim){B={partnerOrigin:k[f].partnerOrigin};p.r.transportReady(x,null,true,B)}}else{var B;if(m)B={securityAlert:m};p.r.transportReady(x,null,false,B)}}}function j(){var f=window.location.href.split("#");if(f.length===2){clearInterval(s);s=null;f[1]===k[".."].childAuthToken?c("..",true,"fim"):c("..",false,"fim","OpenAjax.hub.SecurityAlert.FramePhish")}}
+var r="GRPC____NIXVBS_get_wrapper",g=10,l=500,k={},d=0,e;if(typeof window[r]!=="unknown"){window.GRPC____NIXVBS_handle_message=function(f){window.setTimeout(function(){var q=JSON.parse(f),h=q.r||q.i;if(k[h])b(h)!==q.t?k[h].r.securityAlert(OpenAjax.hub.SecurityAlert.ForgedMsg):k[h].r.receiveMsg(q)},0)};window.GRPC____NIXVBS_create_channel=function(f,q,h){if(b(f)===h){k[f].nix_channel=q;c(f,true,"nix")}};var n="Class GRPC____NIXVBS_wrapper\n Private m_Intended\nPrivate m_Auth\nPublic Sub SetIntendedName(name)\n If isEmpty(m_Intended) Then\nm_Intended = name\nEnd If\nEnd Sub\nPublic Sub SetAuth(auth)\n If isEmpty(m_Auth) Then\nm_Auth = auth\nEnd If\nEnd Sub\nPublic Sub SendMessage(data)\n GRPC____NIXVBS_handle_message(data)\nEnd Sub\nPublic Function GetAuthToken()\n GetAuthToken = m_Auth\nEnd Function\nPublic Sub CreateChannel(channel, auth)\n Call GRPC____NIXVBS_create_channel(m_Intended, channel, auth)\nEnd Sub\nEnd Class\nFunction "+
+r+"(name, auth)\nDim wrap\nSet wrap = New GRPC____NIXVBS_wrapper\nwrap.SetIntendedName name\nwrap.SetAuth auth\nSet "+r+" = wrap\nEnd Function";try{window.execScript(n,"vbscript")}catch(t){throw Error("Failed to create NIX VBScript object");}}this.addReceiver=function(f){k[f.receiverId]={r:f.receiver};if(f.receiverId===".."){var q;q=OpenAjax.hub.IframeContainer._queryURLParam("oahpv");if(!q||q!=="openajax-2.0.2")q=null;else{a();q=OpenAjax.hub.IframeContainer._queryURLParam("oahi");var h=OpenAjax.hub.IframeContainer._queryURLParam("oahn"),
+m=b(".."),p=f.securityToken;f=OpenAjax.hub.IframeContainer._queryURLParam("oahu");if(!q||!m||!f)q=null;else{k[".."].childAuthToken=p;k[".."].partnerOrigin=/^([a-zA-Z]+:\/\/[^\/?#:]+).*/.exec(f)[1];m="oahi="+encodeURIComponent(q)+"&oaht1="+m+"&oaht2="+p+"&oahu="+encodeURIComponent(window.location.href);f=f.split("#");f[0]=f[0]+(f[0].indexOf("?")!=-1?"&":"?")+m;OpenAjax.hub.IframeContainer._createTunnelIframe(f.length===1?f[0]:f[0]+"#"+f[1]);s=setInterval(j,100);q=h||q}}return q}k[f.receiverId].authToken=
+f.securityToken;q="oahpv="+encodeURIComponent("openajax-2.0.2")+"&oahi="+encodeURIComponent(f.receiverId)+(f.name?"&oahn="+encodeURIComponent(f.name):"")+"&oaht="+f.securityToken+"&oahu="+encodeURIComponent(f.tunnelURI);h=f.uri.split("#");h[0]=h[0]+(h[0].indexOf("?")!=-1?"&":"?")+q;e=h.length===1?h[0]:h[0]+"#"+h[1];return null};this.getURI=function(){return e};this.postAdd=function(f){try{var q=window[r](f,k[f].authToken);OpenAjax.hub.IframeContainer._getTargetWin(f).opener=q}catch(h){return false}return true};
+this.sendMsg=function(f,q){if(f==="..")q.t=k[f].authToken;try{k[f]&&k[f].nix_channel.SendMessage(JSON.stringify(q))}catch(h){return false}return true};this.tunnelLoaded=function(){var f=OpenAjax.hub.IframeContainer._queryURLParam("oahi"),q=OpenAjax.hub.IframeContainer._queryURLParam("oaht1"),h=OpenAjax.hub.IframeContainer._queryURLParam("oaht2"),m=OpenAjax.hub.IframeContainer._queryURLParam("oahu");window.parent.parent.OpenAjax.hub.IframeContainer._NIX._receiveTunnelMsg(f,q,h,m);return f};this.removeReceiver=
+function(f){delete k[f];if(f==="..")if(s){clearInterval(s);s=null}};OpenAjax.hub.IframeContainer._NIX._receiveTunnelMsg=function(f,q,h,m){if(k[f].authToken!==q)c(f,false,"fim","OpenAjax.hub.SecurityAlert.FramePhish");else{document.getElementById(f).src=m+"#"+h;k[f].partnerOrigin=/^([a-zA-Z]+:\/\/[^\/?#:]+).*/.exec(m)[1];c(f,true,"fim")}};var s};if(typeof OpenAjax._smash=="undefined")OpenAjax._smash={};
+OpenAjax._smash.crypto={strToWA:function(a,b){for(var c=[],j=(1<<b)-1,r=0;r<a.length*b;r+=b)c[r>>5]|=(a.charCodeAt(r/b)&j)<<32-b-r%32;return c},hmac_sha1:function(a,b,c){for(var j=Array(16),r=Array(16),g=0;g<16;g++){j[g]=a[g]^909522486;r[g]=a[g]^1549556828}a=this.sha1(j.concat(this.strToWA(b,c)),512+b.length*c);return this.sha1(r.concat(a),672)},newPRNG:function(a){function b(l){l=c.hmac_sha1(j,l,8);for(var k=0;k<5;k++)r[k]^=l[k]}var c=this;if(typeof a!="string"||a.length<12)alert("WARNING: Seed length too short ...");
+var j=[43417,15926,18182,33130,9585,30800,49772,40144,47678,55453,4659,38181,65340,6787,54417,65301],r=[],g=0;b(a);return{addSeed:function(l){b(l)},nextRandomOctets:function(l){for(var k=[];l>0;){g+=1;var d=c.hmac_sha1(r,g.toString(16),8);for(i=0;i<20&l>0;i++,l--)k.push((d[i>>2]>>i%4)%256)}return k},nextRandomB64Str:function(l){for(var k=this.nextRandomOctets(l),d="",e=0;e<l;e++)d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(k[e]&63);return d}}},sha1:function(){var a=
+function(b,c){var j=(b&65535)+(c&65535);return(b>>16)+(c>>16)+(j>>16)<<16|j&65535};return function(b,c){b[c>>5]|=128<<24-c%32;b[(c+64>>9<<4)+15]=c;for(var j=Array(80),r=1732584193,g=-271733879,l=-1732584194,k=271733878,d=-1009589776,e=0;e<b.length;e+=16){for(var n=r,t=g,s=l,f=k,q=d,h=0;h<80;h++){j[h]=h<16?b[e+h]:(j[h-3]^j[h-8]^j[h-14]^j[h-16])<<1|(j[h-3]^j[h-8]^j[h-14]^j[h-16])>>>31;var m=n<<5|n>>>27,p;p=h<20?t&s|~t&f:h<40?t^s^f:h<60?t&s|t&f|s&f:t^s^f;m=a(a(m,p),a(a(q,j[h]),h<20?1518500249:h<40?1859775393:
+h<60?-1894007588:-899497514));q=f;f=s;s=t<<30|t>>>2;t=n;n=m}r=a(n,r);g=a(t,g);l=a(s,l);k=a(f,k);d=a(q,d)}return[r,g,l,k,d]}}()};this.JSON||(JSON={});
+(function(){function a(e){return e<10?"0"+e:e}function b(e){r.lastIndex=0;return r.test(e)?'"'+e.replace(r,function(n){var t=k[n];return typeof t==="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function c(e,n){var t,s,f,q,h=g,m,p=n[e];if(p&&typeof p==="object"&&typeof p.toJSON==="function")p=p.toJSON(e);if(typeof d==="function")p=d.call(n,e,p);switch(typeof p){case "string":return b(p);case "number":return isFinite(p)?String(p):"null";case "boolean":case "null":return String(p);
+case "object":if(!p)return"null";g+=l;m=[];if(Object.prototype.toString.apply(p)==="[object Array]"){q=p.length;for(t=0;t<q;t+=1)m[t]=c(t,p)||"null";f=m.length===0?"[]":g?"[\n"+g+m.join(",\n"+g)+"\n"+h+"]":"["+m.join(",")+"]";g=h;return f}if(d&&typeof d==="object"){q=d.length;for(t=0;t<q;t+=1){s=d[t];if(typeof s==="string")if(f=c(s,p))m.push(b(s)+(g?": ":":")+f)}}else for(s in p)if(Object.hasOwnProperty.call(p,s))if(f=c(s,p))m.push(b(s)+(g?": ":":")+f);f=m.length===0?"{}":g?"{\n"+g+m.join(",\n"+g)+
+"\n"+h+"}":"{"+m.join(",")+"}";g=h;return f}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var j=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g,l,k={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d;if(typeof JSON.stringify!=="function")JSON.stringify=function(e,n,t){var s;l=g="";if(typeof t==="number")for(s=0;s<t;s+=1)l+=" ";else if(typeof t==="string")l=t;if((d=n)&&typeof n!=="function"&&(typeof n!=="object"||typeof n.length!=="number"))throw Error("JSON.stringify");return c("",
+{"":e})};if(typeof JSON.parse!=="function")JSON.parse=function(e,n){function t(f,q){var h,m,p=f[q];if(p&&typeof p==="object")for(h in p)if(Object.hasOwnProperty.call(p,h)){m=t(p,h);if(m!==undefined)p[h]=m;else delete p[h]}return n.call(f,q,p)}var s;j.lastIndex=0;if(j.test(e))e=e.replace(j,function(f){return"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){s=eval("("+e+")");return typeof n==="function"?t({"":s},""):s}throw new SyntaxError("JSON.parse");}})();
+OpenAjax.hub.InlineContainer=function(a,b,c){if(!a||!b||!c||!c.Container||!c.Container.onSecurityAlert)throw Error(OpenAjax.hub.Error.BadParameters);this._params=c;this._hub=a;this._id=b;this._onSecurityAlert=c.Container.onSecurityAlert;this._onConnect=c.Container.onConnect?c.Container.onConnect:null;this._onDisconnect=c.Container.onDisconnect?c.Container.onDisconnect:null;this._scope=c.Container.scope||window;if(c.Container.log){var j=this;this._log=function(r){try{c.Container.log.call(j._scope,
+"InlineContainer::"+b+": "+r)}catch(g){OpenAjax.hub._debugger()}}}else this._log=function(){};this._connected=false;this._subs=[];this._subIndex=0;a.addContainer(this)};OpenAjax.hub.InlineContainer.prototype.getHub=function(){return this._hub};OpenAjax.hub.InlineContainer.prototype.sendToClient=function(a,b,c){if(this.isConnected()){c=this._subs[c];try{c.cb.call(c.sc,a,b,c.d)}catch(j){OpenAjax.hub._debugger();this._client._log("caught error from onData callback to HubClient.subscribe(): "+j.message)}}};
+OpenAjax.hub.InlineContainer.prototype.remove=function(){this.isConnected()&&this._disconnect()};OpenAjax.hub.InlineContainer.prototype.isConnected=function(){return this._connected};OpenAjax.hub.InlineContainer.prototype.getClientID=function(){return this._id};OpenAjax.hub.InlineContainer.prototype.getPartnerOrigin=function(){if(this._connected)return window.location.protocol+"//"+window.location.hostname;return null};OpenAjax.hub.InlineContainer.prototype.getParameters=function(){return this._params};
+OpenAjax.hub.InlineContainer.prototype.connect=function(a,b,c){if(this._connected)throw Error(OpenAjax.hub.Error.Duplicate);this._connected=true;this._client=a;if(this._onConnect)try{this._onConnect.call(this._scope,this)}catch(j){OpenAjax.hub._debugger();this._log("caught error from onConnect callback to constructor: "+j.message)}this._invokeOnComplete(b,c,a,true)};
+OpenAjax.hub.InlineContainer.prototype.disconnect=function(a,b,c){if(!this._connected)throw Error(OpenAjax.hub.Error.Disconnected);this._disconnect();if(this._onDisconnect)try{this._onDisconnect.call(this._scope,this)}catch(j){OpenAjax.hub._debugger();this._log("caught error from onDisconnect callback to constructor: "+j.message)}this._invokeOnComplete(b,c,a,true)};
+OpenAjax.hub.InlineContainer.prototype.subscribe=function(a,b,c,j,r){this._assertConn();this._assertSubTopic(a);if(!b)throw Error(OpenAjax.hub.Error.BadParameters);var g=""+this._subIndex++,l=false,k=null;try{var d=this._hub.subscribeForClient(this,a,g);l=true}catch(e){g=null;k=e.message}c=c||window;if(l)this._subs[g]={h:d,cb:b,sc:c,d:r};this._invokeOnComplete(j,c,g,l,k);return g};
+OpenAjax.hub.InlineContainer.prototype.publish=function(a,b){this._assertConn();this._assertPubTopic(a);this._hub.publishForClient(this,a,b)};OpenAjax.hub.InlineContainer.prototype.unsubscribe=function(a,b,c){this._assertConn();if(typeof a==="undefined"||a==null)throw Error(OpenAjax.hub.Error.BadParameters);var j=this._subs[a];if(!j)throw Error(OpenAjax.hub.Error.NoSubscription);this._hub.unsubscribeForClient(this,j.h);delete this._subs[a];this._invokeOnComplete(b,c,a,true)};
+OpenAjax.hub.InlineContainer.prototype.getSubscriberData=function(a){this._assertConn();return this._getSubscription(a).d};OpenAjax.hub.InlineContainer.prototype.getSubscriberScope=function(a){this._assertConn();return this._getSubscription(a).sc};OpenAjax.hub.InlineContainer.prototype._invokeOnComplete=function(a,b,c,j,r){if(a)try{b=b||window;a.call(b,c,j,r)}catch(g){OpenAjax.hub._debugger();this._client._log("caught error from onComplete callback: "+g.message)}};
+OpenAjax.hub.InlineContainer.prototype._disconnect=function(){for(var a in this._subs)this._hub.unsubscribeForClient(this,this._subs[a].h);this._subs=[];this._subIndex=0;this._connected=false};OpenAjax.hub.InlineContainer.prototype._assertConn=function(){if(!this._connected)throw Error(OpenAjax.hub.Error.Disconnected);};
+OpenAjax.hub.InlineContainer.prototype._assertPubTopic=function(a){if(a==null||a==""||a.indexOf("*")!=-1||a.indexOf("..")!=-1||a.charAt(0)=="."||a.charAt(a.length-1)==".")throw Error(OpenAjax.hub.Error.BadParameters);};
+OpenAjax.hub.InlineContainer.prototype._assertSubTopic=function(a){if(!a)throw Error(OpenAjax.hub.Error.BadParameters);a=a.split(".");for(var b=a.length,c=0;c<b;c++){var j=a[c];if(j==""||j.indexOf("*")!=-1&&j!="*"&&j!="**")throw Error(OpenAjax.hub.Error.BadParameters);if(j=="**"&&c<b-1)throw Error(OpenAjax.hub.Error.BadParameters);}};OpenAjax.hub.InlineContainer.prototype._getSubscription=function(a){if(a=this._subs[a])return a;throw Error(OpenAjax.hub.Error.NoSubscription);};
+OpenAjax.hub.InlineHubClient=function(a){if(!a||!a.HubClient||!a.HubClient.onSecurityAlert||!a.InlineHubClient||!a.InlineHubClient.container)throw Error(OpenAjax.hub.Error.BadParameters);this._params=a;this._onSecurityAlert=a.HubClient.onSecurityAlert;this._scope=a.HubClient.scope||window;this._container=a.InlineHubClient.container;if(a.HubClient.log){var b=this;this._log=function(c){try{a.HubClient.log.call(b._scope,"InlineHubClient::"+b._container.getClientID()+": "+c)}catch(j){OpenAjax.hub._debugger()}}}else this._log=
+function(){}};OpenAjax.hub.InlineHubClient.prototype.connect=function(a,b){this._container.connect(this,a,b)};OpenAjax.hub.InlineHubClient.prototype.disconnect=function(a,b){this._container.disconnect(this,a,b)};OpenAjax.hub.InlineHubClient.prototype.getPartnerOrigin=function(){return this._container.getPartnerOrigin()};OpenAjax.hub.InlineHubClient.prototype.getClientID=function(){return this._container.getClientID()};
+OpenAjax.hub.InlineHubClient.prototype.subscribe=function(a,b,c,j,r){return this._container.subscribe(a,b,c,j,r)};OpenAjax.hub.InlineHubClient.prototype.publish=function(a,b){this._container.publish(a,b)};OpenAjax.hub.InlineHubClient.prototype.unsubscribe=function(a,b,c){this._container.unsubscribe(a,b,c)};OpenAjax.hub.InlineHubClient.prototype.isConnected=function(){return this._container.isConnected()};OpenAjax.hub.InlineHubClient.prototype.getScope=function(){return this._scope};
+OpenAjax.hub.InlineHubClient.prototype.getSubscriberData=function(a){return this._container.getSubscriberData(a)};OpenAjax.hub.InlineHubClient.prototype.getSubscriberScope=function(a){return this._container.getSubscriberScope(a)};OpenAjax.hub.InlineHubClient.prototype.getParameters=function(){return this._params};var eclipse=eclipse||{};
+eclipse.ServiceProvider=function(a,b){this.dispatchEvent=function(c){b.dispatchEvent.apply(b,[a,c].concat(Array.prototype.slice.call(arguments,1)))};this.unregister=function(){b.unregisterServiceProvider(a)}};
+eclipse.PluginProvider=function(){function a(l){c.publish("response["+c.getClientID()+"]",l)}function b(l,k){try{var d=j[k.serviceId].implementation,e={id:k.id,result:null,err:null},n=d[k.method].apply(d,k.params);if(n&&typeof n.then==="function")n.then(function(s){e.result=s;a(k)},function(s){e.error=s;a(k)});else{e.result=n;a(e)}}catch(t){e.error=t;a(e)}}var c=null,j=[],r=false,g={dispatchEvent:function(l,k){if(!r)throw Error("Cannot dispatchEvent. Plugin Provider not connected");var d={serviceId:l,
+method:"dispatchEvent",params:[k].concat(Array.prototype.slice.call(arguments,2))};a(d)},unregisterServiceProvider:function(l){if(r)throw Error("Cannot unregister. Plugin Provider is connected");j[l]=null}};this.registerServiceProvider=function(l,k,d){if(r)throw Error("Cannot register. Plugin Provider is connected");var e,n=[];for(e in k)typeof k[e]==="function"&&n.push(e);e=j.length;j[e]={type:l,methods:n,implementation:k,properties:d||{}};return new eclipse.ServiceProvider(e,g)};this.connect=function(){if(!c){c=
+new OpenAjax.hub.IframeHubClient({HubClient:{onSecurityAlert:function(){}}});c.connect(function(l,k){if(k){c.subscribe("request["+c.getClientID()+"]",b);for(var d=[],e=0;e<j.length;e++)j[e]&&d.push({serviceId:e,type:j[e].type,methods:j[e].methods,properties:j[e].properties});a({method:"plugin",params:[{services:d}]});r=true}})}};this.disconnect=function(){if(c){var l=c;c=null;l.disconnect(function(){r=false})}}};
\ No newline at end of file