text: (function(a){a.registerWidgetEvent("onExpand,onCollapse");a.widget("FUI.FPanel",{options:{width:"auto",height:"auto",pageUrl:null,isIFrame:false,iconCls:null,onCollapse:null,onExpand:null,onLoadSuccess:null,onError:null,_isCollapsed:false,_objHeader:null,_objHeaderToggle:null,_objHeaderTitle:null,_objHeaderIcon:null,_objWrapper:null,_objWrapperBody:null},_create:function(){var b=this.element.attr("id");this.options.id=b;this.options._objHeader=$I(b+"-header");this.options._objHeaderToggle=$I(b+"-toggle");this.options._objHeaderTitle=$I(b+"-title");this.options._objHeaderIcon=$I(b+"-icon");this.options._objWrapper=$I(b+"-wrapper");this.options._objWrapperBody=$I(b+"-body");this.options._isCollapsed=this.element.hasClass("f-collapsed");this._bindEvent()},_init:function(){this.reload();this.setSize(this.options.width,this.options.height)},_bindEvent:function(){var c=this;var b=this.options._objHeaderToggle;b.hover(function(d){b.addClass("f-tool-toggle-over")},function(d){b.removeClass("f-tool-toggle-over")});b.click(function(){if(c.options._isCollapsed){c.expand()}else{c.collapse()}return false})},destroy:function(){var b=this.options;b._objHeaderToggle.unbind();b._objHeader=null;b._objHeaderToggle=null;b._objHeaderTitle=null;b._objHeaderIcon=null;b._objWrapper=null;b._objWrapperBody=null;a.Widget.prototype.destroy.call(this)},reload:function(c){var e=this.options;var d=this.element;var b=e._objWrapperBody;c=c||e.pageUrl;if($Utils.isEmpty(c)){return}e.pageUrl=c;if(e.isIFrame){e._objWrapperBody.children("iframe").attr("src",c);return}if(d.data("loading")){return}else{d.data("loading",true)}if(c.indexOf("/")!==0){c=$Utils.getContextPath()+"/"+c}a.ajax({cache:false,type:"get",url:c,success:function(g,h,f){b.html(g);if(a.isFunction(e.onLoadSuccess)){e.onLoadSuccess(g,h,f)}},error:function(g,h,f){if(a.isFunction(e.onError)){e.onError(g,h,f)}},complete:function(){d.data("loading",false)}})},expand:function(){var b=this;var c=b.options;if(c._isCollapsed){c._objWrapper.slideDown("fast",function(){b.element.addClass("f-collapsible").removeClass("f-collapsed");c._isCollapsed=false;var e=true;if(a.isFunction(c.onExpand)){var d=c.onExpand.call(b);e=(d===false)?false:true}if(e){b.element.triggerHandler("onExpand")}})}},collapse:function(){var b=this;var c=b.options;if(!c._isCollapsed){c._objWrapper.slideUp("fast",function(){b.element.removeClass("f-collapsible").addClass("f-collapsed");c._isCollapsed=true;var e=true;if(a.isFunction(c.onCollapse)){var d=c.onCollapse.call(b);e=(d===false)?false:true}if(e){b.element.triggerHandler("onCollapse")}})}},setTitle:function(b){if(b){this.options.title=b;this.options._objHeaderTitle.text(b)}},setIconCls:function(b){var c=this.options;if(c.iconCls&&c.iconCls.length!=0){c._objHeaderIcon.removeClass(c.iconCls)}c._objHeaderIcon.addClass(b);c.iconCls=b},setSize:function(k,e){var g=window["$Utils"];var f=this.options;var i=this.element;var m=f._objWrapperBody;var j=m.children(".f-panel-body-content");var b=j.size();if(k!=null){var l=g.getPercentage(k);if(l){i.get(0).style.width=l;m.get(0).style.width="auto";if(b===1){j.get(0).style.width="auto"}}else{var c=2;k=parseInt(k);var n=k-c;if(!isNaN(n)){if(n<0){n=0}i.get(0).style.width=k+"px";if(b===1){j.get(0).style.width=n+"px"}else{m.get(0).style.width=n+"px"}}}}if(e!=null){var l=g.getPercentage(e);if(l){i.get(0).style.height=l;m.get(0).style.height="auto";if(b===1){j.get(0).style.height="auto"}}else{var c=27;var n=parseInt(e)-c;if(!isNaN(n)){if(n<0){n=0}i.get(0).style.height="auto";if(b===1){var d=0;j.siblings().not("script").each(function(){d+=a(this).outerHeight(true)});n=(n-d)<0?0:(n-d);j.get(0).style.height=n+"px"}else{m.get(0).style.height=n+"px"}}}}}})})(jQuery);