!function(){var moduleFactory=function(){var module=this,exports=function(){window.OpenAjax||(OpenAjax=new function(){var ooh="org.openajax.hub.",h={};this.hub=h,h.implementer="http://openajax.org",h.implVersion="2.0",h.specVersion="2.0",h.implExtraData={};var libs={};h.libraries=libs,h.registerLibrary=function(prefix,nsURL,version,extra){libs[prefix]={prefix:prefix,namespaceURI:nsURL,version:version,extraData:extra},this.publish(ooh+"registerLibrary",libs[prefix])},h.unregisterLibrary=function(prefix){this.publish(ooh+"unregisterLibrary",libs[prefix]),delete libs[prefix]
},h._subscriptions={c:{},s:[]},h._cleanup=[],h._subIndex=0,h._pubDepth=0,h.subscribe=function(name,callback,scope,subscriberData,filter){scope||(scope=window);var handle=name+"."+this._subIndex,sub={scope:scope,cb:callback,fcb:filter,data:subscriberData,sid:this._subIndex++,hdl:handle},path=name.split(".");return this._subscribe(this._subscriptions,path,0,sub),handle},h.publish=function(name,message){var path=name.split(".");if(this._pubDepth++,this._publish(this._subscriptions,path,0,name,message),this._pubDepth--,this._cleanup.length>0&&0==this._pubDepth){for(var i=0;i<this._cleanup.length;i++)this.unsubscribe(this._cleanup[i].hdl);
delete this._cleanup,this._cleanup=[]}},h.unsubscribe=function(sub){var path=sub.split("."),sid=path.pop();this._unsubscribe(this._subscriptions,path,0,sid)},h._subscribe=function(tree,path,index,sub){var token=path[index];index==path.length?tree.s.push(sub):("undefined"==typeof tree.c&&(tree.c={}),"undefined"==typeof tree.c[token]?(tree.c[token]={c:{},s:[]},this._subscribe(tree.c[token],path,index+1,sub)):this._subscribe(tree.c[token],path,index+1,sub))},h._publish=function(tree,path,index,name,msg,pid){if("undefined"!=typeof tree){var node;
if(index==path.length?node=tree:(this._publish(tree.c[path[index]],path,index+1,name,msg,pid),this._publish(tree.c["*"],path,index+1,name,msg,pid),node=tree.c["**"]),"undefined"!=typeof node)for(var callbacks=node.s,max=callbacks.length,i=0;max>i;i++)if(callbacks[i].cb){var sc=callbacks[i].scope,cb=callbacks[i].cb,fcb=callbacks[i].fcb,d=callbacks[i].data;"string"==typeof cb&&(cb=sc[cb]),"string"==typeof fcb&&(fcb=sc[fcb]),(!fcb||fcb.call(sc,name,msg,d))&&cb.call(sc,name,msg,d,pid)}}},h._unsubscribe=function(tree,path,index,sid){if("undefined"!=typeof tree){if(index<path.length){var childNode=tree.c[path[index]];
if(this._unsubscribe(childNode,path,index+1,sid),0==childNode.s.length){for(var x in childNode.c)return;delete tree.c[path[index]]}return}for(var callbacks=tree.s,max=callbacks.length,i=0;max>i;i++)if(sid==callbacks[i].sid)return this._pubDepth>0?(callbacks[i].cb=null,this._cleanup.push(callbacks[i])):callbacks.splice(i,1),void 0}},h.reinit=function(){for(var lib in OpenAjax.hub.libraries)delete OpenAjax.hub.libraries[lib];OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","1.0",{}),delete OpenAjax._subscriptions,OpenAjax._subscriptions={c:{},s:[]},delete OpenAjax._cleanup,OpenAjax._cleanup=[],OpenAjax._subIndex=0,OpenAjax._pubDepth=0
}},OpenAjax.hub.registerLibrary("OpenAjax","http://openajax.org/hub","1.0",{})),OpenAjax.hub.registerLibrary("JavaScriptMVC","http://JavaScriptMVC.com","3.1",{})};exports(),module.resolveWith(exports)};dispatch("mvc/lang.openajax").containing(moduleFactory).to("Foundry/2.1 Modules")}();