﻿// Copyright (c) ComponentOne L.L.C., All rights reserved.
Type.registerNamespace("C1.Web.UI.Controls.C1Expander");C1.Web.UI.Controls.C1Expander.C1ExpandDirection=function(){};C1.Web.UI.Controls.C1Expander.C1ExpandDirection.prototype={top:0,right:1,bottom:2,left:3};C1.Web.UI.Controls.C1Expander.C1ExpandDirection.registerEnum("C1.Web.UI.Controls.C1Expander.C1ExpandDirection",false);C1.Web.UI.Controls.C1Expander.C1Expander=function(a){C1.Web.UI.Controls.C1Expander.C1Expander.initializeBase(this,[a])};C1.Web.UI.Controls.C1Expander.C1Expander.prototype={setHeaderContentClassNames:function(){this._headerPanelClassName="C1eHeaderPanel";this._contentPanelClassName="C1eContentPanel"},initialize:function(){C1.Web.UI.Controls.C1Expander.C1Expander.callBaseMethod(this,"initialize")},dispose:function(){C1.Web.UI.Controls.C1Expander.C1Expander.callBaseMethod(this,"dispose")},get_expandDirection:function(){return(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.ExpandDirection))?2:this._propertiesState.ExpandDirection},set_expandDirection:function(c){var b=this.get_expandDirection();if(b!==c){var a=this.contentPanelElement.parentNode;switch(c){case 0:this.get_flowPanel().set_orientation(1);if(b===2||(b===1)){a.removeChild(this.contentPanelElement);a.insertBefore(this.contentPanelElement,this.headerPanelElement)}break;case 1:this.get_flowPanel().set_orientation(0);if(!b||(b===3)){a.removeChild(this.headerPanelElement);a.insertBefore(this.headerPanelElement,this.contentPanelElement)}break;case 2:this.get_flowPanel().set_orientation(1);if(!b||(b===3)){a.removeChild(this.headerPanelElement);a.insertBefore(this.headerPanelElement,this.contentPanelElement)}break;case 3:this.get_flowPanel().set_orientation(0);if(b===2||(b===1)){a.removeChild(this.contentPanelElement);a.insertBefore(this.contentPanelElement,this.headerPanelElement)}break}Sys.UI.DomElement.removeCssClass(this.get_element(),this.$3_4(b));Sys.UI.DomElement.addCssClass(this.get_element(),this.$3_4(c));this._propertiesState.ExpandDirection=c;this.updateCompoundCssClasses();this.restoreInitialLayout();this.saveState();this.invalidate()}return c},get_expanded:function(){if(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.Expanded)){return false}return this._propertiesState.Expanded},set_expanded:function(a){if(!this.get_enabled()){return}if(a){if(!this.$3_0()){return}}else{if(!this.$3_1()){return}}this._propertiesState.Expanded=a;this.saveState();if(!a){this.onCollapse()}else{this.onExpand()}return a},$3_0:function(){var b=this.get_events().getHandler("BeforeExpand");if(b){var a=new Sys.CancelEventArgs();b(this,a);if(a.get_cancel()){return false}}return true},$3_1:function(){var b=this.get_events().getHandler("BeforeCollapse");if(b){var a=new Sys.CancelEventArgs();b(this,a);if(a.get_cancel()){return false}}return true},get_expandAnimation:function(){if(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.ExpandAnimation)){return 0}else{return this._propertiesState.ExpandAnimation}},set_expandAnimation:function(a){this._propertiesState.ExpandAnimation=a;return a},get_collapseAnimation:function(){if(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.CollapseAnimation)){return 0}else{return this._propertiesState.CollapseAnimation}},set_collapseAnimation:function(a){this._propertiesState.CollapseAnimation=a;return a},get_expandDuration:function(){if(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.ExpandDuration)){return 500}else{return this._propertiesState.ExpandDuration}},set_expandDuration:function(a){if(a<1){return}this._propertiesState.ExpandDuration=a;return a},get_collapseDuration:function(){if(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.CollapseDuration)){return 500}else{return this._propertiesState.CollapseDuration}},set_collapseDuration:function(a){if(a<1){return}this._propertiesState.CollapseDuration=a;return a},get_expandEasing:function(){return(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.ExpandEasing))?31:this._propertiesState.ExpandEasing},set_expandEasing:function(a){this._propertiesState.ExpandEasing=a;return a},get_collapseEasing:function(){return(C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.CollapseEasing))?31:this._propertiesState.CollapseEasing},set_collapseEasing:function(a){this._propertiesState.CollapseEasing=a;return a},add_beforeExpand:function(a){this.get_events().addHandler("BeforeExpand",a)},remove_beforeExpand:function(a){this.get_events().removeHandler("BeforeExpand",a)},add_beforeCollapse:function(a){this.get_events().addHandler("BeforeCollapse",a)},remove_beforeCollapse:function(a){this.get_events().removeHandler("BeforeCollapse",a)},add_afterExpand:function(a){this.get_events().addHandler("AfterExpand",a)},remove_afterExpand:function(a){this.get_events().removeHandler("AfterExpand",a)},add_afterCollapse:function(a){this.get_events().addHandler("AfterCollapse",a)},remove_afterCollapse:function(a){this.get_events().removeHandler("AfterCollapse",a)},onCollapse:function(){this._overflow=this.get_contentPanel().get_contentElement().style.overflow;this.get_contentPanel().get_contentElement().style.overflow="hidden";var a=C1.Web.UI.Behavior.AnimationEffects.playAnimationEffect(this.get_collapseAnimation(),this.contentPanelElement,this.get_collapseDuration(),this.get_collapseEasing(),null,Function.createDelegate(this,this.$3_2),false,false,true,false);if(a){}else{this.raiseAfterCollapse()}if(this.get_autoPostBack()){if(!C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.AutoPostBackEventReference)){C1.Web.UI.Utils.Common.executePostbackReference(this._propertiesState.AutoPostBackEventReference)}else{window.__doPostBack(this.get_id())}}},_overflow:"auto",onExpand:function(){if(this.get_autoPostBack()){if(!C1.Web.UI.Utils.Common.testIsNull(this._propertiesState.AutoPostBackEventReference)){C1.Web.UI.Utils.Common.executePostbackReference(this._propertiesState.AutoPostBackEventReference)}else{window.__doPostBack(this.get_id())}}this._overflow=this.get_contentPanel().get_contentElement().style.overflow;this.get_contentPanel().get_contentElement().style.overflow="hidden";this.raiseAfterExpand();var a=C1.Web.UI.Behavior.AnimationEffects.playAnimationEffect(this.get_expandAnimation(),this.contentPanelElement,this.get_expandDuration(),this.get_expandEasing(),null,null,false,false,true,true)},raiseAfterExpand:function(){Sys.UI.DomElement.removeCssClass(this.get_element(),"C1Closed");Sys.UI.DomElement.addCssClass(this.get_element(),"C1Opened");this.invalidate();this.updateCompoundCssClasses();this.get_contentPanel().get_contentElement().style.overflow=this._overflow;this.contentPanelElement.style.display="";C1.Web.UI.Utils.Common.notifyVisibleState(this.contentPanelElement);var b=this.get_events().getHandler("AfterExpand");if(b){var a=new Sys.EventArgs();b(this,a)}},raiseAfterCollapse:function(){Sys.UI.DomElement.removeCssClass(this.get_element(),"C1Opened");Sys.UI.DomElement.addCssClass(this.get_element(),"C1Closed");this.invalidate();this.updateCompoundCssClasses();this.contentPanelElement.style.display="none";this.get_contentPanel().get_contentElement().style.overflow=this._overflow;var b=this.get_events().getHandler("AfterCollapse");if(b){var a=new Sys.EventArgs();b(this,a)}},$3_2:function(b,a){this.raiseAfterCollapse()},$3_3:function(b,a){this.raiseAfterExpand()},onAccessKeyDown:function(a){this.set_expanded(true);return C1.Web.UI.Utils.RawEvent.cancelBrowserResponse(a)},onHeaderMouseClick:function(a){this.set_expanded(!this.get_expanded());C1.Web.UI.Controls.C1Expander.C1Expander.callBaseMethod(this,"onHeaderMouseClick",[a])},onHeaderMouseDown:function(a){C1.Web.UI.Controls.C1Expander.C1Expander.callBaseMethod(this,"onHeaderMouseDown",[a])},onHeaderMouseUp:function(a){C1.Web.UI.Controls.C1Expander.C1Expander.callBaseMethod(this,"onHeaderMouseUp",[a])},onHeaderMouseOver:function(a){C1.Web.UI.Controls.C1Expander.C1Expander.callBaseMethod(this,"onHeaderMouseOver",[a])},onHeaderMouseOut:function(a){C1.Web.UI.Controls.C1Expander.C1Expander.callBaseMethod(this,"onHeaderMouseOut",[a])},determineOrientation:function(){if(this.get_expandDirection()===2||!this.get_expandDirection()){return 1}else{return 0}},determineIsExpanded:function(){return this.get_expanded()},getControlClassName:function(){return"C1Expander"},determineExpandDirectionCssClass:function(){return this.$3_4(this.get_expandDirection())},$3_4:function(a){switch(a){case 0:return"C1Top";case 1:return"C1Right";case 2:return"C1Bottom";case 3:return"C1Left"}return"C1Bottom"},createContentPanel:function(){var a=new C1.Web.UI.ContentPanel(this.contentPanelElement);a.setInnerElementsClassNames("C1eOuter","C1eInner","C1eContent");return a},createHeaderPanel:function(){var a=new C1.Web.UI.ContentPanel(this.headerPanelElement);a.setInnerElementsClassNames("C1eOuter","C1eInner","C1eContent");return a}};C1.Web.UI.Controls.C1Expander.C1Expander.registerClass("C1.Web.UI.Controls.C1Expander.C1Expander",C1.Web.UI.Controls.C1HeaderContentControl.C1HeaderContentControl);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();