﻿Type.registerNamespace("Infragistics.Web.UI");var $IG=Infragistics.Web.UI;$IG.DropDownPopupPosition=function(){};$IG.DropDownPopupPosition.prototype={Default:0,Center:1,Left:2,Right:3,TopLeft:4,TopRight:5,BottomLeft:6,BottomRight:7};$IG.DropDownPopupPosition.registerEnum("Infragistics.Web.UI.DropDownPopupPosition");$IG.DropDownBehavior=function(b,a,c){if(!b){throw Error.argumentNull("sourceElement")}this._sourceElement=b;this._targetContainer=null;this._targetContent=null;this._position=$IG.DropDownPopupPosition.Default;this._outerContainer=c;this._offsetX=0;this._offsetY=0;this._containerHeight=0;this._offScreen=false;this._enableAutomaticPositioning=true;this._enableMovingTargetWithSource=true;this._enableAnimations=true;this._animationType=$IG.AnimationEquationType.EaseInOut;this._visible=false;this._visibleOnFocus=false;this._visibleOnBlur=false;this._visibleOnMouseOver=false;this._visibleOnClick=false;this._visibleOnKeyDown=false;this._dropDownAnimation=null;this._animationDurationMs=300;this._zIndex=10000;this._animationsContainer=null;this._targetBounds=null;this._dropDownIsChild=a;this._events=new $IG.DropDownEvents(this);this._animationEndListener=null;this._mouseUpDelegate=Function.createDelegate(this,this._mouseUpHandler);this._mouseClickDelegate=Function.createDelegate(this,this._mouseClickHandler);this._mouseOverDelegate=Function.createDelegate(this,this._mouseOverHandler);this._mouseDownDelegate=Function.createDelegate(this,this._mouseDownHandler);this._keyDownDelegate=Function.createDelegate(this,this._keyDownHandler);this._keyUpDelegate=Function.createDelegate(this,this._keyUpHandler);this._focusDelegate=Function.createDelegate(this,this._focusHandler);this._blurDelegate=Function.createDelegate(this,this._blurHandler);this._moveDelegate=Function.createDelegate(this,this._onMove);if(this._enableMovingTargetWithSource){this._checkDelegate=Function.createDelegate(this,this._onCheckPosition);this._sourceLocation=Sys.UI.DomElement.getLocation(this._sourceElement);this._sourceBounds=Sys.UI.DomElement.getBounds(this._sourceElement);this._closeCheckID=setInterval(this._checkDelegate,500)}};$IG.DropDownBehavior.prototype={get_sourceElement:function(){return this._sourceElement},get_targetContainer:function(){return this._targetContainer},get_animationsContainer:function(){return this._animationsContainer},set_targetContainer:function(a){if(!a){throw Error.argumentNull("container")}this._targetContainer=a},set_targetContainerHeight:function(a){this._targetBounds.height=a;this._containerHeight=a;if(this.get_enableAnimations()){$util.setAbsoluteHeight(this._animationsContainer,a)}},get_targetContent:function(){return this._targetContent},set_targetContent:function(a){this._targetContent=a},get_zIndex:function(){return this._zIndex},set_zIndex:function(a){this._zIndex=a},get_position:function(){return this._position},set_position:function(a){this._position=a},get_enableAutomaticPositioning:function(){return this._enableAutomaticPositioning},set_enableAutomaticPositioning:function(a){this._enableAutomaticPositioning=a},get_enableMovingTargetWithSource:function(){return this._enableMovingTargetWithSource},set_enableMovingTargetWithSource:function(a){this._enableMovingTargetWithSource=a;if(this._enableMovingTargetWithSource){clearInterval(this._closeCheckID);this._checkDelegate=Function.createDelegate(this,this._onCheckPosition);this._sourceLocation=Sys.UI.DomElement.getLocation(this._sourceElement);this._sourceBounds=Sys.UI.DomElement.getBounds(this._sourceElement);this._closeCheckID=setInterval(this._checkDelegate,200)}else{clearInterval(this._closeCheckID)}},get_enableAnimations:function(){return this._enableAnimations},set_enableAnimations:function(a){this._enableAnimations=a},get_animationType:function(){return this._animationType},set_animationType:function(a){this._animationType=a},get_animationDurationMs:function(){return this._animationDurationMs},set_animationDurationMs:function(a){this._animationDurationMs=a},get_offsetX:function(){return this._offsetX},set_offsetX:function(a){this._offsetX=a},get_offsetY:function(){return this._offsetY},set_offsetY:function(a){this._offsetY=a},get_offScreen:function(){return this._offScreen},set_offScreen:function(a){this._offScreen=a},get_visibleOnFocus:function(){return this._visibleOnFocus},set_visibleOnFocus:function(a){this._visibleOnFocus=a},get_visibleOnBlur:function(){return this._visibleOnBlur},set_visibleOnBlur:function(a){this._visibleOnBlur=a},get_isAnimating:function(){if(this._dropDownAnimation){return this._dropDownAnimation.get_isAnimating()}else{return false}},get_visibleOnMouseOver:function(){return this._visibleOnMouseOver},set_visibleOnClick:function(a){this._visibleOnClick=a},get_visibleOnClick:function(){return this._visibleOnClick},set_visibleOnMouseOver:function(a){this._visibleOnMouseOver=a},get_visibleOnKeyDown:function(){return this._visibleOnKeyDown},set_visibleOnKeyDown:function(a){this._visibleOnKeyDown=a},get_dropDownIsChild:function(){return this._dropDownIsChild},get_visible:function(){return this._visible},set_visible:function(a){var b=false;this._sourceLocation=Sys.UI.DomElement.getLocation(this._sourceElement);if(this._dropDownAnimation&&this._dropDownAnimation.get_isAnimating()){return}if(a){b=this.get_Events()._fireEvent("SettingVisible",this)}else{b=this.get_Events()._fireEvent("SettingHidden",this)}if(!b){if(a&&!this._visible){this.__showDropDown()}else{if(!a&&this._visible){this.__hideDropDown()}}if(a){this.get_Events()._fireEvent("SetVisible",this)}else{this.get_Events()._fireEvent("SetHidden",this)}if(!this._enableAnimations){this._visible=a}}},get_Events:function(){return this._events},getBounds:function(){return this._bounds},triggerVisibility:function(){if(this._visible){this.set_visible(false)}else{this.set_visible(true)}},set_containerMaxHeight:function(b,d,a){var c=this.get_enableAnimations()?this._animationsContainer:this._targetContainer;c.style.left=-10000;c.style.top=-10000;c.style.display="block";c.style.visibility="visible";if(b<=d.offsetHeight){a.style.height=b+"px"}c.style.left=0;c.style.top=0;c.style.display="none";c.style.visibility="hidden"},init:function(){$addHandler(this._sourceElement,"mouseup",this._mouseUpDelegate);$addHandler(this._sourceElement,"click",this._mouseClickDelegate);$addHandler(this._sourceElement,"mouseover",this._mouseOverDelegate);$addHandler(this._sourceElement,"mousedown",this._mouseDownDelegate);$addHandler(this._sourceElement,"keydown",this._keyDownDelegate);$addHandler(this._sourceElement,"keyup",this._keyUpDelegate);$addHandler(this._sourceElement,"focus",this._focusDelegate);$addHandler(this._sourceElement,"blur",this._blurDelegate);if(this._dropDownIsChild){this._sourceElement.appendChild(this._targetContainer)}else{document.forms[0].appendChild(this._targetContainer)}this._targetContainer.style.display="block";this._targetContainer.style.visibility="visible";this._targetContainer.style.position="";this._targetBounds=Sys.UI.DomElement.getBounds(this._targetContainer);this._containerHeight=this._targetBounds.height;this._dropDownAnimation=new $IG.DropDownAnimation(this);this._dropDownAnimation.set_duration(this._animationDurationMs);if(this._enableAnimations){this._animationsContainer=document.createElement("div");this._animationsContainer.id=this._targetContainer.id+"_animations";this._animationsContainer.style.display="none";this._animationsContainer.style.visibility="hidden";this._animationsContainer.style.overflow="hidden";this._animationsContainer.style.position="absolute"}var a=(this._enableAnimations)?this._animationsContainer:this._targetContainer;if(this._dropDownIsChild){this._sourceElement.insertBefore(a,this._sourceElement.firstChild)}else{document.forms[0].appendChild(a)}if(this._enableAnimations){$util.setAbsoluteHeight(this._animationsContainer,0);this._containerHeight=this._targetBounds.height;$util.setAbsoluteWidth(this._animationsContainer,this._targetBounds.width);$addHandler(this._animationsContainer,"move",this._moveDelegate);this._animationsContainer.appendChild(this._targetContainer)}else{this._targetContainer.style.display="none";this._targetContainer.style.visibility="hidden";this._targetContainer.style.position="absolute";$addHandler(this._targetContainer,"move",this._moveDelegate)}},dispose:function(){this._dropDownAnimation.stop();this._dropDownAnimation.onEnd();try{$removeHandler(this._sourceElement,"mouseup",this._mouseUpDelegate)}catch(a){}try{$removeHandler(this._sourceElement,"click",this._mouseClickDelegate)}catch(a){}try{$removeHandler(this._sourceElement,"mouseover",this._mouseOverDelegate)}catch(a){}try{$removeHandler(this._sourceElement,"mousedown",this._mouseDownDelegate)}catch(a){}try{$removeHandler(this._sourceElement,"keydown",this._keyDownDelegate)}catch(a){}try{$removeHandler(this._sourceElement,"keyup",this._keyUpDelegate)}catch(a){}try{$removeHandler(this._sourceElement,"focus",this._focusDelegate)}catch(a){}try{$removeHandler(this._sourceElement,"blur",this._blurDelegate)}catch(a){}try{$removeHandler(this._targetContainer,"move",this._moveDelegate)}catch(a){}delete this._mouseUpDelegate;delete this._mouseClickDelegate;delete this._mouseOverDelegate;delete this._mouseDownDelegate;delete this._keyDownDelegate;delete this._keyUpDelegate;delete this._focusDelegate;delete this._blurDelegate;delete this._moveDelegate;delete this._events;delete this._containerHeight;delete this._dropDownAnimation;delete this._animationsContainer;clearInterval(this._closeCheckID);delete this._closeCheckID;delete this._checkDelegate;this._sourceElement=null;this._targetContainer=null;delete this._position;this._outerContainer=null;delete this._offsetX;delete this._offsetY;delete this._containerHeight;delete this._offScreen;delete this._enableAutomaticPositioning;delete this._enableMovingTargetWithSource;delete this._enableAnimations;delete this._animationType;delete this._visible;delete this._visibleOnFocus;delete this._visibleOnBlur;delete this._visibleOnMouseOver;delete this._visibleOnClick;delete this._visibleOnKeyDown;delete this._dropDownAnimation;delete this._animationDurationMs;delete this._zIndex;delete this._targetBounds;delete this._dropDownIsChild},_onCheckPosition:function(){var a=this._sourceLocation;var c=this._sourceBounds;var d=false;try{var i=Sys.UI.DomElement.getLocation(this._sourceElement);var g=Sys.UI.DomElement.getBounds(this._sourceElement);if(this._outerContainer){var b=Sys.UI.DomElement.getBounds(this._outerContainer);var f=Sys.UI.DomElement.getLocation(this._outerContainer);if(i.y+g.height>b.height+f.y||i.y<f.y){d=true}}}catch(h){return}if(a.x!=i.x||a.y!=i.y||g.width!=c.width||g.height!=c.height){if((g.width<=0&&g.height<=0)||d){this._targetContainer.style.visibility="hidden";this._targetContainer.style.display="none"}else{if(this.get_visible()){this.set_visible(false);this.set_visible(true)}}this._sourceLocation=i;this._sourceBounds=g}},_onMove:function(){var a=(this._enableAnimations)?this._animationsContainer:this._targetContainer;if(this._childFrame){a.parentNode.insertBefore(this._childFrame,a);this._childFrame.style.top=a.style.top;this._childFrame.style.left=a.style.left}},_mouseUpHandler:function(a){},_mouseClickHandler:function(a){},_mouseOverHandler:function(a){if(this._visibleOnMouseOver){this.__handleVisible(a)}},_mouseDownHandler:function(a){if(this._visibleOnMouseDown){this.__handleTrigger(a)}},_keyDownHandler:function(a){if(this._visibleOnKeyDown){this.__handleVisible(a)}},_keyUpHandler:function(a){if(this._visibleOnKeyDown){this.__handleHidden(a)}},_focusHandler:function(a){if(this._visibleOnFocus){this.__handleVisible(a)}},_blurHandler:function(a){if(this._visibleOnBlur){this.__handleHidden(a)}},_addBackgroundIFrame:function(){var a=(this._enableAnimations)?this._animationsContainer:this._targetContainer;if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){if(!this._childFrame){this._childFrame=document.createElement("iframe");this._childFrame.src="javascript:'<html></html>';";this._childFrame.style.position="absolute";this._childFrame.style.display="none";this._childFrame.scrolling="no";this._childFrame.frameBorder="0";this._childFrame.tabIndex="-1";this._childFrame.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";a.parentNode.insertBefore(this._childFrame,a)}this._setBounds(this._childFrame,this._getBounds(a));this._childFrame.style.display=a.style.display;if(a.currentStyle&&a.currentStyle.zIndex){this._childFrame.style.zIndex=a.currentStyle.zIndex}else{if(a.style.zIndex){this._childFrame.style.zIndex=a.style.zIndex}}}},_attach:function(){if(!this._dropDownIsChild){this._sourceElement.appendChild(this._targetContainer)}},_detach:function(){if(!this._dropDownIsChild){if(this.get_enableAnimations()){this._animationsContainer.appendChild(this._targetContainer)}else{document.forms[0].appendChild(this._targetContainer)}}},_setAnimationEndListener:function(a){this._animationEndListener=a},_getBounds:function(a){var b=$util.getPosition(a);return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0)},_setBounds:function(a,b){if(!a){throw Error.argumentNull("element")}if(!b){throw Error.argumentNull("bounds")}$util.setAbsoluteHeight(a,b.height);$util.setAbsoluteWidth(a,b.width);this.__setLocation(a,b)},_adjustDropDownPosition:function(f,g,c,h){this._offScreen=false;var a=c,b=h;var i=(this._enableAnimations)?this._animationsContainer:this._targetContainer;var j=Sys.UI.DomElement.getLocation(i);var k=Sys.UI.DomElement.getLocation(this._sourceElement);var n=false;var m=0;var e=0;if(document.compatMode=="BackCompat"){m=document.body.clientHeight;e=document.body.scrollTop}else{m=window.innerHeight;e=window.pageYOffset;if($util.IsIE){m=document.documentElement.clientHeight;e=document.documentElement.scrollTop}}if(this._outerContainer){var l=Sys.UI.DomElement.getLocation(this._outerContainer);var d=Sys.UI.DomElement.getBounds(this._outerContainer);if(f.height<d.height){if(j.y+f.height>l.y+d.height){if(j.y-f.height>l.y){b-=f.height;if(this.get_position()!=$IG.DropDownPopupPosition.Left&&this.get_position()!=$IG.DropDownPopupPosition.Right){b-=g.height}else{b+=g.height}n=true;this._offScreen=true;b-=this._offsetY*2}}}}else{if(f.height>m-k.y+e){b-=f.height;if(this.get_position()!=$IG.DropDownPopupPosition.Left&&this.get_position()!=$IG.DropDownPopupPosition.Right){b-=g.height}else{b+=g.height}n=true;this._offScreen=true;b-=this._offsetY*2}}if(n){i.style.marginTop=b+"px"}},__handleHidden:function(a){if(this._visible){this.set_visible(false)}},__handleVisible:function(a){if(!this._visible){this.set_visible(true)}},__handleTrigger:function(a){if(this._visible){this.set_visible(false)}else{this.set_visible(true)}},__showDropDown:function(){var h=(this._enableAnimations)?this._animationsContainer:this._targetContainer;h.style.position="absolute";h.style.display="";h.style.visibility="visible";h.style.zIndex=this._zIndex;var a=0,b=0;b=Sys.UI.DomElement.getBounds(this._sourceElement).height;var i=this._targetBounds;var d=Sys.UI.DomElement.getBounds(this._sourceElement);var c=this._position==$IG.DropDownPopupPosition.TopLeft||this._position==$IG.DropDownPopupPosition.TopRight;switch(this._position){case $IG.DropDownPopupPosition.Default:break;case $IG.DropDownPopupPosition.Center:a+=d.width/2;a-=i.width/2;break;case $IG.DropDownPopupPosition.Left:a-=i.width;b-=d.height;break;case $IG.DropDownPopupPosition.Right:a+=d.width;b-=d.height;break;case $IG.DropDownPopupPosition.BottomLeft:break;case $IG.DropDownPopupPosition.BottomRight:a+=d.width;a-=i.width;break;case $IG.DropDownPopupPosition.TopLeft:b-=i.height;b-=d.height;break;case $IG.DropDownPopupPosition.TopRight:a+=d.width;a-=i.width;b-=i.height;b-=d.height;break;default:break}h.style.marginLeft="";h.style.marginTop="";var e=Sys.UI.DomElement.getLocation(this._sourceElement),f=Sys.UI.DomElement.getLocation(h);if(Sys.Browser.agent==Sys.Browser.Safari&&this._sourceElement.nodeName=="TD"){b-=this._sourceElement.offsetTop;b+=this._sourceElement.parentNode.offsetTop}if(this._outerContainer&&Sys.Browser.agent==Sys.Browser.Opera){b-=this._outerContainer.scrollTop}a+=e.x-f.x;b+=e.y-f.y;a+=this._offsetX;if(c){b-=this._offsetY}else{b+=this._offsetY}h.style.marginLeft=a+"px";h.style.marginTop=b+"px";if(!c&&this._enableAutomaticPositioning){this._adjustDropDownPosition(i,d,a,b)}this._targetContainer.style.display="";this._targetContainer.style.visibility="visible";var g=Sys.UI.DomElement.getBounds(this._targetContainer).height;this._containerHeight=g;this._addBackgroundIFrame();this._dropDownAnimation.set_maxHeight(this._containerHeight);if(this._enableAnimations){this._dropDownAnimation.play()}},__hideDropDown:function(){if(this._enableAnimations){this._dropDownAnimation.play()}else{this._targetContainer.style.display="none";this._targetContainer.style.visibility="hidden";if(this._childFrame){this._childFrame.style.display="none"}}},__notifyAnimationEnd:function(){if(this._animationEndListener!=null&&this._animationEndListener._onAnimationEnd){this._animationEndListener._onAnimationEnd()}},__setLocation:function(a,b){Sys.UI.DomElement.setLocation(a,b.x,b.y)}};$IG.DropDownBehavior.registerClass("Infragistics.Web.UI.DropDownBehavior");$IG.UIObjectDropDownBehavior=function(){};$IG.UIObjectDropDownBehavior.prototype={};$IG.UIObjectDropDownBehavior.registerClass("Infragistics.Web.UI.UIObjectDropDownBehavior");$IG.DropDownEvents=function(a){this._handlers={};this._behavior=a};$IG.DropDownEvents.prototype={addSetVisibleHandler:function(a){this.__addHandler("SetVisible",a,$IG.DropDownEventArgs)},addSetHiddenHandler:function(a){this.__addHandler("SetHidden",a,$IG.DropDownEventArgs)},addSettingHiddenHandler:function(a){this.__addHandler("SettingHidden",a,$IG.CancelDropDownEventArgs)},addSettingVisibleHandler:function(a){this.__addHandler("SettingVisible",a,$IG.CancelDropDownEventArgs)},removeSetVisibleHandler:function(){this.__removeHandler("SetVisible")},removeSettingVisibleHandler:function(){this.__removeHandler("SettingVisible")},removeSetHiddenHandler:function(){this.__removeHandler("SetHidden")},removeSettingHiddenHandler:function(){this.__removeHandler("SettingHidden")},__addHandler:function(e,a,c){var b=this._handlers[e];if(!b){this._handlers[e]=b=[]}var d=-1;while(++d<b.length){if(b[d]){break}}b[d]=[a,c]},__removeHandler:function(e,c,f){var b=this._handlers[e];if(!b){return}var a=-1;while(++a<b.length){var d=b[a];if(d&&d[0]==c){b[a]=null}}},_fireEvent:function(f,g){var b=this._handlers[f];var c=b?b.length:0;for(var a=0;a<c;a++){var d=b[a];if(!d){continue}var e=d[0];var h=new d[1](g);e(this._behavior,h);if(h._cancel){return true}}return false}};$IG.DropDownEvents.registerClass("Infragistics.Web.UI.DropDownEvents");$IG.DropDownEventArgs=function(a){this._behavior=a};$IG.DropDownEventArgs.prototype={get_source:function(){return this._behavior.get_sourceElement()},get_targetContainer:function(){return this._behavior.get_targetContainer()},get_targetContent:function(){return this._behavior.get_targetContent()},get_dropDownBehavior:function(){return this._behavior}};$IG.DropDownEventArgs.registerClass("Infragistics.Web.UI.DropDownEventArgs");$IG.CancelDropDownEventArgs=function(){this._cancel=false;$IG.CancelDropDownEventArgs.initializeBase(this)};$IG.CancelDropDownEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};$IG.CancelDropDownEventArgs.registerClass("Infragistics.Web.UI.CancelDropDownEventArgs",$IG.DropDownEventArgs);$IG.DropDownAnimation=function(a){this._dropDownBehavior=a;this._increaseDelta=0;this._marginDelta=0;this._accumulatedHeight=0;this._maxHeight=0;this._minHeight=0;this._maxMargin=0;this._container=null;this._isTop=false;this._accumulatedMarginTop=0;$IG.DropDownAnimation.initializeBase(this)};$IG.DropDownAnimation.prototype={set_maxHeight:function(a){this._maxHeight=a},onBegin:function(){this._container=this._dropDownBehavior.get_animationsContainer();var a=this._dropDownBehavior.get_position();if(this._dropDownBehavior.get_visible()){this._accumulatedHeight=this._maxHeight;this._increaseDelta=-1*this._increaseDelta}if(this._dropDownBehavior.get_offScreen()||a==$IG.DropDownPopupPosition.TopLeft||a==$IG.DropDownPopupPosition.TopRight){this._isTop=true;this._marginDelta=this._increaseDelta;this._maxMargin=parseInt(this._container.style.marginTop);this._accumulatedMarginTop=this._maxMargin+this._maxHeight;if(this._dropDownBehavior.get_visible()){this._accumulatedMarginTop=this._maxMargin}this._container.style.marginTop=this._accumulatedMarginTop+"px"}},onNext:function(){this._increaseDelta=this._calc(this._dropDownBehavior.get_animationType(),this._time,0,this._maxHeight,this.get_duration());if(this._dropDownBehavior.get_visible()){this._increaseDelta=-1*this._increaseDelta}this._accumulatedHeight+=this._increaseDelta;if(this._accumulatedHeight>=this._maxHeight||this._accumulatedHeight<0){if(this._accumulatedHeight<0){this._accumulatedHeight=0}else{if(this._accumulatedHeight>this._maxHeight){this._accumulatedHeight=this._maxHeight}}this.stop()}if(this._isTop){this._accumulatedMarginTop-=this._increaseDelta;this._container.style.marginTop=parseInt(this._accumulatedMarginTop)+"px"}$util.setAbsoluteHeight(this._container,parseInt(this._accumulatedHeight));if(this._dropDownBehavior._childFrame){$util.setAbsoluteHeight(this._dropDownBehavior._childFrame,parseInt(this._accumulatedHeight))}},onEnd:function(){if(this._isTop){if(this._accumulatedMarginTop!=this._maxMargin){this._container.style.marginTop=this._maxMargin+"px"}}this._accumulatedHeight=0;this._accumulatedMarginTop=0;this._increaseDelta=0;this._marginDelta=0;this._isTop=false;if(this._dropDownBehavior.get_visible()){this._container.style.display="none";this._container.style.visibility="hidden";if(this._dropDownBehavior._childFrame){this._dropDownBehavior._childFrame.style.display="none"}this._dropDownBehavior._visible=false}else{this._dropDownBehavior._visible=true}this._dropDownBehavior.__notifyAnimationEnd()}};$IG.DropDownAnimation.registerClass("Infragistics.Web.UI.DropDownAnimation",$IG.AnimationBase);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();