Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.CollapsiblePanelExpandDirection=function(){throw Error.invalidOperation();};AjaxControlToolkit.CollapsiblePanelExpandDirection.prototype={Horizontal:0,Vertical:1};AjaxControlToolkit.CollapsiblePanelExpandDirection.registerEnum("AjaxControlToolkit.CollapsiblePanelExpandDirection",false);AjaxControlToolkit.CollapsiblePanelBehavior=function(c){var b=null,a=this;AjaxControlToolkit.CollapsiblePanelBehavior.initializeBase(a,[c]);a._collapsedSize=0;a._expandedSize=0;a._scrollContents=b;a._collapsed=false;a._expandControlID=b;a._collapseControlID=b;a._textLabelID=b;a._collapsedText=b;a._expandedText=b;a._imageControlID=b;a._expandedImage=b;a._collapsedImage=b;a._suppressPostBack=b;a._autoExpand=b;a._autoCollapse=b;a._expandDirection=AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical;a._collapseClickHandler=b;a._expandClickHandler=b;a._panelMouseEnterHandler=b;a._panelMouseLeaveHandler=b;a._childDiv=b;a._animation=b};AjaxControlToolkit.CollapsiblePanelBehavior.prototype={initialize:function(){var f="SuppressPostBack",a=this;AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(a,"initialize");var b=a.get_element();a._animation=new AjaxControlToolkit.Animation.LengthAnimation(b,.25,10,"style",null,0,0,"px");if(a._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical)a._animation.set_propertyKey("height");else a._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal&&a._animation.set_propertyKey("width");a._animation.add_ended(Function.createDelegate(a,a._onAnimateComplete));if(a._suppressPostBack==null)if(b.tagName=="INPUT"&&b.type=="checkbox"){a._suppressPostBack=false;a.raisePropertyChanged(f)}else if(b.tagName=="A"){a._suppressPostBack=true;a.raisePropertyChanged(f)}var c=AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(a,"get_ClientState");if(c&&c!=""){var g=Boolean.parse(c);if(a._collapsed!=g){a._collapsed=g;a.raisePropertyChanged("Collapsed")}}a._setupChildDiv();if(a._collapsed)a._setTargetSize(a._getCollapsedSize());else a._setTargetSize(a._getExpandedSize());a._setupState(a._collapsed);if(a._collapseControlID==a._expandControlID){a._collapseClickHandler=Function.createDelegate(a,a.togglePanel);a._expandClickHandler=null}else{a._collapseClickHandler=Function.createDelegate(a,a.collapsePanel);a._expandClickHandler=Function.createDelegate(a,a.expandPanel)}if(a._autoExpand){a._panelMouseEnterHandler=Function.createDelegate(a,a._onMouseEnter);$addHandler(b,"mouseover",a._panelMouseEnterHandler)}if(a._autoCollapse){a._panelMouseLeaveHandler=Function.createDelegate(a,a._onMouseLeave);$addHandler(b,"mouseout",a._panelMouseLeaveHandler)}if(a._collapseControlID){var d=$get(a._collapseControlID);if(!d)throw Error.argument("CollapseControlID",String.format(AjaxControlToolkit.Resources.CollapsiblePanel_NoControlID,a._collapseControlID));else $addHandler(d,"click",a._collapseClickHandler)}if(a._expandControlID)if(a._expandClickHandler){var e=$get(a._expandControlID);if(!e)throw Error.argument("ExpandControlID",String.format(AjaxControlToolkit.Resources.CollapsiblePanel_NoControlID,a._expandControlID));else $addHandler(e,"click",a._expandClickHandler)}},dispose:function(){var b=null,a=this,e=a.get_element();if(a._collapseClickHandler){var c=a._collapseControlID?$get(a._collapseControlID):b;c&&$removeHandler(c,"click",a._collapseClickHandler);a._collapseClickHandler=b}if(a._expandClickHandler){var d=a._expandControlID?$get(a._expandControlID):b;d&&$removeHandler(d,"click",a._expandClickHandler);a._expandClickHandler=b}a._panelMouseEnterHandler&&$removeHandler(e,"mouseover",a._panelMouseEnterHandler);a._panelMouseLeaveHandler&&$removeHandler(e,"mouseout",a._panelMouseLeaveHandler);if(a._animation){a._animation.dispose();a._animation=b}AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(a,"dispose")},togglePanel:function(a){this._toggle(a)},expandPanel:function(a){this._doOpen(a)},collapsePanel:function(a){this._doClose(a)},_checkCollapseHide:function(){if(this._collapsed&&this._getTargetSize()==0){var a=this.get_element(),b=$common.getCurrentStyle(a,"display");if(!a.oldDisplay&&b!="none"){a.oldDisplay=b;a.style.display="none"}return true}return false},_doClose:function(b){var a=this,c=new Sys.CancelEventArgs;a.raiseCollapsing(c);if(c.get_cancel())return;if(a._animation){a._animation.stop();a._animation.set_startValue(a._getTargetSize());a._animation.set_endValue(a._getCollapsedSize());a._animation.play()}a._setupState(true);if(a._suppressPostBack)if(b&&b.preventDefault)b.preventDefault();else{if(b)b.returnValue=false;return false}},_doOpen:function(c){var d="display",a=this,e=new Sys.CancelEventArgs;a.raiseExpanding(e);if(e.get_cancel())return;if(a._animation){a._animation.stop();var b=a.get_element();if(a._checkCollapseHide()&&$common.getCurrentStyle(b,d,b.style.display)){if(b.oldDisplay)b.style.display=b.oldDisplay;else if(b.style.removeAttribute)b.style.removeAttribute(d);else b.style.removeProperty(d);b.oldDisplay=null}a._animation.set_startValue(a._getTargetSize());a._animation.set_endValue(a._getExpandedSize());a._animation.play()}a._setupState(false);if(a._suppressPostBack)if(c&&c.preventDefault)c.preventDefault();else{if(c)c.returnValue=false;return false}},_onAnimateComplete:function(){var a=this,b=a.get_element();if(!a._collapsed&&!a._expandedSize)if(a._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical)if(a._childDiv.offsetHeight<=b.offsetHeight){b.style.height="auto";a.raisePropertyChanged("TargetHeight")}else a._checkCollapseHide();else if(a._childDiv.offsetWidth<=b.offsetWidth){b.style.width="auto";a.raisePropertyChanged("TargetWidth")}else a._checkCollapseHide();else a._checkCollapseHide();if(a._collapsed){a.raiseCollapseComplete();a.raiseCollapsed(Sys.EventArgs.Empty)}else{a.raiseExpandComplete();a.raiseExpanded(new Sys.EventArgs)}},_onMouseEnter:function(a){this._autoExpand&&this.expandPanel(a)},_onMouseLeave:function(a){this._autoCollapse&&this.collapsePanel(a)},_getExpandedSize:function(){var a=this;if(a._expandedSize)return a._expandedSize;if(a._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical)return a._childDiv.offsetHeight;else if(a._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal)return a._childDiv.offsetWidth},_getCollapsedSize:function(){if(this._collapsedSize)return this._collapsedSize;return 0},_getTargetSize:function(){var b=this,a;if(b._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical)a=b.get_TargetHeight();else if(b._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal)a=b.get_TargetWidth();if(a===undefined)a=0;return a},_setTargetSize:function(b){var a=this,d=a._collapsed||a._expandedSize,c=a.get_element();if(a._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical)if(d||b Карта
rss
Карта