(function(){u8.Crm.Widgets.ExpandViewPopup=function(p,e){this.Widget(p,$.extend({},u8.Crm.Widgets.ExpandViewPopup.defaults,e));this.popup=$.extend({parent:this},u8.Crm.Widgets.ExpandViewPopup.defaults.popup,e&&e.popup);this.expand=$.extend({},u8.Crm.Widgets.ExpandViewPopup.defaults.expand,e&&e.expand);if(!this.popup.id){this.popup.id=this.id+"_popup"}if(!this.expand.id){this.expand.id=this.id+"_expand"}};u8.Crm.Widgets.ExpandViewPopup.defaults={disposeOnClose:true,popup:{position:"center",alignTo:"window",size:{width:800,height:500}},expand:{}};u8.Crm.Widgets.ExpandViewPopup.makeClass({name:"ExpandViewPopup",deriveFrom:u8.Base.Widgets.Widget,events:["Create"]});$.extend(u8.Crm.Widgets.ExpandViewPopup.prototype,{getPopup:function(){return this._popup},getExpandView:function(){return this._expand},open:function(){if(this._popup){return this._popup.open()}var p=this;this._popup=new u8.Base.Widgets.Popup("<div/>",this.popup);this._popup.bind("Create",function(e){p._popup=e;p.expand.parent=e;var i=e.getContent();p._expand=new u8.Crm.Widgets.ExpandView(i,p.expand);u8.tools.ready(p._expand,function(){e.autoSizeAndPosition();p.raise("Create",{});p._isCreated=true})});this._popup.open()},close:function(){if(this._popup){this._popup.close()}if(this.disposeOnClose){this.dispose()}},dispose:function(){if(this._isDisposed){return}this.Widget_dispose()}});u8.Crm.Widgets.ExpandViewPopup.open=function(p){if(!p){p={}}p.disposeOnClose=true;var e=new u8.Crm.Widgets.ExpandViewPopup($w("main"),p);e.open();return e}})();