var EPCollapsiblePanel=Class.create({initialize:function(D){this._targetControl=$(D.targetControlId);this._expandControl=$(D.expandControlId);this._collapseControl=$(D.collapseControlId);if(D.clientStateFieldId){this._clientStateField=$(D.clientStateFieldId)}if(D.cssControlId){this._cssControl=$(D.cssControlId);this._expandedCssClass=D.expandedCssClass;this._collapsedCssClass=D.collapsedCssClass}var E=(D.isCollapsed===true||D.isCollapsed==="true")?true:false;this.setCollapsed(E,true);if(this._expandControl===this._collapseControl){var C=this.onToggleExpandCollapse.bindAsEventListener(this);this._expandControl.observe("click",C)}else{var B=this.onExpand.bindAsEventListener(this);var A=this.onExpand.bindAsEventListener(this);this._expandControl.observe("click",B);this._collapseControl.observe("click",A)}},setCollapsed:function(B,A){if(this._isCollapsed===B||this._isAnimating===true){return }if(B===false){this._targetControl.fire("EPCollapsiblePanel:expanded",this);if(!A){Effect.BlindDown(this._targetControl,{duration:0.5,beforeStart:function(){this._isAnimating=true}.bindAsEventListener(this),afterFinish:function(){this._isAnimating=false}.bindAsEventListener(this)})}else{this._targetControl.style.display="block"}if(this._cssControl!==undefined&&this._cssControl!==null){this._cssControl.className=this._expandedCssClass}}else{if(B===true){this._targetControl.fire("EPCollapsiblePanel:collapsed",this);if(!A){Effect.BlindUp(this._targetControl,{duration:0.5,beforeStart:function(){this._isAnimating=true}.bindAsEventListener(this),afterFinish:function(){this._isAnimating=false}.bindAsEventListener(this)})}else{this._targetControl.style.display="none"}if(this._cssControl!==undefined&&this._cssControl!==null){this._cssControl.className=this._collapsedCssClass}}}this._isCollapsed=B;if(this._clientStateField!==undefined&&this._clientStateField!==null){this._clientStateField.value=B?"true":"false"}},onToggleExpandCollapse:function(){if(this._isCollapsed===true){this.setCollapsed(false)}else{this.setCollapsed(true)}},onExpand:function(){this.setCollapsed(false)},onCollapse:function(){this.setCollapsed(true)}});