(function(){u8.Crm.Views=function(){this._views={}};$.extend(u8.Crm.Views.prototype,{registerView:function(e,i){this._views[e]=i},getActiveView:function(){return u8.services.publisher.get("view")},isViewMenuItemVisible:function(e,r,n){if(!n){n=i(r.name)}var t=this._views[n];if(!t){return true}if(t.isViewMenuItemVisible){return t.isViewMenuItemVisible(e,r)}var u=u8.services.publisher.get("view");return u!=n}});u8.services.add("views",u8.Crm.Views);var e=/Open.*In.*([A-Z][a-z]+View)$/;function i(i){if(i=="D_Expand"){return"ExpandView"}if(i=="D_ExpandTree"){return"TreeView"}var r=i&&i.match(e);return r&&r[1]}u8.services.menus.registerMenuItemHandler(function(e){return!!i(e.name)},{create:function(e,r){var n=r.menuItem,t=i(n.name);if(!t){return}n.visible=u8.services.views.isViewMenuItemVisible(e,n,t);n.update()}})})();