(function(){YAHOO.namespace("vantage.widget");YAHOO.vantage.widget.MinimizePanel=function(b,a){arguments.length>0&&YAHOO.vantage.widget.MinimizePanel.superclass.constructor.call(this,b,a)};var g=YAHOO.lang,h=YAHOO.util,c=h.Dom,j=h.Event,l=h.CustomEvent,d=YAHOO.vantage.widget.MinimizePanel,f,k={MINIMIZE:"minimizePanelEvent",RESTORE:"restorePanelEvent"},e={MINIMIZE:{key:"minimize",value:true,validator:g.isBoolean,supercedes:["visible"]},STRINGS:{key:"strings",supercedes:["minimize"],validator:g.isObject,
value:{minimize:"Minimize"}}};d.CSS_MINIMIZEPANEL="yui-minimizepanel";d.CSS_MINIMIZEPANEL_MINIMIZE="container-minimize";d.CSS_MINIMIZEPANEL_RESTORE="container-restore";YAHOO.extend(d,YAHOO.widget.Panel,{minimized:false,init:function(b,a){d.superclass.init.call(this,b);this.beforeInitEvent.fire(d);c.addClass(this.element,d.CSS_MINIMIZEPANEL);a&&this.cfg.applyConfig(a,true);this.initEvent.fire(d)},initEvents:function(){d.superclass.initEvents.call(this);var b=l.LIST;this.minimizeEvent=this.createEvent(k.MINIMIZE);
this.minimizeEvent.signature=b;this.restoreEvent=this.createEvent(k.RESTORE);this.restoreEvent.signature=b},initDefaultConfig:function(){d.superclass.initDefaultConfig.call(this);this.cfg.addProperty(e.MINIMIZE.key,{handler:this.configMinimize,value:e.MINIMIZE.value,validator:e.MINIMIZE.validator,supercedes:e.MINIMIZE.supercedes});this.cfg.addProperty(e.STRINGS.key,{handler:this.configStrings,value:e.STRINGS.value,validator:e.STRINGS.validator,supercedes:e.STRINGS.supercedes})},configMinimize:function(b,
a){b=a[0];a=this.minimize;var i=this.cfg.getProperty("strings");if(b){this.footerStartPadding=this.footerStartHeight=this.bodyStartPadding=this.bodyStartHeight=null;if(a)a.style.display="block";else{if(!f){f=document.createElement("a");f.className=d.CSS_MINIMIZEPANEL_MINIMIZE;f.href="#"}a=f.cloneNode(true);this.cfg.getProperty("close")||c.addClass(a,"noclose");this.innerElement.appendChild(a);a.innerHTML=i&&i.minimize?i.minimize:"&#160;";j.on(a,"click",this._doMinimize,this,true);this.minimize=a}}else if(a)a.style.display=
"none"},configStrings:function(b,a){b=g.merge(e.STRINGS.value,a[0]);this.cfg.setProperty(e.STRINGS.key,b,true)},_doMinimize:function(b){j.preventDefault(b);b=this.body;var a=this.footer;if(this.minimized){c.setStyle(b,"height",this.bodyStartHeight);c.setStyle(b,"padding",this.bodyStartPadding);c.setStyle(b,"visibility","inherit");c.setStyle(a,"height",this.footerStartHeight);c.setStyle(a,"padding",this.footerStartPadding);c.setStyle(a,"visibility","inherit");c.replaceClass(this.minimize,d.CSS_MINIMIZEPANEL_RESTORE,
d.CSS_MINIMIZEPANEL_MINIMIZE);this.minimized=false;this.restoreEvent.fire(this._getRestoreEventArgs())}else{this.bodyStartHeight=c.getStyle(b,"height");this.bodyStartPadding=c.getStyle(b,"padding");this.footerStartHeight=c.getStyle(a,"height");this.footerStartPadding=c.getStyle(a,"padding");c.setStyle(b,"height","0");c.setStyle(b,"padding","0");c.setStyle(b,"visibility","hidden");c.setStyle(a,"height","0");c.setStyle(a,"padding","0");c.setStyle(a,"visibility","hidden");c.replaceClass(this.minimize,
d.CSS_MINIMIZEPANEL_MINIMIZE,d.CSS_MINIMIZEPANEL_RESTORE);this.minimized=true;this.minimizeEvent.fire(this._getMinimizeEventArgs())}},_getMinimizeEventArgs:function(){return{dom:__id?__id:null}},_getRestoreEventArgs:function(){return{dom:__id?__id:null}},toString:function(){return"Minimize Panel "+this.id}});YAHOO.register("minimizepanel",d,{version:"2.7.0",build:"1.0"})})();
