//START AjaxControlToolkit.ExtenderBase.BaseScripts.js
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.BehaviorBase=function(c){var b=null,a=this;AjaxControlToolkit.BehaviorBase.initializeBase(a,[c]);a._clientStateFieldID=b;a._pageRequestManager=b;a._partialUpdateBeginRequestHandler=b;a._partialUpdateEndRequestHandler=b};AjaxControlToolkit.BehaviorBase.prototype={initialize:function(){AjaxControlToolkit.BehaviorBase.callBaseMethod(this,"initialize")},dispose:function(){var a=this;AjaxControlToolkit.BehaviorBase.callBaseMethod(a,"dispose");if(a._pageRequestManager){if(a._partialUpdateBeginRequestHandler){a._pageRequestManager.remove_beginRequest(a._partialUpdateBeginRequestHandler);a._partialUpdateBeginRequestHandler=null}if(a._partialUpdateEndRequestHandler){a._pageRequestManager.remove_endRequest(a._partialUpdateEndRequestHandler);a._partialUpdateEndRequestHandler=null}a._pageRequestManager=null}},get_ClientStateFieldID:function(){return this._clientStateFieldID},set_ClientStateFieldID:function(a){if(this._clientStateFieldID!=a){this._clientStateFieldID=a;this.raisePropertyChanged("ClientStateFieldID")}},get_ClientState:function(){if(this._clientStateFieldID){var a=document.getElementById(this._clientStateFieldID);if(a)return a.value}return null},set_ClientState:function(b){if(this._clientStateFieldID){var a=document.getElementById(this._clientStateFieldID);if(a)a.value=b}},registerPartialUpdateEvents:function(){var a=this;if(Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager){a._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();if(a._pageRequestManager){a._partialUpdateBeginRequestHandler=Function.createDelegate(a,a._partialUpdateBeginRequest);a._pageRequestManager.add_beginRequest(a._partialUpdateBeginRequestHandler);a._partialUpdateEndRequestHandler=Function.createDelegate(a,a._partialUpdateEndRequest);a._pageRequestManager.add_endRequest(a._partialUpdateEndRequestHandler)}}},_partialUpdateBeginRequest:function(){},_partialUpdateEndRequest:function(){}};AjaxControlToolkit.BehaviorBase.registerClass("AjaxControlToolkit.BehaviorBase",Sys.UI.Behavior);AjaxControlToolkit.DynamicPopulateBehaviorBase=function(c){var b=null,a=this;AjaxControlToolkit.DynamicPopulateBehaviorBase.initializeBase(a,[c]);a._DynamicControlID=b;a._DynamicContextKey=b;a._DynamicServicePath=b;a._DynamicServiceMethod=b;a._cacheDynamicResults=false;a._dynamicPopulateBehavior=b;a._populatingHandler=b;a._populatedHandler=b};AjaxControlToolkit.DynamicPopulateBehaviorBase.prototype={initialize:function(){var a=this;AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(a,"initialize");a._populatingHandler=Function.createDelegate(a,a._onPopulating);a._populatedHandler=Function.createDelegate(a,a._onPopulated)},dispose:function(){var a=this;if(a._populatedHandler){if(a._dynamicPopulateBehavior)a._dynamicPopulateBehavior.remove_populated(a._populatedHandler);a._populatedHandler=null}if(a._populatingHandler){if(a._dynamicPopulateBehavior)a._dynamicPopulateBehavior.remove_populating(a._populatingHandler);a._populatingHandler=null}if(a._dynamicPopulateBehavior){a._dynamicPopulateBehavior.dispose();a._dynamicPopulateBehavior=null}AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(a,"dispose")},populate:function(b){var a=this;if(a._dynamicPopulateBehavior&&a._dynamicPopulateBehavior.get_element()!=$get(a._DynamicControlID)){a._dynamicPopulateBehavior.dispose();a._dynamicPopulateBehavior=null}if(!a._dynamicPopulateBehavior&&a._DynamicControlID&&a._DynamicServiceMethod){a._dynamicPopulateBehavior=$create(AjaxControlToolkit.DynamicPopulateBehavior,{id:a.get_id()+"_DynamicPopulateBehavior",ContextKey:a._DynamicContextKey,ServicePath:a._DynamicServicePath,ServiceMethod:a._DynamicServiceMethod,cacheDynamicResults:a._cacheDynamicResults},null,null,$get(a._DynamicControlID));a._dynamicPopulateBehavior.add_populating(a._populatingHandler);a._dynamicPopulateBehavior.add_populated(a._populatedHandler)}if(a._dynamicPopulateBehavior)a._dynamicPopulateBehavior.populate(b?b:a._DynamicContextKey)},_onPopulating:function(b,a){this.raisePopulating(a)},_onPopulated:function(b,a){this.raisePopulated(a)},get_dynamicControlID:function(){return this._DynamicControlID},get_DynamicControlID:this.get_dynamicControlID,set_dynamicControlID:function(b){var a=this;if(a._DynamicControlID!=b){a._DynamicControlID=b;a.raisePropertyChanged("dynamicControlID");a.raisePropertyChanged("DynamicControlID")}},set_DynamicControlID:this.set_dynamicControlID,get_dynamicContextKey:function(){return this._DynamicContextKey},get_DynamicContextKey:this.get_dynamicContextKey,set_dynamicContextKey:function(b){var a=this;if(a._DynamicContextKey!=b){a._DynamicContextKey=b;a.raisePropertyChanged("dynamicContextKey");a.raisePropertyChanged("DynamicContextKey")}},set_DynamicContextKey:this.set_dynamicContextKey,get_dynamicServicePath:function(){return this._DynamicServicePath},get_DynamicServicePath:this.get_dynamicServicePath,set_dynamicServicePath:function(b){var a=this;if(a._DynamicServicePath!=b){a._DynamicServicePath=b;a.raisePropertyChanged("dynamicServicePath");a.raisePropertyChanged("DynamicServicePath")}},set_DynamicServicePath:this.set_dynamicServicePath,get_dynamicServiceMethod:function(){return this._DynamicServiceMethod},get_DynamicServiceMethod:this.get_dynamicServiceMethod,set_dynamicServiceMethod:function(b){var a=this;if(a._DynamicServiceMethod!=b){a._DynamicServiceMethod=b;a.raisePropertyChanged("dynamicServiceMethod");a.raisePropertyChanged("DynamicServiceMethod")}},set_DynamicServiceMethod:this.set_dynamicServiceMethod,get_cacheDynamicResults:function(){return this._cacheDynamicResults},set_cacheDynamicResults:function(a){if(this._cacheDynamicResults!=a){this._cacheDynamicResults=a;this.raisePropertyChanged("cacheDynamicResults")}},add_populated:function(a){this.get_events().addHandler("populated",a)},remove_populated:function(a){this.get_events().removeHandler("populated",a)},raisePopulated:function(b){var a=this.get_events().getHandler("populated");if(a)a(this,b)},add_populating:function(a){this.get_events().addHandler("populating",a)},remove_populating:function(a){this.get_events().removeHandler("populating",a)},raisePopulating:function(b){var a=this.get_events().getHandler("populating");if(a)a(this,b)}};AjaxControlToolkit.DynamicPopulateBehaviorBase.registerClass("AjaxControlToolkit.DynamicPopulateBehaviorBase",AjaxControlToolkit.BehaviorBase);AjaxControlToolkit.ControlBase=function(b){var a=this;AjaxControlToolkit.ControlBase.initializeBase(a,[b]);a._clientStateField=null;a._callbackTarget=null;a._onsubmit$delegate=Function.createDelegate(a,a._onsubmit);a._oncomplete$delegate=Function.createDelegate(a,a._oncomplete);a._onerror$delegate=Function.createDelegate(a,a._onerror)};AjaxControlToolkit.ControlBase.__doPostBack=function(c,b){if(!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())for(var a=0;a<AjaxControlToolkit.ControlBase.onsubmitCollection.length;a++)AjaxControlToolkit.ControlBase.onsubmitCollection[a]();Function.createDelegate(window,AjaxControlToolkit.ControlBase.__doPostBackSaved)(c,b)};AjaxControlToolkit.ControlBase.prototype={initialize:function(){var b="undefined",a=this;AjaxControlToolkit.ControlBase.callBaseMethod(a,"initialize");if(a._clientStateField)a.loadClientState(a._clientStateField.value);if(typeof Sys.WebForms!==b&&typeof Sys.WebForms.PageRequestManager!==b){Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements,a._onsubmit$delegate);if(AjaxControlToolkit.ControlBase.__doPostBackSaved==null||typeof AjaxControlToolkit.ControlBase.__doPostBackSaved==b){AjaxControlToolkit.ControlBase.__doPostBackSaved=window.__doPostBack;window.__doPostBack=AjaxControlToolkit.ControlBase.__doPostBack;AjaxControlToolkit.ControlBase.onsubmitCollection=[]}Array.add(AjaxControlToolkit.ControlBase.onsubmitCollection,a._onsubmit$delegate)}else $addHandler(document.forms[0],"submit",a._onsubmit$delegate)},dispose:function(){var b="undefined",a=this;if(typeof Sys.WebForms!==b&&typeof Sys.WebForms.PageRequestManager!==b){Array.remove(AjaxControlToolkit.ControlBase.onsubmitCollection,a._onsubmit$delegate);Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements,a._onsubmit$delegate)}else $removeHandler(document.forms[0],"submit",a._onsubmit$delegate);AjaxControlToolkit.ControlBase.callBaseMethod(a,"dispose")},findElement:function(a){return $get(this.get_id()+"_"+a.split(":").join("_"))},get_clientStateField:function(){return this._clientStateField},set_clientStateField:function(b){var a=this;if(a.get_isInitialized())throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_CannotSetClientStateField);if(a._clientStateField!=b){a._clientStateField=b;a.raisePropertyChanged("clientStateField")}},loadClientState:function(){},saveClientState:function(){return null},_invoke:function(g,d,h){var a=this;if(!a._callbackTarget)throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_ControlNotRegisteredForCallbacks);if(typeof WebForm_DoCallback==="undefined")throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_PageNotRegisteredForCallbacks);var e=[];for(var b=0;b<d.length;b++)e[b]=d[b];var c=a.saveClientState();if(c!=null&&!String.isInstanceOfType(c))throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_InvalidClientStateType);var f=Sys.Serialization.JavaScriptSerializer.serialize({name:g,args:e,state:a.saveClientState()});WebForm_DoCallback(a._callbackTarget,f,a._oncomplete$delegate,h,a._onerror$delegate,true)},_oncomplete:function(a,b){a=Sys.Serialization.JavaScriptSerializer.deserialize(a);if(a.error)throw Error.create(a.error);this.loadClientState(a.state);b(a.result)},_onerror:function(a){throw Error.create(a)},_onsubmit:function(){if(this._clientStateField)this._clientStateField.value=this.saveClientState();return true}};AjaxControlToolkit.ControlBase.registerClass("AjaxControlToolkit.ControlBase",Sys.UI.Control);
AjaxControlToolkit.Resources={
"PasswordStrength_InvalidWeightingRatios":"Strength Weighting ratios must have 4 elements","HTMLEditor_toolbar_button_FontSize_defaultValue":"default","HTMLEditor_toolbar_button_DesignMode_title":"Design mode","Animation_ChildrenNotAllowed":"AjaxControlToolkit.Animation.createAnimation cannot add child animations to type \"{0}\" that does not derive from AjaxControlToolkit.Animation.ParentAnimation","PasswordStrength_RemainingSymbols":"{0} symbol characters","HTMLEditor_toolbar_button_FixedForeColor_title":"Foreground color","HTMLEditor_toolbar_popup_LinkProperties_field_URL":"URL","ExtenderBase_CannotSetClientStateField":"clientStateField can only be set before initialization","HTMLEditor_toolbar_button_Bold_title":"Bold","RTE_PreviewHTML":"Preview HTML","HTMLEditor_toolbar_popup_LinkProperties_button_OK":"OK","HTMLEditor_toolbar_button_JustifyRight_title":"Justify Right","RTE_JustifyCenter":"Justify Center","PasswordStrength_RemainingUpperCase":"{0} more upper case characters","HTMLEditor_toolbar_popup_LinkProperties_button_Cancel":"Cancel","Animation_TargetNotFound":"AjaxControlToolkit.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control.  No element or control could be found corresponding to \"{0}\"","RTE_FontColor":"Font Color","RTE_LabelColor":"Label Color","Common_InvalidBorderWidthUnit":"A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth","HTMLEditor_toolbar_button_JustifyFull_title":"Justify","RTE_Heading":"Heading","Tabs_PropertySetBeforeInitialization":"{0} cannot be changed before initialization","HTMLEditor_toolbar_button_StrikeThrough_title":"Strike through","RTE_OrderedList":"Ordered List","HTMLEditor_toolbar_button_OnPastePlainText":"Plain text pasting is switched on. Just now: {0}","HTMLEditor_toolbar_button_RemoveLink_title":"Remove Link","HTMLEditor_toolbar_button_FontName_defaultValue":"default","HTMLEditor_toolbar_button_FontName_label":"Font","ReorderList_DropWatcherBehavior_NoChild":"Could not find child of list with id \"{0}\"","CascadingDropDown_MethodTimeout":"[Method timeout]","RTE_Columns":"Columns","RTE_InsertImage":"Insert Image","RTE_InsertTable":"Insert Table","RTE_Values":"Values","RTE_OK":"OK","ExtenderBase_PageNotRegisteredForCallbacks":"This Page has not been registered for callbacks","HTMLEditor_toolbar_button_InsertLink_title":"Insert/Edit URL link","Animation_NoDynamicPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\" or \"{1}\"","Animation_InvalidBaseType":"AjaxControlToolkit.Animation.registerAnimation can only register types that inherit from AjaxControlToolkit.Animation.Animation","RTE_UnorderedList":"Unordered List","ResizableControlBehavior_InvalidHandler":"{0} handler not a function, function name, or function text","Animation_InvalidColor":"Color must be a 7-character hex representation (e.g. #246ACF), not \"{0}\"","RTE_CellColor":"Cell Color","PasswordStrength_RemainingMixedCase":"Mixed case characters","HTMLEditor_toolbar_button_HtmlMode_title":"HTML text","RTE_Italic":"Italic","CascadingDropDown_NoParentElement":"Failed to find parent element \"{0}\"","ValidatorCallout_DefaultErrorMessage":"This control is invalid","HTMLEditor_toolbar_button_DecreaseIndent_title":"Decrease Indent","RTE_Indent":"Indent","ReorderList_DropWatcherBehavior_CallbackError":"Reorder failed, see details below.\\r\\n\\r\\n{0}","PopupControl_NoDefaultProperty":"No default property supported for control \"{0}\" of type \"{1}\"","RTE_Normal":"Normal","PopupExtender_NoParentElement":"Couldn\u0027t find parent element \"{0}\"","RTE_ViewValues":"View Values","RTE_Legend":"Legend","RTE_Labels":"Labels","RTE_CellSpacing":"Cell Spacing","PasswordStrength_RemainingNumbers":"{0} more numbers","HTMLEditor_toolbar_popup_LinkProperties_field_Target":"Target","HTMLEditor_toolbar_button_PreviewMode_title":"Preview","RTE_Border":"Border","RTE_Create":"Create","RTE_BackgroundColor":"Background Color","RTE_Cancel":"Cancel","HTMLEditor_toolbar_button_PasteText_title":"Paste Plain Text","RTE_JustifyFull":"Justify Full","RTE_JustifyLeft":"Justify Left","RTE_Cut":"Cut","ResizableControlBehavior_CannotChangeProperty":"Changes to {0} not supported","RTE_ViewSource":"View Source","Common_InvalidPaddingUnit":"A unit type of \"{0}\" is invalid for parsePadding","RTE_Paste":"Paste","ExtenderBase_ControlNotRegisteredForCallbacks":"This Control has not been registered for callbacks","Calendar_Today":"Today: {0}","MultiHandleSlider_CssHeightWidthRequired":"You must specify a CSS width and height for all handle styles as well as the rail.","Common_DateTime_InvalidFormat":"Invalid format","HTMLEditor_toolbar_button_Copy_title":"Copy","ListSearch_DefaultPrompt":"Type to search","CollapsiblePanel_NoControlID":"Failed to find element \"{0}\"","RTE_ViewEditor":"View Editor","HTMLEditor_toolbar_popup_LinkProperties_field_Target_Current":"Current window","RTE_BarColor":"Bar Color","HTMLEditor_toolbar_button_Underline_title":"Underline","PasswordStrength_DefaultStrengthDescriptions":"NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!","HTMLEditor_toolbar_button_SuperScript_title":"Super script","HTMLEditor_toolbar_button_Ltr_title":"Left to right direction","HTMLEditor_toolbar_button_RemoveAlignment_title":"Remove Alignment","HTMLEditor_toolbar_button_OrderedList_title":"Ordered List","HTMLEditor_toolbar_popup_LinkProperties_field_Target_New":"New window","HTMLEditor_toolbar_popup_LinkProperties_field_Target_Top":"Top window","HTMLEditor_toolbar_button_JustifyCenter_title":"Justify Center","RTE_Inserttexthere":"Insert text here","Animation_UknownAnimationName":"AjaxControlToolkit.Animation.createAnimation could not find an Animation corresponding to the name \"{0}\"","ExtenderBase_InvalidClientStateType":"saveClientState must return a value of type String","HTMLEditor_toolbar_button_JustifyLeft_title":"Justify Left","Rating_CallbackError":"An unhandled exception has occurred:\\r\\n{0}","HTMLEditor_toolbar_button_Undo_title":"Undo","HTMLEditor_toolbar_button_Redo_title":"Redo","Tabs_OwnerExpected":"owner must be set before initialize","DynamicPopulate_WebServiceTimeout":"Web service call timed out","PasswordStrength_RemainingLowerCase":"{0} more lower case characters","HTMLEditor_toolbar_button_BulletedList_title":"Bulleted List","HTMLEditor_toolbar_button_Paste_title":"Paste","Animation_MissingAnimationName":"AjaxControlToolkit.Animation.createAnimation requires an object with an AnimationName property","HTMLEditor_toolbar_button_PasteWord_title":"Paste from MS Word (with cleanup)","HTMLEditor_toolbar_button_Italic_title":"Italic","RTE_JustifyRight":"Justify Right","Tabs_ActiveTabArgumentOutOfRange":"Argument is not a member of the tabs collection","RTE_CellPadding":"Cell Padding","HTMLEditor_toolbar_button_ForeColorClear_title":"Clear foreground color","RTE_ClearFormatting":"Clear Formatting","AlwaysVisible_ElementRequired":"AjaxControlToolkit.AlwaysVisibleControlBehavior must have an element","HTMLEditor_toolbar_button_SubScript_title":"Sub script","Slider_NoSizeProvided":"Please set valid values for the height and width attributes in the slider\u0027s CSS classes","DynamicPopulate_WebServiceError":"Web Service call failed: {0}","PasswordStrength_StrengthPrompt":"Strength: ","HTMLEditor_toolbar_button_Rtl_title":"Right to left direction","PasswordStrength_RemainingCharacters":"{0} more characters","HTMLEditor_toolbar_button_BackColorClear_title":"Clear background color","PasswordStrength_Satisfied":"Nothing more required","RTE_Hyperlink":"Hyperlink","Animation_NoPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\"","PasswordStrength_InvalidStrengthDescriptionStyles":"Text Strength description style classes must match the number of text descriptions.","HTMLEditor_toolbar_button_Use_verb":"Use {0}","HTMLEditor_toolbar_popup_LinkProperties_field_Target_Parent":"Parent window","PasswordStrength_GetHelpRequirements":"Get help on password requirements","HTMLEditor_toolbar_button_FixedBackColor_title":"Background color","PasswordStrength_InvalidStrengthDescriptions":"Invalid number of text strength descriptions specified","RTE_Underline":"Underline","HTMLEditor_toolbar_button_IncreaseIndent_title":"Increase Indent","Tabs_PropertySetAfterInitialization":"{0} cannot be changed after initialization","RTE_Rows":"Rows","RTE_Redo":"Redo","RTE_Size":"Size","RTE_Undo":"Undo","RTE_Bold":"Bold","RTE_Copy":"Copy","RTE_Font":"Font","HTMLEditor_toolbar_button_FontSize_label":"Size","HTMLEditor_toolbar_button_Cut_title":"Cut","CascadingDropDown_MethodError":"[Method error {0}]","HTMLEditor_toolbar_button_InsertLink_message_EmptyURL":"URL can not be empty","RTE_BorderColor":"Border Color","HTMLEditor_toolbar_button_RemoveStyles_title":"Remove styles","RTE_Paragraph":"Paragraph","RTE_InsertHorizontalRule":"Insert Horizontal Rule","HTMLEditor_toolbar_button_Paragraph_title":"Make Paragraph","Common_UnitHasNoDigits":"No digits","RTE_Outdent":"Outdent","Common_DateTime_InvalidTimeSpan":"\"{0}\" is not a valid TimeSpan format","Animation_CannotNestSequence":"AjaxControlToolkit.Animation.SequenceAnimation cannot be nested inside AjaxControlToolkit.Animation.ParallelAnimation","HTMLEditor_toolbar_button_InsertHR_title":"Insert horizontal rule","HTMLEditor_toolbar_button_OnPasteFromMSWord":"Pasting from MS Word is switched on. Just now: {0}","Shared_BrowserSecurityPreventsPaste":"Your browser security settings don\u0027t permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."};
//END AjaxControlToolkit.ExtenderBase.BaseScripts.js
//START AjaxControlToolkit.Common.Common.js
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.BoxSide=function(){};AjaxControlToolkit.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide",false);AjaxControlToolkit._CommonToolkitScripts=function(){};AjaxControlToolkit._CommonToolkitScripts.prototype={_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],getCurrentStyle:function(b,c,d){var e="undefined",a=null;if(b){if(b.currentStyle)a=b.currentStyle[c];else if(document.defaultView&&document.defaultView.getComputedStyle){var f=document.defaultView.getComputedStyle(b,null);if(f)a=f[c]}if(!a&&b.style.getPropertyValue)a=b.style.getPropertyValue(c);else if(!a&&b.style.getAttribute)a=b.style.getAttribute(c)}if(!a||a==""||typeof a===e)if(typeof d!=e)a=d;else a=null;return a},getInheritedBackgroundColor:function(b){var d="backgroundColor",c="#FFFFFF";if(!b)return c;var a=this.getCurrentStyle(b,d);try{while(!a||a==""||a=="transparent"||a=="rgba(0, 0, 0, 0)"){b=b.parentNode;if(!b)a=c;else a=this.getCurrentStyle(b,d)}}catch(e){a=c}return a},getLocation:function(a){if(a===document.documentElement)return new Sys.UI.Point(0,0);if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7){if(a.window===a||a.nodeType===9||!a.getClientRects||!a.getBoundingClientRect)return new Sys.UI.Point(0,0);var b=a.getClientRects();if(!b||!b.length)return new Sys.UI.Point(0,0);var c=b[0],k=0,l=0,f=false;try{f=a.ownerDocument.parentWindow.frameElement}catch(m){f=true}if(f){var e=a.getBoundingClientRect();if(!e)return new Sys.UI.Point(0,0);var g=c.left,h=c.top;for(var i=1;i<b.length;i++){var d=b[i];if(d.left<g)g=d.left;if(d.top<h)h=d.top}k=g-e.left;l=h-e.top}var j=a.document.documentElement;return new Sys.UI.Point(c.left-2-k+j.scrollLeft,c.top-2-l+j.scrollTop)}return Sys.UI.DomElement.getLocation(a)},setLocation:function(b,a){Sys.UI.DomElement.setLocation(b,a.x,a.y)},getContentSize:function(a){if(!a)throw Error.argumentNull("element");var d=this.getSize(a),c=this.getBorderBox(a),b=this.getPaddingBox(a);return {width:d.width-c.horizontal-b.horizontal,height:d.height-c.vertical-b.vertical}},getSize:function(a){if(!a)throw Error.argumentNull("element");return {width:a.offsetWidth,height:a.offsetHeight}},setContentSize:function(a,b){var d="border-box",c=this;if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("size");if(c.getCurrentStyle(a,"MozBoxSizing")==d||c.getCurrentStyle(a,"BoxSizing")==d){var f=c.getBorderBox(a),e=c.getPaddingBox(a);b={width:b.width+f.horizontal+e.horizontal,height:b.height+f.vertical+e.vertical}}a.style.width=b.width.toString()+"px";a.style.height=b.height.toString()+"px"},setSize:function(a,b){if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("size");var d=this.getBorderBox(a),c=this.getPaddingBox(a),e={width:b.width-d.horizontal-c.horizontal,height:b.height-d.vertical-c.vertical};this.setContentSize(a,e)},getBounds:function(a){var b=$common.getLocation(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");this.setSize(a,b);$common.setLocation(a,b)},getClientBounds:function(){var b,a;if(document.compatMode=="CSS1Compat"){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{b=document.body.clientWidth;a=document.body.clientHeight}return new Sys.UI.Bounds(0,0,b,a)},getMarginBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getMargin(b,AjaxControlToolkit.BoxSide.Top),right:c.getMargin(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getMargin(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getMargin(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getBorderBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Top),right:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getPaddingBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getPadding(b,AjaxControlToolkit.BoxSide.Top),right:c.getPadding(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getPadding(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getPadding(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},isBorderVisible:function(b,a){if(!b)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));var d=this._borderStyleNames[a],c=this.getCurrentStyle(b,d);return c!="none"},getMargin:function(b,a){if(!b)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));var d=this._marginWidthNames[a],c=this.getCurrentStyle(b,d);try{return this.parsePadding(c)}catch(e){return 0}},getBorderWidth:function(c,a){var b=this;if(!c)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));if(!b.isBorderVisible(c,a))return 0;var e=b._borderWidthNames[a],d=b.getCurrentStyle(c,e);return b.parseBorderWidth(d)},getPadding:function(b,a){if(!b)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));var d=this._paddingWidthNames[a],c=this.getCurrentStyle(b,d);return this.parsePadding(c)},parseBorderWidth:function(d){var h="thick",g="medium",f="thin",e=this;if(!e._borderThicknesses){var c={},a=document.createElement("div");a.style.visibility="hidden";a.style.position="absolute";a.style.fontSize="1px";document.body.appendChild(a);var b=document.createElement("div");b.style.height="0px";b.style.overflow="hidden";a.appendChild(b);var i=a.offsetHeight;b.style.borderTop="solid black";b.style.borderTopWidth=f;c[f]=a.offsetHeight-i;b.style.borderTopWidth=g;c[g]=a.offsetHeight-i;b.style.borderTopWidth=h;c[h]=a.offsetHeight-i;a.removeChild(b);document.body.removeChild(a);e._borderThicknesses=c}if(d){switch(d){case f:case g:case h:return e._borderThicknesses[d];case "inherit":return 0}var j=e.parseUnit(d);Sys.Debug.assert(j.type=="px",String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit,j.type));return j.size}return 0},parsePadding:function(a){if(a){if(a=="inherit")return 0;var b=this.parseUnit(a);Sys.Debug.assert(b.type=="px",String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit,b.type));return b.size}return 0},parseUnit:function(a){if(!a)throw Error.argumentNull("value");a=a.trim().toLowerCase();var g=a.length,c=-1;for(var f=0;f<g;f++){var b=a.substr(f,1);if((b<"0"||b>"9")&&b!="-"&&b!="."&&b!=",")break;c=f}if(c==-1)throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);var e,d;if(c<g-1)e=a.substring(c+1).trim();else e="px";d=parseFloat(a.substr(0,c+1));if(e=="px")d=Math.floor(d);return {size:d,type:e}},getElementOpacity:function(a){if(!a)throw Error.argumentNull("element");var b=false,c;if(a.filters){var e=a.filters;if(e.length!==0){var d=e["DXImageTransform.Microsoft.Alpha"];if(d){c=d.opacity/100;b=true}}}else{c=this.getCurrentStyle(a,"opacity",1);b=true}if(b===false)return 1;return parseFloat(c)},setElementOpacity:function(a,b){if(!a)throw Error.argumentNull("element");if(a.filters){var e=a.filters,c=true;if(e.length!==0){var d=e["DXImageTransform.Microsoft.Alpha"];if(d){c=false;d.opacity=b*100}}if(c)a.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+b*100+")"}else a.style.opacity=b},getVisible:function(a){return a&&"none"!=$common.getCurrentStyle(a,"display")&&"hidden"!=$common.getCurrentStyle(a,"visibility")},setVisible:function(a,b){if(a&&b!=$common.getVisible(a)){if(b)if(a.style.removeAttribute)a.style.removeAttribute("display");else a.style.removeProperty("display");else a.style.display="none";a.style.visibility=b?"visible":"hidden"}},resolveFunction:function(value){if(value)if(value instanceof Function)return value;else if(String.isInstanceOfType(value)&&value.length>0){var func;if((func=window[value])instanceof Function)return func;else if((func=eval(value))instanceof Function)return func}return null},addCssClasses:function(c,b){for(var a=0;a<b.length;a++)Sys.UI.DomElement.addCssClass(c,b[a])},removeCssClasses:function(c,b){for(var a=0;a<b.length;a++)Sys.UI.DomElement.removeCssClass(c,b[a])},setStyle:function(a,b){$common.applyProperties(a.style,b)},removeHandlers:function(c,a){for(var b in a)$removeHandler(c,b,a[b])},overlaps:function(a,b){return a.x<b.x+b.width&&b.x<a.x+a.width&&a.y<b.y+b.height&&b.y<a.y+a.height},containsPoint:function(a,b,c){return b>=a.x&&b<a.x+a.width&&c>=a.y&&c<a.y+a.height},isKeyDigit:function(a){return 48<=a&&a<=57},isKeyNavigation:function(a){return Sys.UI.Key.left<=a&&a<=Sys.UI.Key.down},padLeft:function(c,b,d,a){return $common._pad(c,b||2,d||" ","l",a||false)},padRight:function(c,b,d,a){return $common._pad(c,b||2,d||" ","r",a||false)},_pad:function(c,b,h,e,g){c=c.toString();var f=c.length,d=new Sys.StringBuilder;if(e=="r")d.append(c);while(f<b){d.append(h);f++}if(e=="l")d.append(c);var a=d.toString();if(g&&a.length>b)if(e=="l")a=a.substr(a.length-b,b);else a=a.substr(0,b);return a},__DOMEvents:{focusin:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("focusin",true,false,window,1)}},focusout:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("focusout",true,false,window,1)}},activate:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("activate",true,true,window,1)}},focus:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("focus",false,false,window,1)}},blur:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("blur",false,false,window,1)}},click:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("click",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},dblclick:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("click",true,true,window,2,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mousedown:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mousedown",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mouseup:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mouseup",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mouseover:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mouseover",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mousemove:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mousemove",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mouseout:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mousemove",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},load:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("load",false,false)}},unload:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("unload",false,false)}},select:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("select",true,false)}},change:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("change",true,false)}},submit:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("submit",true,true)}},reset:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("reset",true,false)}},resize:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("resize",true,false)}},scroll:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("scroll",true,false)}}},tryFireRawEvent:function(a,b){try{if(a.fireEvent){a.fireEvent("on"+b.type,b);return true}else if(a.dispatchEvent){a.dispatchEvent(b);return true}}catch(c){}return false},tryFireEvent:function(e,d,c){try{if(document.createEventObject){var a=document.createEventObject();$common.applyProperties(a,c||{});e.fireEvent("on"+d,a);return true}else if(document.createEvent){var b=$common.__DOMEvents[d];if(b){var a=document.createEvent(b.eventGroup);b.init(a,c||{});e.dispatchEvent(a);return true}}}catch(a){}return false},wrapElement:function(a,b,c){var d=a.parentNode;d.replaceChild(b,a);(c||b).appendChild(a)},unwrapElement:function(b,a){var c=a.parentNode;if(c!=null){$common.removeElement(b);c.replaceChild(b,a)}},removeElement:function(a){var b=a.parentNode;if(b!=null)b.removeChild(a)},applyProperties:function(d,c){for(var b in c){var a=c[b];if(a!=null&&Object.getType(a)===Object){var e=d[b];$common.applyProperties(e,a)}else d[b]=a}},createElementFromTemplate:function(a,j,e){var c=null,b="undefined";if(typeof a.nameTable!=b){var g=a.nameTable;if(String.isInstanceOfType(g))g=e[g];if(g!=c)e=g}var l=c;if(typeof a.name!==b)l=a.name;var d=document.createElement(a.nodeName);if(typeof a.name!==b&&e)e[a.name]=d;if(typeof a.parent!==b&&j==c){var h=a.parent;if(String.isInstanceOfType(h))h=e[h];if(h!=c)j=h}if(typeof a.properties!==b&&a.properties!=c)$common.applyProperties(d,a.properties);if(typeof a.cssClasses!==b&&a.cssClasses!=c)$common.addCssClasses(d,a.cssClasses);if(typeof a.events!==b&&a.events!=c)$addHandlers(d,a.events);if(typeof a.visible!==b&&a.visible!=c)this.setVisible(d,a.visible);if(j)j.appendChild(d);if(typeof a.opacity!==b&&a.opacity!=c)$common.setElementOpacity(d,a.opacity);if(typeof a.children!==b&&a.children!=c)for(var k=0;k<a.children.length;k++){var m=a.children[k];$common.createElementFromTemplate(m,d,e)}var i=d;if(typeof a.contentPresenter!==b&&a.contentPresenter!=c)i=e[i];if(typeof a.content!==b&&a.content!=c){var f=a.content;if(String.isInstanceOfType(f))f=e[f];if(f.parentNode)$common.wrapElement(f,d,i);else i.appendChild(f)}return d},prepareHiddenElementForATDeviceUpdate:function(){var b="hiddenInputToUpdateATBuffer_CommonToolkitScripts",a=document.getElementById(b);if(!a){var a=document.createElement("input");a.setAttribute("type","hidden");a.setAttribute("value","1");a.setAttribute("id",b);a.setAttribute("name",b);if(document.forms[0])document.forms[0].appendChild(a)}},updateFormToRefreshATDeviceBuffer:function(){var b="value",a=document.getElementById("hiddenInputToUpdateATBuffer_CommonToolkitScripts");if(a)if(a.getAttribute(b)=="1")a.setAttribute(b,"0");else a.setAttribute(b,"1")}};var CommonToolkitScripts=AjaxControlToolkit.CommonToolkitScripts=new AjaxControlToolkit._CommonToolkitScripts,$common=CommonToolkitScripts;Sys.UI.DomElement.getVisible=$common.getVisible;Sys.UI.DomElement.setVisible=$common.setVisible;Sys.UI.Control.overlaps=$common.overlaps;AjaxControlToolkit._DomUtility=function(){};AjaxControlToolkit._DomUtility.prototype={isDescendant:function(c,b){for(var a=b.parentNode;a!=null;a=a.parentNode)if(a==c)return true;return false},isDescendantOrSelf:function(b,a){if(b===a)return true;return AjaxControlToolkit.DomUtility.isDescendant(b,a)},isAncestor:function(a,b){return AjaxControlToolkit.DomUtility.isDescendant(b,a)},isAncestorOrSelf:function(a,b){if(a===b)return true;return AjaxControlToolkit.DomUtility.isDescendant(b,a)},isSibling:function(d,c){var b=d.parentNode;for(var a=0;a<b.childNodes.length;a++)if(b.childNodes[a]==c)return true;return false}};AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");AjaxControlToolkit.DomUtility=new AjaxControlToolkit._DomUtility;AjaxControlToolkit.TextBoxWrapper=function(b){var a=this;AjaxControlToolkit.TextBoxWrapper.initializeBase(a,[b]);a._current=b.value;a._watermark=null;a._isWatermarked=false};AjaxControlToolkit.TextBoxWrapper.prototype={dispose:function(){this.get_element().AjaxControlToolkitTextBoxWrapper=null;AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this,"dispose")},get_Current:function(){this._current=this.get_element().value;return this._current},set_Current:function(a){this._current=a;this._updateElement()},get_Value:function(){if(this.get_IsWatermarked())return "";else return this.get_Current()},set_Value:function(b){var a=this;a.set_Current(b);if(!b||0==b.length){if(null!=a._watermark)a.set_IsWatermarked(true)}else a.set_IsWatermarked(false)},get_Watermark:function(){return this._watermark},set_Watermark:function(a){this._watermark=a;this._updateElement()},get_IsWatermarked:function(){return this._isWatermarked},set_IsWatermarked:function(b){var a=this;if(a._isWatermarked!=b){a._isWatermarked=b;a._updateElement();a._raiseWatermarkChanged()}},_updateElement:function(){var a=this,b=a.get_element();if(a._isWatermarked){if(b.value!=a._watermark)b.value=a._watermark}else if(b.value!=a._current)b.value=a._current},add_WatermarkChanged:function(a){this.get_events().addHandler("WatermarkChanged",a)},remove_WatermarkChanged:function(a){this.get_events().removeHandler("WatermarkChanged",a)},_raiseWatermarkChanged:function(){var a=this.get_events().getHandler("WatermarkChanged");if(a)a(this,Sys.EventArgs.Empty)}};AjaxControlToolkit.TextBoxWrapper.get_Wrapper=function(a){if(null==a.AjaxControlToolkitTextBoxWrapper)a.AjaxControlToolkitTextBoxWrapper=new AjaxControlToolkit.TextBoxWrapper(a);return a.AjaxControlToolkitTextBoxWrapper};AjaxControlToolkit.TextBoxWrapper.registerClass("AjaxControlToolkit.TextBoxWrapper",Sys.UI.Behavior);AjaxControlToolkit.TextBoxWrapper.validatorGetValue=function(b){var a=$get(b);if(a&&a.AjaxControlToolkitTextBoxWrapper)return a.AjaxControlToolkitTextBoxWrapper.get_Value();return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(b)};if(typeof ValidatorGetValue=="function"){AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue=ValidatorGetValue;ValidatorGetValue=AjaxControlToolkit.TextBoxWrapper.validatorGetValue}if(Sys.CultureInfo.prototype._getAbbrMonthIndex)try{Sys.CultureInfo.prototype._getAbbrMonthIndex("")}catch(ex){Sys.CultureInfo.prototype._getAbbrMonthIndex=function(b){var a=this;if(!a._upperAbbrMonths)a._upperAbbrMonths=a._toUpperArray(a.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(a._upperAbbrMonths,a._toUpper(b))};Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex};
//END AjaxControlToolkit.Common.Common.js
//START AjaxControlToolkit.Compat.Timer.Timer.js
Sys.Timer=function(){var a=this;Sys.Timer.initializeBase(a);a._interval=1e3;a._enabled=false;a._timer=null};Sys.Timer.prototype={get_interval:function(){return this._interval},set_interval:function(b){var a=this;if(a._interval!==b){a._interval=b;a.raisePropertyChanged("interval");if(!a.get_isUpdating()&&a._timer!==null){a._stopTimer();a._startTimer()}}},get_enabled:function(){return this._enabled},set_enabled:function(b){var a=this;if(b!==a.get_enabled()){a._enabled=b;a.raisePropertyChanged("enabled");if(!a.get_isUpdating())if(b)a._startTimer();else a._stopTimer()}},add_tick:function(a){this.get_events().addHandler("tick",a)},remove_tick:function(a){this.get_events().removeHandler("tick",a)},dispose:function(){this.set_enabled(false);this._stopTimer();Sys.Timer.callBaseMethod(this,"dispose")},updated:function(){var a=this;Sys.Timer.callBaseMethod(a,"updated");if(a._enabled){a._stopTimer();a._startTimer()}},_timerCallback:function(){var a=this.get_events().getHandler("tick");if(a)a(this,Sys.EventArgs.Empty)},_startTimer:function(){var a=this;a._timer=window.setInterval(Function.createDelegate(a,a._timerCallback),a._interval)},_stopTimer:function(){window.clearInterval(this._timer);this._timer=null}};Sys.Timer.descriptor={properties:[{name:"interval",type:Number},{name:"enabled",type:Boolean}],events:[{name:"tick"}]};Sys.Timer.registerClass("Sys.Timer",Sys.Component);
//END AjaxControlToolkit.Compat.Timer.Timer.js
//START AjaxControlToolkit.Animation.Animations.js
Type.registerNamespace("AjaxControlToolkit.Animation");var $AA=AjaxControlToolkit.Animation;$AA.registerAnimation=function(b,a){if(a&&(a===$AA.Animation||a.inheritsFrom&&a.inheritsFrom($AA.Animation))){if(!$AA.__animations)$AA.__animations={};$AA.__animations[b.toLowerCase()]=a;a.play=function(){var b=new a;a.apply(b,arguments);b.initialize();var c=Function.createDelegate(b,function(){b.remove_ended(c);c=null;b.dispose()});b.add_ended(c);b.play()}}else throw Error.argumentType("type",a,$AA.Animation,AjaxControlToolkit.Resources.Animation_InvalidBaseType)};$AA.buildAnimation=function(a,c){if(!a||a==="")return null;var b;a="("+a+")";if(!Sys.Debug.isDebug)try{b=Sys.Serialization.JavaScriptSerializer.deserialize(a)}catch(d){}else b=Sys.Serialization.JavaScriptSerializer.deserialize(a);return $AA.createAnimation(b,c)};$AA.createAnimation=function(c,l){var g="obj";if(!c||!c.AnimationName)throw Error.argument(g,AjaxControlToolkit.Resources.Animation_MissingAnimationName);var b=$AA.__animations[c.AnimationName.toLowerCase()];if(!b)throw Error.argument("type",String.format(AjaxControlToolkit.Resources.Animation_UknownAnimationName,c.AnimationName));var d=new b;if(l)d.set_target(l);if(c.AnimationChildren&&c.AnimationChildren.length)if($AA.ParentAnimation.isInstanceOfType(d))for(var k=0;k<c.AnimationChildren.length;k++){var m=$AA.createAnimation(c.AnimationChildren[k]);if(m)d.add(m)}else throw Error.argument(g,String.format(AjaxControlToolkit.Resources.Animation_ChildrenNotAllowed,b.getName()));var h=b.__animationProperties;if(!h){b.__animationProperties={};b.resolveInheritance();for(var j in b.prototype)if(j.startsWith("set_"))b.__animationProperties[j.substr(4).toLowerCase()]=j;delete b.__animationProperties["id"];h=b.__animationProperties}for(var e in c){var f=e.toLowerCase();if(f=="animationname"||f=="animationchildren")continue;var i=c[e],a=h[f];if(a&&String.isInstanceOfType(a)&&d[a])if(!Sys.Debug.isDebug)try{d[a](i)}catch(n){}else d[a](i);else if(f.endsWith("script")){a=h[f.substr(0,e.length-6)];if(a&&String.isInstanceOfType(a)&&d[a])d.DynamicProperties[a]=i;else if(Sys.Debug.isDebug)throw Error.argument(g,String.format(AjaxControlToolkit.Resources.Animation_NoDynamicPropertyFound,e,e.substr(0,e.length-5)))}else if(Sys.Debug.isDebug)throw Error.argument(g,String.format(AjaxControlToolkit.Resources.Animation_NoPropertyFound,e))}return d};$AA.Animation=function(d,c,e){var b=null,a=this;$AA.Animation.initializeBase(a);a._duration=1;a._fps=25;a._target=b;a._tickHandler=b;a._timer=b;a._percentComplete=0;a._percentDelta=b;a._owner=b;a._parentAnimation=b;a.DynamicProperties={};if(d)a.set_target(d);if(c)a.set_duration(c);if(e)a.set_fps(e)};$AA.Animation.prototype={dispose:function(){var a=this;if(a._timer){a._timer.dispose();a._timer=null}a._tickHandler=null;a._target=null;$AA.Animation.callBaseMethod(a,"dispose")},play:function(){var a=this;if(!a._owner){var b=true;if(!a._timer){b=false;if(!a._tickHandler)a._tickHandler=Function.createDelegate(a,a._onTimerTick);a._timer=new Sys.Timer;a._timer.add_tick(a._tickHandler);a.onStart();a._timer.set_interval(1e3/a._fps);a._percentDelta=100/(a._duration*a._fps);a._updatePercentComplete(0,true)}a._timer.set_enabled(true);a.raisePropertyChanged("isPlaying");if(!b)a.raisePropertyChanged("isActive")}},pause:function(){var a=this;if(!a._owner)if(a._timer){a._timer.set_enabled(false);a.raisePropertyChanged("isPlaying")}},stop:function(b){var a=this;if(!a._owner){var c=a._timer;a._timer=null;if(c){c.dispose();if(a._percentComplete!==100){a._percentComplete=100;a.raisePropertyChanged("percentComplete");if(b||b===undefined)a.onStep(100)}a.onEnd();a.raisePropertyChanged("isPlaying");a.raisePropertyChanged("isActive")}}},onStart:function(){var a=this;a.raiseStarted();for(var property in a.DynamicProperties)try{a[property](eval(a.DynamicProperties[property]))}catch(ex){if(Sys.Debug.isDebug)throw ex}},onStep:function(a){this.setValue(this.getAnimatedValue(a));this.raiseStep()},onEnd:function(){this.raiseEnded()},getAnimatedValue:function(){throw Error.notImplemented()},setValue:function(){throw Error.notImplemented()},interpolate:function(a,c,b){return a+(c-a)*(b/100)},_onTimerTick:function(){this._updatePercentComplete(this._percentComplete+this._percentDelta,true)},_updatePercentComplete:function(a,c){var b=this;if(a>100)a=100;b._percentComplete=a;b.raisePropertyChanged("percentComplete");if(c)b.onStep(a);if(a===100)b.stop(false)},setOwner:function(a){this._owner=a},raiseStarted:function(){var a=this.get_events().getHandler("started");if(a)a(this,Sys.EventArgs.Empty)},add_started:function(a){this.get_events().addHandler("started",a)},remove_started:function(a){this.get_events().removeHandler("started",a)},raiseEnded:function(){var a=this.get_events().getHandler("ended");if(a)a(this,Sys.EventArgs.Empty)},add_ended:function(a){this.get_events().addHandler("ended",a)},remove_ended:function(a){this.get_events().removeHandler("ended",a)},raiseStep:function(){var a=this.get_events().getHandler("step");if(a)a(this,Sys.EventArgs.Empty)},add_step:function(a){this.get_events().addHandler("step",a)},remove_step:function(a){this.get_events().removeHandler("step",a)},get_target:function(){var a=this;if(!a._target&&a._parentAnimation)return a._parentAnimation.get_target();return a._target},set_target:function(a){if(this._target!=a){this._target=a;this.raisePropertyChanged("target")}},set_animationTarget:function(c){var b=null,a=$get(c);if(a)b=a;else{var d=$find(c);if(d){a=d.get_element();if(a)b=a}}if(b)this.set_target(b);else throw Error.argument("id",String.format(AjaxControlToolkit.Resources.Animation_TargetNotFound,c))},get_duration:function(){return this._duration},set_duration:function(b){var a=this;b=a._getFloat(b);if(a._duration!=b){a._duration=b;a.raisePropertyChanged("duration")}},get_fps:function(){return this._fps},set_fps:function(b){var a=this;b=a._getInteger(b);if(a.fps!=b){a._fps=b;a.raisePropertyChanged("fps")}},get_isActive:function(){return this._timer!==null},get_isPlaying:function(){return this._timer!==null&&this._timer.get_enabled()},get_percentComplete:function(){return this._percentComplete},_getBoolean:function(a){if(String.isInstanceOfType(a))return Boolean.parse(a);return a},_getInteger:function(a){if(String.isInstanceOfType(a))return parseInt(a);return a},_getFloat:function(a){if(String.isInstanceOfType(a))return parseFloat(a);return a},_getEnum:function(a,b){if(String.isInstanceOfType(a)&&b&&b.parse)return b.parse(a);return a}};$AA.Animation.registerClass("AjaxControlToolkit.Animation.Animation",Sys.Component);$AA.registerAnimation("animation",$AA.Animation);$AA.ParentAnimation=function(d,c,e,a){$AA.ParentAnimation.initializeBase(this,[d,c,e]);this._animations=[];if(a&&a.length)for(var b=0;b<a.length;b++)this.add(a[b])};$AA.ParentAnimation.prototype={initialize:function(){var a=this;$AA.ParentAnimation.callBaseMethod(a,"initialize");if(a._animations)for(var c=0;c<a._animations.length;c++){var b=a._animations[c];if(b&&!b.get_isInitialized)b.initialize()}},dispose:function(){this.clear();this._animations=null;$AA.ParentAnimation.callBaseMethod(this,"dispose")},get_animations:function(){return this._animations},add:function(b){var a=this;if(a._animations){if(b)b._parentAnimation=a;Array.add(a._animations,b);a.raisePropertyChanged("animations")}},remove:function(a){if(this._animations){if(a)a.dispose();Array.remove(this._animations,a);this.raisePropertyChanged("animations")}},removeAt:function(c){var a=this;if(a._animations){var b=a._animations[c];if(b)b.dispose();Array.removeAt(a._animations,c);a.raisePropertyChanged("animations")}},clear:function(){var a=this;if(a._animations){for(var b=a._animations.length-1;b>=0;b--){a._animations[b].dispose();a._animations[b]=null}Array.clear(a._animations);a._animations=[];a.raisePropertyChanged("animations")}}};$AA.ParentAnimation.registerClass("AjaxControlToolkit.Animation.ParentAnimation",$AA.Animation);$AA.registerAnimation("parent",$AA.ParentAnimation);$AA.ParallelAnimation=function(c,b,d,a){$AA.ParallelAnimation.initializeBase(this,[c,b,d,a])};$AA.ParallelAnimation.prototype={add:function(a){$AA.ParallelAnimation.callBaseMethod(this,"add",[a]);a.setOwner(this)},onStart:function(){$AA.ParallelAnimation.callBaseMethod(this,"onStart");var b=this.get_animations();for(var a=0;a<b.length;a++)b[a].onStart()},onStep:function(c){var b=this.get_animations();for(var a=0;a<b.length;a++)b[a].onStep(c)},onEnd:function(){var b=this.get_animations();for(var a=0;a<b.length;a++)b[a].onEnd();$AA.ParallelAnimation.callBaseMethod(this,"onEnd")}};$AA.ParallelAnimation.registerClass("AjaxControlToolkit.Animation.ParallelAnimation",$AA.ParentAnimation);$AA.registerAnimation("parallel",$AA.ParallelAnimation);$AA.SequenceAnimation=function(e,d,f,c,b){var a=this;$AA.SequenceAnimation.initializeBase(a,[e,d,f,c]);a._handler=null;a._paused=false;a._playing=false;a._index=0;a._remainingIterations=0;a._iterations=b!==undefined?b:1};$AA.SequenceAnimation.prototype={dispose:function(){this._handler=null;$AA.SequenceAnimation.callBaseMethod(this,"dispose")},stop:function(){var a=this;if(a._playing){var b=a.get_animations();if(a._index<b.length){b[a._index].remove_ended(a._handler);for(var c=a._index;c<b.length;c++)b[c].stop()}a._playing=false;a._paused=false;a.raisePropertyChanged("isPlaying");a.onEnd()}},pause:function(){var a=this;if(a.get_isPlaying()){var b=a.get_animations()[a._index];if(b!=null)b.pause();a._paused=true;a.raisePropertyChanged("isPlaying")}},play:function(){var c="isPlaying",a=this,d=a.get_animations();if(!a._playing){a._playing=true;if(a._paused){a._paused=false;var e=d[a._index];if(e!=null){e.play();a.raisePropertyChanged(c)}}else{a.onStart();a._index=0;var b=d[a._index];if(b){b.add_ended(a._handler);b.play();a.raisePropertyChanged(c)}else a.stop()}}},onStart:function(){var a=this;$AA.SequenceAnimation.callBaseMethod(a,"onStart");a._remainingIterations=a._iterations-1;if(!a._handler)a._handler=Function.createDelegate(a,a._onEndAnimation)},_onEndAnimation:function(){var a=this,b=a.get_animations(),c=b[a._index++];if(c)c.remove_ended(a._handler);if(a._index<b.length){var e=b[a._index];e.add_ended(a._handler);e.play()}else if(a._remainingIterations>=1||a._iterations<=0){a._remainingIterations--;a._index=0;var d=b[0];d.add_ended(a._handler);d.play()}else a.stop()},onStep:function(){throw Error.invalidOperation(AjaxControlToolkit.Resources.Animation_CannotNestSequence)},onEnd:function(){this._remainingIterations=0;$AA.SequenceAnimation.callBaseMethod(this,"onEnd")},get_isActive:function(){return true},get_isPlaying:function(){return this._playing&&!this._paused},get_iterations:function(){return this._iterations},set_iterations:function(b){var a=this;b=a._getInteger(b);if(a._iterations!=b){a._iterations=b;a.raisePropertyChanged("iterations")}},get_isInfinite:function(){return this._iterations<=0}};$AA.SequenceAnimation.registerClass("AjaxControlToolkit.Animation.SequenceAnimation",$AA.ParentAnimation);$AA.registerAnimation("sequence",$AA.SequenceAnimation);$AA.SelectionAnimation=function(c,b,d,a){$AA.SelectionAnimation.initializeBase(this,[c,b,d,a]);this._selectedIndex=-1;this._selected=null};$AA.SelectionAnimation.prototype={getSelectedIndex:function(){throw Error.notImplemented()},onStart:function(){var a=this;$AA.SelectionAnimation.callBaseMethod(a,"onStart");var b=a.get_animations();a._selectedIndex=a.getSelectedIndex();if(a._selectedIndex>=0&&a._selectedIndex<b.length){a._selected=b[a._selectedIndex];if(a._selected){a._selected.setOwner(a);a._selected.onStart()}}},onStep:function(a){if(this._selected)this._selected.onStep(a)},onEnd:function(){var a=this;if(a._selected){a._selected.onEnd();a._selected.setOwner(null)}a._selected=null;a._selectedIndex=null;$AA.SelectionAnimation.callBaseMethod(a,"onEnd")}};$AA.SelectionAnimation.registerClass("AjaxControlToolkit.Animation.SelectionAnimation",$AA.ParentAnimation);$AA.registerAnimation("selection",$AA.SelectionAnimation);$AA.ConditionAnimation=function(d,c,e,b,a){$AA.ConditionAnimation.initializeBase(this,[d,c,e,b]);this._conditionScript=a};$AA.ConditionAnimation.prototype={getSelectedIndex:function(){var selected=-1;if(this._conditionScript&&this._conditionScript.length>0)try{selected=eval(this._conditionScript)?0:1}catch(ex){}return selected},get_conditionScript:function(){return this._conditionScript},set_conditionScript:function(a){if(this._conditionScript!=a){this._conditionScript=a;this.raisePropertyChanged("conditionScript")}}};$AA.ConditionAnimation.registerClass("AjaxControlToolkit.Animation.ConditionAnimation",$AA.SelectionAnimation);$AA.registerAnimation("condition",$AA.ConditionAnimation);$AA.CaseAnimation=function(d,c,e,b,a){$AA.CaseAnimation.initializeBase(this,[d,c,e,b]);this._selectScript=a};$AA.CaseAnimation.prototype={getSelectedIndex:function(){var selected=-1;if(this._selectScript&&this._selectScript.length>0)try{var result=eval(this._selectScript);if(result!==undefined)selected=result}catch(ex){}return selected},get_selectScript:function(){return this._selectScript},set_selectScript:function(a){if(this._selectScript!=a){this._selectScript=a;this.raisePropertyChanged("selectScript")}}};$AA.CaseAnimation.registerClass("AjaxControlToolkit.Animation.CaseAnimation",$AA.SelectionAnimation);$AA.registerAnimation("case",$AA.CaseAnimation);$AA.FadeEffect=function(){throw Error.invalidOperation()};$AA.FadeEffect.prototype={FadeIn:0,FadeOut:1};$AA.FadeEffect.registerEnum("AjaxControlToolkit.Animation.FadeEffect",false);$AA.FadeAnimation=function(g,f,h,e,d,c,b){var a=this;$AA.FadeAnimation.initializeBase(a,[g,f,h]);a._effect=e!==undefined?e:$AA.FadeEffect.FadeIn;a._max=c!==undefined?c:1;a._min=d!==undefined?d:0;a._start=a._min;a._end=a._max;a._layoutCreated=false;a._forceLayoutInIE=b===undefined||b===null?true:b;a._currentTarget=null;a._resetOpacities()};$AA.FadeAnimation.prototype={_resetOpacities:function(){var a=this;if(a._effect==$AA.FadeEffect.FadeIn){a._start=a._min;a._end=a._max}else{a._start=a._max;a._end=a._min}},_createLayout:function(){var a=this,b=a._currentTarget;if(b){a._originalWidth=$common.getCurrentStyle(b,"width");var c=$common.getCurrentStyle(b,"height");a._originalBackColor=$common.getCurrentStyle(b,"backgroundColor");if((!a._originalWidth||a._originalWidth==""||a._originalWidth=="auto")&&(!c||c==""||c=="auto"))b.style.width=b.offsetWidth+"px";if(!a._originalBackColor||a._originalBackColor==""||a._originalBackColor=="transparent"||a._originalBackColor=="rgba(0, 0, 0, 0)")b.style.backgroundColor=$common.getInheritedBackgroundColor(b);a._layoutCreated=true}},onStart:function(){var a=this;$AA.FadeAnimation.callBaseMethod(a,"onStart");a._currentTarget=a.get_target();a.setValue(a._start);if(a._forceLayoutInIE&&!a._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer)a._createLayout()},getAnimatedValue:function(a){return this.interpolate(this._start,this._end,a)},setValue:function(a){if(this._currentTarget)$common.setElementOpacity(this._currentTarget,a)},get_effect:function(){return this._effect},set_effect:function(b){var a=this;b=a._getEnum(b,$AA.FadeEffect);if(a._effect!=b){a._effect=b;a._resetOpacities();a.raisePropertyChanged("effect")}},get_minimumOpacity:function(){return this._min},set_minimumOpacity:function(b){var a=this;b=a._getFloat(b);if(a._min!=b){a._min=b;a._resetOpacities();a.raisePropertyChanged("minimumOpacity")}},get_maximumOpacity:function(){return this._max},set_maximumOpacity:function(b){var a=this;b=a._getFloat(b);if(a._max!=b){a._max=b;a._resetOpacities();a.raisePropertyChanged("maximumOpacity")}},get_forceLayoutInIE:function(){return this._forceLayoutInIE},set_forceLayoutInIE:function(b){var a=this;b=a._getBoolean(b);if(a._forceLayoutInIE!=b){a._forceLayoutInIE=b;a.raisePropertyChanged("forceLayoutInIE")}},set_startValue:function(a){a=this._getFloat(a);this._start=a}};$AA.FadeAnimation.registerClass("AjaxControlToolkit.Animation.FadeAnimation",$AA.Animation);$AA.registerAnimation("fade",$AA.FadeAnimation);$AA.FadeInAnimation=function(e,d,f,c,b,a){$AA.FadeInAnimation.initializeBase(this,[e,d,f,$AA.FadeEffect.FadeIn,c,b,a])};$AA.FadeInAnimation.prototype={onStart:function(){var a=this;$AA.FadeInAnimation.callBaseMethod(a,"onStart");if(a._currentTarget)a.set_startValue($common.getElementOpacity(a._currentTarget))}};$AA.FadeInAnimation.registerClass("AjaxControlToolkit.Animation.FadeInAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeIn",$AA.FadeInAnimation);$AA.FadeOutAnimation=function(e,d,f,c,b,a){$AA.FadeOutAnimation.initializeBase(this,[e,d,f,$AA.FadeEffect.FadeOut,c,b,a])};$AA.FadeOutAnimation.prototype={onStart:function(){var a=this;$AA.FadeOutAnimation.callBaseMethod(a,"onStart");if(a._currentTarget)a.set_startValue($common.getElementOpacity(a._currentTarget))}};$AA.FadeOutAnimation.registerClass("AjaxControlToolkit.Animation.FadeOutAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeOut",$AA.FadeOutAnimation);$AA.PulseAnimation=function(c,b,d,h,g,f,e){var a=this;$AA.PulseAnimation.initializeBase(a,[c,b,d,null,h!==undefined?h:3]);a._out=new $AA.FadeOutAnimation(c,b,d,g,f,e);a.add(a._out);a._in=new $AA.FadeInAnimation(c,b,d,g,f,e);a.add(a._in)};$AA.PulseAnimation.prototype={get_minimumOpacity:function(){return this._out.get_minimumOpacity()},set_minimumOpacity:function(b){var a=this;b=a._getFloat(b);a._out.set_minimumOpacity(b);a._in.set_minimumOpacity(b);a.raisePropertyChanged("minimumOpacity")},get_maximumOpacity:function(){return this._out.get_maximumOpacity()},set_maximumOpacity:function(b){var a=this;b=a._getFloat(b);a._out.set_maximumOpacity(b);a._in.set_maximumOpacity(b);a.raisePropertyChanged("maximumOpacity")},get_forceLayoutInIE:function(){return this._out.get_forceLayoutInIE()},set_forceLayoutInIE:function(b){var a=this;b=a._getBoolean(b);a._out.set_forceLayoutInIE(b);a._in.set_forceLayoutInIE(b);a.raisePropertyChanged("forceLayoutInIE")},set_duration:function(a){var b=this;a=b._getFloat(a);$AA.PulseAnimation.callBaseMethod(b,"set_duration",[a]);b._in.set_duration(a);b._out.set_duration(a)},set_fps:function(a){var b=this;a=b._getInteger(a);$AA.PulseAnimation.callBaseMethod(b,"set_fps",[a]);b._in.set_fps(a);b._out.set_fps(a)}};$AA.PulseAnimation.registerClass("AjaxControlToolkit.Animation.PulseAnimation",$AA.SequenceAnimation);$AA.registerAnimation("pulse",$AA.PulseAnimation);$AA.PropertyAnimation=function(e,c,f,d,b){var a=this;$AA.PropertyAnimation.initializeBase(a,[e,c,f]);a._property=d;a._propertyKey=b;a._currentTarget=null};$AA.PropertyAnimation.prototype={onStart:function(){$AA.PropertyAnimation.callBaseMethod(this,"onStart");this._currentTarget=this.get_target()},setValue:function(c){var a=this,b=a._currentTarget;if(b&&a._property&&a._property.length>0)if(a._propertyKey&&a._propertyKey.length>0&&b[a._property])b[a._property][a._propertyKey]=c;else b[a._property]=c},getValue:function(){var a=this,c=a.get_target();if(c&&a._property&&a._property.length>0){var b=c[a._property];if(b){if(a._propertyKey&&a._propertyKey.length>0)return b[a._propertyKey];return b}}return null},get_property:function(){return this._property},set_property:function(a){if(this._property!=a){this._property=a;this.raisePropertyChanged("property")}},get_propertyKey:function(){return this._propertyKey},set_propertyKey:function(a){if(this._propertyKey!=a){this._propertyKey=a;this.raisePropertyChanged("propertyKey")}}};$AA.PropertyAnimation.registerClass("AjaxControlToolkit.Animation.PropertyAnimation",$AA.Animation);$AA.registerAnimation("property",$AA.PropertyAnimation);$AA.DiscreteAnimation=function(e,c,f,d,b,a){$AA.DiscreteAnimation.initializeBase(this,[e,c,f,d,b]);this._values=a&&a.length?a:[]};$AA.DiscreteAnimation.prototype={getAnimatedValue:function(a){var b=Math.floor(this.interpolate(0,this._values.length-1,a));return this._values[b]},get_values:function(){return this._values},set_values:function(a){if(this._values!=a){this._values=a;this.raisePropertyChanged("values")}}};$AA.DiscreteAnimation.registerClass("AjaxControlToolkit.Animation.DiscreteAnimation",$AA.PropertyAnimation);$AA.registerAnimation("discrete",$AA.DiscreteAnimation);$AA.InterpolatedAnimation=function(f,d,g,a,b,c,e){$AA.InterpolatedAnimation.initializeBase(this,[f,d,g,a!==undefined?a:"style",b]);this._startValue=c;this._endValue=e};$AA.InterpolatedAnimation.prototype={get_startValue:function(){return this._startValue},set_startValue:function(b){var a=this;b=a._getFloat(b);if(a._startValue!=b){a._startValue=b;a.raisePropertyChanged("startValue")}},get_endValue:function(){return this._endValue},set_endValue:function(b){var a=this;b=a._getFloat(b);if(a._endValue!=b){a._endValue=b;a.raisePropertyChanged("endValue")}}};$AA.InterpolatedAnimation.registerClass("AjaxControlToolkit.Animation.InterpolatedAnimation",$AA.PropertyAnimation);$AA.registerAnimation("interpolated",$AA.InterpolatedAnimation);$AA.ColorAnimation=function(g,d,h,f,b,c,e){var a=this;$AA.ColorAnimation.initializeBase(a,[g,d,h,f,b,c,e]);a._start=null;a._end=null;a._interpolateRed=false;a._interpolateGreen=false;a._interpolateBlue=false};$AA.ColorAnimation.prototype={onStart:function(){var a=this;$AA.ColorAnimation.callBaseMethod(a,"onStart");a._start=$AA.ColorAnimation.getRGB(a.get_startValue());a._end=$AA.ColorAnimation.getRGB(a.get_endValue());a._interpolateRed=a._start.Red!=a._end.Red;a._interpolateGreen=a._start.Green!=a._end.Green;a._interpolateBlue=a._start.Blue!=a._end.Blue},getAnimatedValue:function(b){var a=this,e=a._start.Red,d=a._start.Green,c=a._start.Blue;if(a._interpolateRed)e=Math.round(a.interpolate(e,a._end.Red,b));if(a._interpolateGreen)d=Math.round(a.interpolate(d,a._end.Green,b));if(a._interpolateBlue)c=Math.round(a.interpolate(c,a._end.Blue,b));return $AA.ColorAnimation.toColor(e,d,c)},set_startValue:function(a){if(this._startValue!=a){this._startValue=a;this.raisePropertyChanged("startValue")}},set_endValue:function(a){if(this._endValue!=a){this._endValue=a;this.raisePropertyChanged("endValue")}}};$AA.ColorAnimation.getRGB=function(a){if(!a||a.length!=7)throw String.format(AjaxControlToolkit.Resources.Animation_InvalidColor,a);return {Red:parseInt(a.substr(1,2),16),Green:parseInt(a.substr(3,2),16),Blue:parseInt(a.substr(5,2),16)}};$AA.ColorAnimation.toColor=function(f,d,e){var c=f.toString(16),b=d.toString(16),a=e.toString(16);if(c.length==1)c="0"+c;if(b.length==1)b="0"+b;if(a.length==1)a="0"+a;return "#"+c+b+a};$AA.ColorAnimation.registerClass("AjaxControlToolkit.Animation.ColorAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("color",$AA.ColorAnimation);$AA.LengthAnimation=function(g,d,h,f,b,c,e,a){$AA.LengthAnimation.initializeBase(this,[g,d,h,f,b,c,e]);this._unit=a!=null?a:"px"};$AA.LengthAnimation.prototype={getAnimatedValue:function(b){var a=this,c=a.interpolate(a.get_startValue(),a.get_endValue(),b);return Math.round(c)+a._unit},get_unit:function(){return this._unit},set_unit:function(a){if(this._unit!=a){this._unit=a;this.raisePropertyChanged("unit")}}};$AA.LengthAnimation.registerClass("AjaxControlToolkit.Animation.LengthAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("length",$AA.LengthAnimation);$AA.MoveAnimation=function(d,c,e,f,h,g,i){var b=null,a=this;$AA.MoveAnimation.initializeBase(a,[d,c,e,b]);a._horizontal=f?f:0;a._vertical=h?h:0;a._relative=g===undefined?true:g;a._horizontalAnimation=new $AA.LengthAnimation(d,c,e,"style","left",b,b,i);a._verticalAnimation=new $AA.LengthAnimation(d,c,e,"style","top",b,b,i);a.add(a._verticalAnimation);a.add(a._horizontalAnimation)};$AA.MoveAnimation.prototype={onStart:function(){var a=this;$AA.MoveAnimation.callBaseMethod(a,"onStart");var b=a.get_target();a._horizontalAnimation.set_startValue(b.offsetLeft);a._horizontalAnimation.set_endValue(a._relative?b.offsetLeft+a._horizontal:a._horizontal);a._verticalAnimation.set_startValue(b.offsetTop);a._verticalAnimation.set_endValue(a._relative?b.offsetTop+a._vertical:a._vertical)},get_horizontal:function(){return this._horizontal},set_horizontal:function(b){var a=this;b=a._getFloat(b);if(a._horizontal!=b){a._horizontal=b;a.raisePropertyChanged("horizontal")}},get_vertical:function(){return this._vertical},set_vertical:function(b){var a=this;b=a._getFloat(b);if(a._vertical!=b){a._vertical=b;a.raisePropertyChanged("vertical")}},get_relative:function(){return this._relative},set_relative:function(b){var a=this;b=a._getBoolean(b);if(a._relative!=b){a._relative=b;a.raisePropertyChanged("relative")}},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(b){var a=this,c=a._horizontalAnimation.get_unit();if(c!=b){a._horizontalAnimation.set_unit(b);a._verticalAnimation.set_unit(b);a.raisePropertyChanged("unit")}}};$AA.MoveAnimation.registerClass("AjaxControlToolkit.Animation.MoveAnimation",$AA.ParallelAnimation);$AA.registerAnimation("move",$AA.MoveAnimation);$AA.ResizeAnimation=function(d,c,e,h,g,f){var b=null,a=this;$AA.ResizeAnimation.initializeBase(a,[d,c,e,b]);a._width=h;a._height=g;a._horizontalAnimation=new $AA.LengthAnimation(d,c,e,"style","width",b,b,f);a._verticalAnimation=new $AA.LengthAnimation(d,c,e,"style","height",b,b,f);a.add(a._horizontalAnimation);a.add(a._verticalAnimation)};$AA.ResizeAnimation.prototype={onStart:function(){var a=this;$AA.ResizeAnimation.callBaseMethod(a,"onStart");var b=a.get_target();a._horizontalAnimation.set_startValue(b.offsetWidth);a._verticalAnimation.set_startValue(b.offsetHeight);a._horizontalAnimation.set_endValue(a._width!==null&&a._width!==undefined?a._width:b.offsetWidth);a._verticalAnimation.set_endValue(a._height!==null&&a._height!==undefined?a._height:b.offsetHeight)},get_width:function(){return this._width},set_width:function(b){var a=this;b=a._getFloat(b);if(a._width!=b){a._width=b;a.raisePropertyChanged("width")}},get_height:function(){return this._height},set_height:function(b){var a=this;b=a._getFloat(b);if(a._height!=b){a._height=b;a.raisePropertyChanged("height")}},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(b){var a=this,c=a._horizontalAnimation.get_unit();if(c!=b){a._horizontalAnimation.set_unit(b);a._verticalAnimation.set_unit(b);a.raisePropertyChanged("unit")}}};$AA.ResizeAnimation.registerClass("AjaxControlToolkit.Animation.ResizeAnimation",$AA.ParallelAnimation);$AA.registerAnimation("resize",$AA.ResizeAnimation);$AA.ScaleAnimation=function(i,g,j,c,e,h,f,d){var b=null,a=this;$AA.ScaleAnimation.initializeBase(a,[i,g,j]);a._scaleFactor=c!==undefined?c:1;a._unit=e!==undefined?e:"px";a._center=h;a._scaleFont=f;a._fontUnit=d!==undefined?d:"pt";a._element=b;a._initialHeight=b;a._initialWidth=b;a._initialTop=b;a._initialLeft=b;a._initialFontSize=b};$AA.ScaleAnimation.prototype={getAnimatedValue:function(a){return this.interpolate(1,this._scaleFactor,a)},onStart:function(){var a=this;$AA.ScaleAnimation.callBaseMethod(a,"onStart");a._element=a.get_target();if(a._element){a._initialHeight=a._element.offsetHeight;a._initialWidth=a._element.offsetWidth;if(a._center){a._initialTop=a._element.offsetTop;a._initialLeft=a._element.offsetLeft}if(a._scaleFont)a._initialFontSize=parseFloat($common.getCurrentStyle(a._element,"fontSize"))}},setValue:function(b){var a=this;if(a._element){var e=Math.round(a._initialWidth*b),d=Math.round(a._initialHeight*b);a._element.style.width=e+a._unit;a._element.style.height=d+a._unit;if(a._center){a._element.style.top=a._initialTop+Math.round((a._initialHeight-d)/2)+a._unit;a._element.style.left=a._initialLeft+Math.round((a._initialWidth-e)/2)+a._unit}if(a._scaleFont){var c=a._initialFontSize*b;if(a._fontUnit=="px"||a._fontUnit=="pt")c=Math.round(c);a._element.style.fontSize=c+a._fontUnit}}},onEnd:function(){var b=null,a=this;a._element=b;a._initialHeight=b;a._initialWidth=b;a._initialTop=b;a._initialLeft=b;a._initialFontSize=b;$AA.ScaleAnimation.callBaseMethod(a,"onEnd")},get_scaleFactor:function(){return this._scaleFactor},set_scaleFactor:function(b){var a=this;b=a._getFloat(b);if(a._scaleFactor!=b){a._scaleFactor=b;a.raisePropertyChanged("scaleFactor")}},get_unit:function(){return this._unit},set_unit:function(a){if(this._unit!=a){this._unit=a;this.raisePropertyChanged("unit")}},get_center:function(){return this._center},set_center:function(b){var a=this;b=a._getBoolean(b);if(a._center!=b){a._center=b;a.raisePropertyChanged("center")}},get_scaleFont:function(){return this._scaleFont},set_scaleFont:function(b){var a=this;b=a._getBoolean(b);if(a._scaleFont!=b){a._scaleFont=b;a.raisePropertyChanged("scaleFont")}},get_fontUnit:function(){return this._fontUnit},set_fontUnit:function(a){if(this._fontUnit!=a){this._fontUnit=a;this.raisePropertyChanged("fontUnit")}}};$AA.ScaleAnimation.registerClass("AjaxControlToolkit.Animation.ScaleAnimation",$AA.Animation);$AA.registerAnimation("scale",$AA.ScaleAnimation);$AA.Action=function(b,a,c){$AA.Action.initializeBase(this,[b,a,c]);if(a===undefined)this.set_duration(0)};$AA.Action.prototype={onEnd:function(){this.doAction();$AA.Action.callBaseMethod(this,"onEnd")},doAction:function(){throw Error.notImplemented()},getAnimatedValue:function(){},setValue:function(){}};$AA.Action.registerClass("AjaxControlToolkit.Animation.Action",$AA.Animation);$AA.registerAnimation("action",$AA.Action);$AA.EnableAction=function(c,b,d,a){$AA.EnableAction.initializeBase(this,[c,b,d]);this._enabled=a!==undefined?a:true};$AA.EnableAction.prototype={doAction:function(){var a=this.get_target();if(a)a.disabled=!this._enabled},get_enabled:function(){return this._enabled},set_enabled:function(b){var a=this;b=a._getBoolean(b);if(a._enabled!=b){a._enabled=b;a.raisePropertyChanged("enabled")}}};$AA.EnableAction.registerClass("AjaxControlToolkit.Animation.EnableAction",$AA.Action);$AA.registerAnimation("enableAction",$AA.EnableAction);$AA.HideAction=function(c,a,d,b){$AA.HideAction.initializeBase(this,[c,a,d]);this._visible=b};$AA.HideAction.prototype={doAction:function(){var a=this.get_target();if(a)$common.setVisible(a,this._visible)},get_visible:function(){return this._visible},set_visible:function(a){if(this._visible!=a){this._visible=a;this.raisePropertyChanged("visible")}}};$AA.HideAction.registerClass("AjaxControlToolkit.Animation.HideAction",$AA.Action);$AA.registerAnimation("hideAction",$AA.HideAction);$AA.StyleAction=function(c,b,e,a,d){$AA.StyleAction.initializeBase(this,[c,b,e]);this._attribute=a;this._value=d};$AA.StyleAction.prototype={doAction:function(){var a=this.get_target();if(a)a.style[this._attribute]=this._value},get_attribute:function(){return this._attribute},set_attribute:function(a){if(this._attribute!=a){this._attribute=a;this.raisePropertyChanged("attribute")}},get_value:function(){return this._value},set_value:function(a){if(this._value!=a){this._value=a;this.raisePropertyChanged("value")}}};$AA.StyleAction.registerClass("AjaxControlToolkit.Animation.StyleAction",$AA.Action);$AA.registerAnimation("styleAction",$AA.StyleAction);$AA.OpacityAction=function(c,a,d,b){$AA.OpacityAction.initializeBase(this,[c,a,d]);this._opacity=b};$AA.OpacityAction.prototype={doAction:function(){var a=this.get_target();if(a)$common.setElementOpacity(a,this._opacity)},get_opacity:function(){return this._opacity},set_opacity:function(b){var a=this;b=a._getFloat(b);if(a._opacity!=b){a._opacity=b;a.raisePropertyChanged("opacity")}}};$AA.OpacityAction.registerClass("AjaxControlToolkit.Animation.OpacityAction",$AA.Action);$AA.registerAnimation("opacityAction",$AA.OpacityAction);$AA.ScriptAction=function(c,a,d,b){$AA.ScriptAction.initializeBase(this,[c,a,d]);this._script=b};$AA.ScriptAction.prototype={doAction:function(){try{eval(this._script)}catch(ex){}},get_script:function(){return this._script},set_script:function(a){if(this._script!=a){this._script=a;this.raisePropertyChanged("script")}}};$AA.ScriptAction.registerClass("AjaxControlToolkit.Animation.ScriptAction",$AA.Action);$AA.registerAnimation("scriptAction",$AA.ScriptAction);
//END AjaxControlToolkit.Animation.Animations.js
//START AjaxControlToolkit.Animation.AnimationBehavior.js
Type.registerNamespace("AjaxControlToolkit.Animation");AjaxControlToolkit.Animation.AnimationBehavior=function(c){var b=null,a=this;AjaxControlToolkit.Animation.AnimationBehavior.initializeBase(a,[c]);a._onLoad=b;a._onClick=b;a._onMouseOver=b;a._onMouseOut=b;a._onHoverOver=b;a._onHoverOut=b;a._onClickHandler=b;a._onMouseOverHandler=b;a._onMouseOutHandler=b};AjaxControlToolkit.Animation.AnimationBehavior.prototype={initialize:function(){var a=this;AjaxControlToolkit.Animation.AnimationBehavior.callBaseMethod(a,"initialize");var b=a.get_element();if(b){a._onClickHandler=Function.createDelegate(a,a.OnClick);$addHandler(b,"click",a._onClickHandler);a._onMouseOverHandler=Function.createDelegate(a,a.OnMouseOver);$addHandler(b,"mouseover",a._onMouseOverHandler);a._onMouseOutHandler=Function.createDelegate(a,a.OnMouseOut);$addHandler(b,"mouseout",a._onMouseOutHandler)}},dispose:function(){var b=null,a=this,c=a.get_element();if(c){if(a._onClickHandler){$removeHandler(c,"click",a._onClickHandler);a._onClickHandler=b}if(a._onMouseOverHandler){$removeHandler(c,"mouseover",a._onMouseOverHandler);a._onMouseOverHandler=b}if(a._onMouseOutHandler){$removeHandler(c,"mouseout",a._onMouseOutHandler);a._onMouseOutHandler=b}}a._onLoad=b;a._onClick=b;a._onMouseOver=b;a._onMouseOut=b;a._onHoverOver=b;a._onHoverOut=b;AjaxControlToolkit.Animation.AnimationBehavior.callBaseMethod(a,"dispose")},get_OnLoad:function(){return this._onLoad?this._onLoad.get_json():null},set_OnLoad:function(b){var a=this;if(!a._onLoad){a._onLoad=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onLoad.initialize()}a._onLoad.set_json(b);a.raisePropertyChanged("OnLoad");a._onLoad.play()},get_OnLoadBehavior:function(){return this._onLoad},get_OnClick:function(){return this._onClick?this._onClick.get_json():null},set_OnClick:function(b){var a=this;if(!a._onClick){a._onClick=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onClick.initialize()}a._onClick.set_json(b);a.raisePropertyChanged("OnClick")},get_OnClickBehavior:function(){return this._onClick},OnClick:function(){if(this._onClick)this._onClick.play()},get_OnMouseOver:function(){return this._onMouseOver?this._onMouseOver.get_json():null},set_OnMouseOver:function(b){var a=this;if(!a._onMouseOver){a._onMouseOver=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onMouseOver.initialize()}a._onMouseOver.set_json(b);a.raisePropertyChanged("OnMouseOver")},get_OnMouseOverBehavior:function(){return this._onMouseOver},OnMouseOver:function(){var a=this;if(a._onMouseOver)a._onMouseOver.play();if(a._onHoverOver){if(a._onHoverOut)a._onHoverOut.quit();a._onHoverOver.play()}},get_OnMouseOut:function(){return this._onMouseOut?this._onMouseOut.get_json():null},set_OnMouseOut:function(b){var a=this;if(!a._onMouseOut){a._onMouseOut=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onMouseOut.initialize()}a._onMouseOut.set_json(b);a.raisePropertyChanged("OnMouseOut")},get_OnMouseOutBehavior:function(){return this._onMouseOut},OnMouseOut:function(){var a=this;if(a._onMouseOut)a._onMouseOut.play();if(a._onHoverOut){if(a._onHoverOver)a._onHoverOver.quit();a._onHoverOut.play()}},get_OnHoverOver:function(){return this._onHoverOver?this._onHoverOver.get_json():null},set_OnHoverOver:function(b){var a=this;if(!a._onHoverOver){a._onHoverOver=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onHoverOver.initialize()}a._onHoverOver.set_json(b);a.raisePropertyChanged("OnHoverOver")},get_OnHoverOverBehavior:function(){return this._onHoverOver},get_OnHoverOut:function(){return this._onHoverOut?this._onHoverOut.get_json():null},set_OnHoverOut:function(b){var a=this;if(!a._onHoverOut){a._onHoverOut=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onHoverOut.initialize()}a._onHoverOut.set_json(b);a.raisePropertyChanged("OnHoverOut")},get_OnHoverOutBehavior:function(){return this._onHoverOut}};AjaxControlToolkit.Animation.AnimationBehavior.registerClass("AjaxControlToolkit.Animation.AnimationBehavior",AjaxControlToolkit.BehaviorBase);AjaxControlToolkit.Animation.GenericAnimationBehavior=function(a){AjaxControlToolkit.Animation.GenericAnimationBehavior.initializeBase(this,[a]);this._json=null;this._animation=null};AjaxControlToolkit.Animation.GenericAnimationBehavior.prototype={dispose:function(){this.disposeAnimation();AjaxControlToolkit.Animation.GenericAnimationBehavior.callBaseMethod(this,"dispose")},disposeAnimation:function(){if(this._animation)this._animation.dispose();this._animation=null},play:function(){var a=this;if(a._animation&&!a._animation.get_isPlaying()){a.stop();a._animation.play()}},stop:function(){if(this._animation)if(this._animation.get_isPlaying())this._animation.stop(true)},quit:function(){if(this._animation)if(this._animation.get_isPlaying())this._animation.stop(false)},get_json:function(){return this._json},set_json:function(c){var a=this;if(a._json!=c){a._json=c;a.raisePropertyChanged("json");a.disposeAnimation();var b=a.get_element();if(b){a._animation=AjaxControlToolkit.Animation.buildAnimation(a._json,b);if(a._animation)a._animation.initialize();a.raisePropertyChanged("animation")}}},get_animation:function(){return this._animation}};AjaxControlToolkit.Animation.GenericAnimationBehavior.registerClass("AjaxControlToolkit.Animation.GenericAnimationBehavior",AjaxControlToolkit.BehaviorBase);
//END AjaxControlToolkit.Animation.AnimationBehavior.js
//START AjaxControlToolkit.PopupExtender.PopupBehavior.js
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.PopupBehavior=function(c){var b=null,a=this;AjaxControlToolkit.PopupBehavior.initializeBase(a,[c]);a._x=0;a._y=0;a._positioningMode=AjaxControlToolkit.PositioningMode.Absolute;a._parentElement=b;a._parentElementID=b;a._moveHandler=b;a._firstPopup=true;a._originalParent=b;a._visible=false;a._onShow=b;a._onShowEndedHandler=b;a._onHide=b;a._onHideEndedHandler=b};AjaxControlToolkit.PopupBehavior.prototype={initialize:function(){var a=this;AjaxControlToolkit.PopupBehavior.callBaseMethod(a,"initialize");a._hidePopup();a.get_element().style.position="absolute";a._onShowEndedHandler=Function.createDelegate(a,a._onShowEnded);a._onHideEndedHandler=Function.createDelegate(a,a._onHideEnded)},dispose:function(){var b=null,a=this,c=a.get_element();if(c){if(a._visible)a.hide();if(a._originalParent){c.parentNode.removeChild(c);a._originalParent.appendChild(c);a._originalParent=b}c._hideWindowedElementsIFrame=b}a._parentElement=b;if(a._onShow&&a._onShow.get_animation()&&a._onShowEndedHandler)a._onShow.get_animation().remove_ended(a._onShowEndedHandler);a._onShowEndedHandler=b;a._onShow=b;if(a._onHide&&a._onHide.get_animation()&&a._onHideEndedHandler)a._onHide.get_animation().remove_ended(a._onHideEndedHandler);a._onHideEndedHandler=b;a._onHide=b;AjaxControlToolkit.PopupBehavior.callBaseMethod(a,"dispose")},show:function(){var a=this;if(a._visible)return;var b=new Sys.CancelEventArgs;a.raiseShowing(b);if(b.get_cancel())return;a._visible=true;var c=a.get_element();$common.setVisible(c,true);a.setupPopup();if(a._onShow){$common.setVisible(c,false);a.onShow()}else a.raiseShown(Sys.EventArgs.Empty)},hide:function(){var a=this;if(!a._visible)return;var b=new Sys.CancelEventArgs;a.raiseHiding(b);if(b.get_cancel())return;a._visible=false;if(a._onHide)a.onHide();else{a._hidePopup();a._hideCleanup()}},getBounds:function(){var d=this,c=d.get_element(),h=c.offsetParent||document.documentElement,f,b;if(d._parentElement){b=$common.getBounds(d._parentElement);var g=$common.getLocation(h);f={x:b.x-g.x,y:b.y-g.y}}else{b=$common.getBounds(h);f={x:0,y:0}}var e=c.offsetWidth-(c.clientLeft?c.clientLeft*2:0),i=c.offsetHeight-(c.clientTop?c.clientTop*2:0);if(d._firstpopup){c.style.width=e+"px";d._firstpopup=false}var a;switch(d._positioningMode){case AjaxControlToolkit.PositioningMode.Center:a={x:Math.round(b.width/2-e/2),y:Math.round(b.height/2-i/2)};break;case AjaxControlToolkit.PositioningMode.BottomLeft:a={x:0,y:b.height};break;case AjaxControlToolkit.PositioningMode.BottomRight:a={x:b.width-e,y:b.height};break;case AjaxControlToolkit.PositioningMode.TopLeft:a={x:0,y:-c.offsetHeight};break;case AjaxControlToolkit.PositioningMode.TopRight:a={x:b.width-e,y:-c.offsetHeight};break;case AjaxControlToolkit.PositioningMode.Right:a={x:b.width,y:0};break;case AjaxControlToolkit.PositioningMode.Left:a={x:-c.offsetWidth,y:0};break;default:a={x:0,y:0}}a.x+=d._x+f.x;a.y+=d._y+f.y;return new Sys.UI.Bounds(a.x,a.y,e,i)},adjustPopupPosition:function(a){var d=this.get_element();if(!a)a=this.getBounds();var b=$common.getBounds(d),c=false;if(b.x<0){a.x-=b.x;c=true}if(b.y<0){a.y-=b.y;c=true}if(c)$common.setLocation(d,a)},addBackgroundIFrame:function(){var c=this,b=c.get_element();if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version<7){var a=b._hideWindowedElementsIFrame;if(!a){a=document.createElement("iframe");a.src="javascript:'<html></html>';";a.style.position="absolute";a.style.display="none";a.scrolling="no";a.frameBorder="0";a.tabIndex="-1";a.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";b.parentNode.insertBefore(a,b);b._hideWindowedElementsIFrame=a;c._moveHandler=Function.createDelegate(c,c._onMove);Sys.UI.DomEvent.addHandler(b,"move",c._moveHandler)}$common.setBounds(a,$common.getBounds(b));a.style.left=b.style.left;a.style.top=b.style.top;a.style.display=b.style.display;if(b.currentStyle&&b.currentStyle.zIndex)a.style.zIndex=b.currentStyle.zIndex;else if(b.style.zIndex)a.style.zIndex=b.style.zIndex}},setupPopup:function(){var a=this,b=a.get_element(),c=a.getBounds();$common.setLocation(b,c);a.adjustPopupPosition(c);b.zIndex=1e3;a.addBackgroundIFrame()},_hidePopup:function(){var a=this.get_element();$common.setVisible(a,false);if(a.originalWidth){a.style.width=a.originalWidth+"px";a.originalWidth=null}},_hideCleanup:function(){var a=this,c=a.get_element();if(a._moveHandler){Sys.UI.DomEvent.removeHandler(c,"move",a._moveHandler);a._moveHandler=null}if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var b=c._hideWindowedElementsIFrame;if(b)b.style.display="none"}a.raiseHidden(Sys.EventArgs.Empty)},_onMove:function(){var a=this.get_element();if(a._hideWindowedElementsIFrame){a.parentNode.insertBefore(a._hideWindowedElementsIFrame,a);a._hideWindowedElementsIFrame.style.top=a.style.top;a._hideWindowedElementsIFrame.style.left=a.style.left}},get_onShow:function(){return this._onShow?this._onShow.get_json():null},set_onShow:function(c){var a=this;if(!a._onShow){a._onShow=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onShow.initialize()}a._onShow.set_json(c);var b=a._onShow.get_animation();if(b)b.add_ended(a._onShowEndedHandler);a.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._onShow},onShow:function(){var a=this;if(a._onShow){if(a._onHide)a._onHide.quit();a._onShow.play()}},_onShowEnded:function(){this.adjustPopupPosition();this.addBackgroundIFrame();this.raiseShown(Sys.EventArgs.Empty)},get_onHide:function(){return this._onHide?this._onHide.get_json():null},set_onHide:function(c){var a=this;if(!a._onHide){a._onHide=new AjaxControlToolkit.Animation.GenericAnimationBehavior(a.get_element());a._onHide.initialize()}a._onHide.set_json(c);var b=a._onHide.get_animation();if(b)b.add_ended(a._onHideEndedHandler);a.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._onHide},onHide:function(){var a=this;if(a._onHide){if(a._onShow)a._onShow.quit();a._onHide.play()}},_onHideEnded:function(){this._hideCleanup()},get_parentElement:function(){var a=this;if(!a._parentElement&&a._parentElementID){a.set_parentElement($get(a._parentElementID));Sys.Debug.assert(a._parentElement!=null,String.format(AjaxControlToolkit.Resources.PopupExtender_NoParentElement,a._parentElementID))}return a._parentElement},set_parentElement:function(a){this._parentElement=a;this.raisePropertyChanged("parentElement")},get_parentElementID:function(){if(this._parentElement)return this._parentElement.id;return this._parentElementID},set_parentElementID:function(a){this._parentElementID=a;if(this.get_isInitialized())this.set_parentElement($get(a))},get_positioningMode:function(){return this._positioningMode},set_positioningMode:function(a){this._positioningMode=a;this.raisePropertyChanged("positioningMode")},get_x:function(){return this._x},set_x:function(b){var a=this;if(b!=a._x){a._x=b;if(a._visible)a.setupPopup();a.raisePropertyChanged("x")}},get_y:function(){return this._y},set_y:function(b){var a=this;if(b!=a._y){a._y=b;if(a._visible)a.setupPopup();a.raisePropertyChanged("y")}},get_visible:function(){return this._visible},add_showing:function(a){this.get_events().addHandler("showing",a)},remove_showing:function(a){this.get_events().removeHandler("showing",a)},raiseShowing:function(b){var a=this.get_events().getHandler("showing");if(a)a(this,b)},add_shown:function(a){this.get_events().addHandler("shown",a)},remove_shown:function(a){this.get_events().removeHandler("shown",a)},raiseShown:function(b){var a=this.get_events().getHandler("shown");if(a)a(this,b)},add_hiding:function(a){this.get_events().addHandler("hiding",a)},remove_hiding:function(a){this.get_events().removeHandler("hiding",a)},raiseHiding:function(b){var a=this.get_events().getHandler("hiding");if(a)a(this,b)},add_hidden:function(a){this.get_events().addHandler("hidden",a)},remove_hidden:function(a){this.get_events().removeHandler("hidden",a)},raiseHidden:function(b){var a=this.get_events().getHandler("hidden");if(a)a(this,b)}};AjaxControlToolkit.PopupBehavior.registerClass("AjaxControlToolkit.PopupBehavior",AjaxControlToolkit.BehaviorBase);AjaxControlToolkit.PositioningMode=function(){throw Error.invalidOperation()};AjaxControlToolkit.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5,Right:6,Left:7};AjaxControlToolkit.PositioningMode.registerEnum("AjaxControlToolkit.PositioningMode");
//END AjaxControlToolkit.PopupExtender.PopupBehavior.js
//START AjaxControlToolkit.ComboBox.ComboBox.js
/// <reference name="MicrosoftAjax.js"/>

// Problem in MicrosoftAjax.js for Safari 3 release -- see http://forums.asp.net/p/1252014/2392110.aspx 
// Uncomment the next 8 lines to force correct behavior in Safari 3 release:
//if (Sys.Browser.WebKit == undefined) {
//    Sys.Browser.WebKit = {};
//    if (navigator.userAgent.indexOf('WebKit/') > -1) {
//        Sys.Browser.agent = Sys.Browser.WebKit;
//        Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
//        Sys.Browser.name = 'WebKit';
//    }
//}

Type.registerNamespace('AjaxControlToolkit');

AjaxControlToolkit.ComboBoxAutoCompleteMode = function() { };
AjaxControlToolkit.ComboBoxAutoCompleteMode.prototype =
{
    None: 0,
    Append: 1,
    Suggest: 2,
    SuggestAppend: 3
}

AjaxControlToolkit.ComboBoxAutoCompleteMode.registerEnum(
    'AjaxControlToolkit.ComboBoxAutoCompleteMode', false);

AjaxControlToolkit.ComboBoxStyle = function() { };
AjaxControlToolkit.ComboBoxStyle.prototype =
{
    DropDownList: 0,
    DropDown: 1,
    Simple: 2
}

AjaxControlToolkit.ComboBoxStyle.registerEnum(
    'AjaxControlToolkit.ComboBoxStyle', false);

AjaxControlToolkit.ComboBoxTextSelectionStrategy = function() { };
AjaxControlToolkit.ComboBoxTextSelectionStrategy.prototype =
{
    Unknown: 0,
    Microsoft: 1,
    W3C: 2
}

AjaxControlToolkit.ComboBoxTextSelectionStrategy.registerEnum(
    "AjaxControlToolkit.ComboBoxTextSelectionStrategy", false);


AjaxControlToolkit.ComboBox = function(element) {

    AjaxControlToolkit.ComboBox.initializeBase(this, [element]);

    this._comboTableControl = null;
    this._textBoxControl = null;
    this._optionListControl = null;
    this._buttonControl = null;
    this._hiddenFieldControl = null;
    this._autoPostBack = false;
    this._autoCompleteMode = null;
    this._dropDownStyle = null;
    this._caseSensitive = false;
    this._originalSelectedIndex = null;
    this._listItemHoverCssClass = null;

    this._popupBehavior = null;
    this._supressFocusHide = true;
    this._doingPostBack = false;
    this._textSelectionStrategy = null;
    this._highlightSuggestedItem = false;
    this._highlightedIndex = null;

    this._optionListItems = null;
    this._optionListItemHeight = null;
    this._optionListHeight = null;
    this._optionListWidth = null;

    this.clearDelegates();

}

AjaxControlToolkit.ComboBox.prototype = {

    initialize: function() {

        AjaxControlToolkit.ComboBox.callBaseMethod(this, 'initialize');
        this.createDelegates();
        this.initializeTextBox();
        this.initializeButton();
        this.initializeOptionList();
        this.addHandlers();

    },
    dispose: function() {

        // dispose of popup extender
        if (this._popupBehavior) {
            this._popupBehavior.remove_showing(this._popupShowingHandler);
            this._popupBehavior.remove_shown(this._popupShownHandler);
            this._popupBehavior.remove_hiding(this._popupHidingHandler);
            this._popupBehavior.dispose();
            this._popupBehavior = null;
        }

        this.clearHandlers();
        this.clearDelegates();

        AjaxControlToolkit.ComboBox.callBaseMethod(this, 'dispose');

    },
    createDelegates: function() {

        this._listMouseOverHandler = Function.createDelegate(this, this._onListMouseOver);
        this._listMouseOutHandler = Function.createDelegate(this, this._onListMouseOut);
        this._listMouseDownHandler = Function.createDelegate(this, this._onListMouseDown);
        this._listClickHandler = Function.createDelegate(this, this._onListClick);
        this._listDragHandler = Function.createDelegate(this, this._onListDrag);
        this._listSelectStartHandler = Function.createDelegate(this, this._onListSelectStart);
        this._listMouseWheelHandler = Function.createDelegate(this, this._onListMouseWheel);
        this._textBoxClickHandler = Function.createDelegate(this, this._onTextBoxClick);
        this._textBoxFocusHandler = Function.createDelegate(this, this._onTextBoxFocus);
        this._textBoxBlurHandler = Function.createDelegate(this, this._onTextBoxBlur);
        this._textBoxKeyPressHandler = Function.createDelegate(this, this._onTextBoxKeyPress);
        this._textBoxKeyDownHandler = Function.createDelegate(this, this._onTextBoxKeyDown);
        this._buttonClickHandler = Function.createDelegate(this, this._onButtonClick);
        this._buttonBlurHandler = Function.createDelegate(this, this._onButtonBlur);
        this._buttonKeyDownHandler = Function.createDelegate(this, this._onButtonKeyDown);
        this._buttonKeyPressHandler = Function.createDelegate(this, this._onButtonKeyPress);
        this._documentClickHandler = Function.createDelegate(this, this._onDocumentClick);
        this._documentMouseWheelHandler = Function.createDelegate(this, this._onDocumentMouseWheel);
        this._popupShowingHandler = Function.createDelegate(this, this._popupShowing);
        this._popupShownHandler = Function.createDelegate(this, this._popupShown);
        this._popupHidingHandler = Function.createDelegate(this, this._popupHiding);

    },
    clearDelegates: function() {

        this._listMouseOverHandler = null;
        this._listMouseOutHandler = null;
        this._listMouseDownHandler = null;
        this._listClickHandler = null;
        this._listDragHandler = null;
        this._listSelectStartHandler = null;
        this._listMouseWheelHandler = null;
        this._textBoxClickHandler = null;
        this._textBoxFocusHandler = null;
        this._textBoxBlurHandler = null;
        this._textBoxKeyPressHandler = null;
        this._textBoxKeyDownHandler = null;
        this._buttonClickHandler = null;
        this._buttonBlurHandler = null;
        this._buttonKeyDownHandler = null;
        this._buttonKeyPressHandler = null;
        this._documentClickHandler = null;
        this._documentMouseWheelHandler = null;
        this._popupShowingHandler = null;
        this._popupShownHandler = null;
        this._popupHidingHandler = null;

    },
    addHandlers: function() {

        $addHandlers(this.get_optionListControl(),
		{
		    'mouseover': this._listMouseOverHandler,
		    'mouseout': this._listMouseOutHandler,
		    'mousedown': this._listMouseDownHandler,
		    'click': this._listClickHandler,
		    'drag': this._listDragHandler,
		    'selectstart': this._listSelectStartHandler,
		    'mousewheel': this._listMouseWheelHandler
		}, this);

        $addHandlers(this.get_textBoxControl(),
        {
            "click": this._textBoxClickHandler,
            "focus": this._textBoxFocusHandler,
            "blur": this._textBoxBlurHandler,
            "keypress": this._textBoxKeyPressHandler
        }, this);
        if (Sys.Browser.agent == Sys.Browser.InternetExplorer || Sys.Browser.agent === Sys.Browser.Safari
            || Sys.Browser.agent === Sys.Browser.WebKit) {
            $addHandler(this.get_textBoxControl(), "keydown", this._textBoxKeyDownHandler);
        }

        $addHandlers(this.get_buttonControl(),
		{
		    'click': this._buttonClickHandler,
		    'blur': this._buttonBlurHandler,
		    'keydown': this._buttonKeyDownHandler,
		    'keypress': this._buttonKeyPressHandler
		}, this);

        $addHandlers(document,
        {
            'click': this._documentClickHandler,
            'mousewheel': this._documentMouseWheelHandler
        }, this);

        // FF doesn't have an onmousewheel event
        if (typeof (this.get_optionListControl().onmousewheel) === 'undefined') {

            this.get_optionListControl()._thisPrototype = this;
            if (typeof (document.ajax__combobox_prototypes) === 'undefined') {
                document.ajax__combobox_prototypes = new Array();
            }
            Array.add(document.ajax__combobox_prototypes, this);

            this.get_optionListControl().addEventListener('DOMMouseScroll', this._onListMouseWheel, false);
            document.addEventListener('DOMMouseScroll', this._onDocumentMouseWheel, false);
        }

    },
    clearHandlers: function() {

        $clearHandlers(this.get_optionListControl());
        $clearHandlers(this.get_textBoxControl());
        $clearHandlers(this.get_buttonControl());
        $clearHandlers(document);

    },
    initializeTextBox: function() {

        // initialize style
        var style = this.get_textBoxControl().style;

        // default browser margins interfere with button alignment
        if (style.margin == '')
            style.margin = '0px';

    },
    initializeButton: function() {

        // initialize style
        var style = this.get_buttonControl().style;

        // container height is based on the textbox's offsetHeight
        if (style.height == '')
            style.height = this.get_textBoxControl().offsetHeight + 'px';
        if (style.width == '')
            style.width = style.height;

        // zero margins & padding (helps particularly in firefox)
        if (style.margin == '')
            style.margin = '0px';
        if (style.padding == '')
            style.padding = '0px';

        // button is originally hidden to reduce screen flicker
        this._buttonControl.style.visibility = 'visible';

    },
    initializeOptionList: function() {

        // when there are no option items, server does not render a UL element. 
        if (this.get_optionListControl() == null) {
            var optionList = document.createElement('ul');
            this.get_element().appendChild(optionList);
            this.set_optionListControl(optionList);
        }

        // force inline display on Safari by moving the list to the bottom of the form.
        if (Sys.Browser.agent === Sys.Browser.Safari || Sys.Browser.agent === Sys.Browser.WebKit) {
            this.get_element().removeChild(this.get_optionListControl());
            var parent = this.get_element().parentNode;
            while (typeof (parent) != typeof (document.forms[0])) {
                parent = parent.parentNode
            }
            parent.appendChild(this.get_optionListControl())
        }

        // initialize style
        var style = this.get_optionListControl().style;

        // option list is originally display-none to force inline rendering
        style.display = 'block';
        style.zIndex = '10000';

        // build an array of list items
        this._optionListItems = new Array();
        var children = this.get_optionListControl().childNodes;
        for (var i = 0; i < children.length; i++) {

            // evaluate the current node to see if it should be added to the list items array
            var child = children[i];

            // there may be more childNodes than items in the list -- remove non-li elements
            if (child.tagName == undefined || child.tagName.toUpperCase() != 'LI') {
                // remove the child, then re-evaluate this index
                this.get_optionListControl().removeChild(child);
                i--;
                continue;
            }

            // add the item to the internal collection
            var item = new Object();
            var text = child.innerHTML.trim();

            // remove carriage returns
            var indexOfCarriageReturn = text.indexOf('\r');
            while (indexOfCarriageReturn >= 0) {
                text = text.substring(0, indexOfCarriageReturn).trim()
                    + ' ' + text.substring(indexOfCarriageReturn + 1, text.length).trim();
                indexOfCarriageReturn = text.indexOf('\r');
            }

            // remove newlines
            var indexOfNewline = text.indexOf('\n');
            while (indexOfNewline >= 0) {
                text = text.substring(0, indexOfNewline).trim()
                    + ' ' + text.substring(indexOfNewline + 1, text.length).trim();
                indexOfNewline = text.indexOf('\n');
            }

            // replace HTML entities with character equivalents
            text = text.replace('&amp;', '&')
                .replace('&quot;', '"')
                .replace('&gt;', '>')
                .replace('&lt;', '<');

            item.text = text.trim();
            Array.add(this._optionListItems, item);

            // style the ListItem with default skin
            this.initializeOptionListItem(child);
        }

        // initialize list width
        style.width = this._getOptionListBounds().width + 'px';
        style.width = '0px';

        // add the popup behavior to the master container, targeting the option list
        this._popupBehavior = $create(AjaxControlToolkit.PopupBehavior,
		{
		    'id': this.get_id() + '_PopupBehavior'
			, 'parentElement': this.get_textBoxControl()
			, "positioningMode": AjaxControlToolkit.PositioningMode.BottomLeft
		}, null, null, this.get_optionListControl());
        this._popupBehavior.add_showing(this._popupShowingHandler);
        this._popupBehavior.add_shown(this._popupShownHandler);
        this._popupBehavior.add_hiding(this._popupHidingHandler);

        // highlight the default item and set the default text
        if (this.get_selectedIndex() >= 0) {
            this._highlightListItem(this.get_selectedIndex());
            this.get_textBoxControl().value = this._optionListItems[this.get_selectedIndex()].text;
        }
        else {
            this.get_textBoxControl().text = '';
        }

        // show and hide the popup behavior to initialize dimensions and overflow
        this._popupShowing();
        this.get_optionListControl().style.display = "none";

    },
    initializeOptionListItem: function(liElement) {

        // ensure empty text appears in the list
        liElement._textIsEmpty = false;
        if (liElement.innerHTML.length < 1) {
            liElement.innerHTML = '&nbsp;';
            liElement._textIsEmpty = true;
        }

    },
    _popupShowing: function() {

        // find out what dimensions and positioning we are working with
        var windowBounds = this._getWindowBounds();
        var tableBounds = Sys.UI.DomElement.getBounds(this.get_comboTableControl());
        var optionListBounds = this._getOptionListBounds();
        var safetyDimension = 30;

        // determine placement
        var yThreshold = windowBounds.y + (windowBounds.height / 2);
        var yFlopPoint = tableBounds.y + tableBounds.height;
        var xThreshold = windowBounds.x + (windowBounds.width / 2);
        var xFlopPoint = tableBounds.x + (tableBounds.width / 2);

        // vertical alignment & height
        var maxHeight = tableBounds.y - windowBounds.y;
        var yAlign = 'Top';
        if (yFlopPoint <= yThreshold) {
            yAlign = 'Bottom';
            maxHeight = windowBounds.height - tableBounds.height - maxHeight;
        }

        // when the list contains few enough items, maxHeight may be too large
        var itemHeight = this._getOptionListItemHeight();
        if (maxHeight >= optionListBounds.height) {
            maxHeight = optionListBounds.height;
        }
        else {
            // adjust maxHeight to be a multiple of listItemHeight
            maxHeight = itemHeight * ((Math.floor(maxHeight / itemHeight)) - 2);
        }
        var visibleItems = maxHeight / itemHeight;
        var yScrollbar = (visibleItems < this._optionListItems.length);
        var scrollbarWidth = 20;

        // when the list will fit safely, give it default alignment
        if (yAlign == "Top" && maxHeight < (windowBounds.height - tableBounds.y)) {
            yAlign = "Bottom";
        }

        // horizontal alignment & width
        var maxWidth = tableBounds.x - windowBounds.x;
        var xAlign = 'Left';
        if (xFlopPoint <= xThreshold) {
            maxWidth = windowBounds.width - maxWidth;
        }
        else {
            xAlign = 'Right';
            maxWidth = tableBounds.width + maxWidth;
        }

        // subtract safety dimension
        maxWidth -= safetyDimension;

        // when the list contains short items, maxWidth may be too large.
        var bestWidth = optionListBounds.width;
        if (yScrollbar) {
            bestWidth += scrollbarWidth;
            if (maxWidth >= bestWidth) {
                maxWidth = bestWidth;
            }
        }
        else if (maxWidth >= bestWidth) {
            maxWidth = bestWidth;
        }

        // when the list will fit safely, give it default alignment
        if (xAlign == "Right" && maxWidth < (windowBounds.width - tableBounds.x)) {
            xAlign = "Left";
        }

        // when list is empty, maxheight is -Infinity
        if (maxHeight < 0) {
            maxHeight = 0;
        }

        // set width & height
        var style = this.get_optionListControl().style;
        style.height = maxHeight + 'px';
        style.width = maxWidth + 'px';

        // account for scrollbars
        if (yScrollbar) {
            style.overflow = 'auto';
            style.overflowX = 'hidden';
        }
        else {
            style.overflow = 'hidden';
        }

        // set positioning mode
        var compositeAlign = yAlign + xAlign;
        if (compositeAlign == 'BottomLeft')
            this._popupBehavior.set_positioningMode(AjaxControlToolkit.PositioningMode.BottomLeft);
        else if (compositeAlign == 'BottomRight')
            this._popupBehavior.set_positioningMode(AjaxControlToolkit.PositioningMode.BottomRight);
        else if (compositeAlign == 'TopLeft')
            this._popupBehavior.set_positioningMode(AjaxControlToolkit.PositioningMode.TopLeft);
        else if (compositeAlign == 'TopRight')
            this._popupBehavior.set_positioningMode(AjaxControlToolkit.PositioningMode.TopRight);
        this.get_optionListControl().style.visibility = 'hidden';

    },
    _popupShown: function() {

        this.get_optionListControl().style.display = 'block';

        // check and enforce correct positioning.
        var tableBounds = Sys.UI.DomElement.getBounds(this.get_comboTableControl());
        var listBounds = Sys.UI.DomElement.getBounds(this.get_optionListControl());
        var textBoxBounds = Sys.UI.DomElement.getBounds(this.get_textBoxControl());
        var y = listBounds.y;
        var x;

        if (this._popupBehavior.get_positioningMode() === AjaxControlToolkit.PositioningMode.BottomLeft
            || this._popupBehavior.get_positioningMode() === AjaxControlToolkit.PositioningMode.TopLeft) {
            x = textBoxBounds.x;
        }
        else if (this._popupBehavior.get_positioningMode() === AjaxControlToolkit.PositioningMode.BottomRight
            || this._popupBehavior.get_positioningMode() === AjaxControlToolkit.PositioningMode.TopRight) {
            x = textBoxBounds.x - (listBounds.width - textBoxBounds.width);
        }

        Sys.UI.DomElement.setLocation(this.get_optionListControl(), x, y);

        // enforce default scroll
        this._ensureHighlightedIndex();
        this._ensureScrollTop();

        // show the option list
        this.get_optionListControl().style.visibility = 'visible';

    },
    _popupHiding: function() {

        // hide the option list
        this._highlightSuggestedItem = false;
        this.get_optionListControl().style.display = 'none';
        this.get_optionListControl().style.visibility = 'hidden';

    },
    _onButtonClick: function(e) {

        // in Simple mode, always display the list
        if (this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.Simple) {
            this._popupBehavior.show();
        }

        // show / hide the option list
        else if (this._popupBehavior._visible) {
            this._popupBehavior.hide();
        }
        else {
            this._popupBehavior.show();
        }

        e.preventDefault();
        e.stopPropagation();
        return false;

    },
    _onButtonBlur: function(e) {

        // optionally trigger postback
        if (this.get_autoPostBack() == true && !this._doingPostBack && this._originalSelectedIndex != this.get_selectedIndex()) {
            this._doingPostBack = true;
            __doPostBack(this.get_element().id, '');
        }

    },
    _onButtonKeyDown: function(e) {

        // sometimes user can type while the button has focus
        if (e.keyCode == Sys.UI.Key.tab || e.keyCode == 16) { // 16==SHIFT key
            return true;
        }

        if (!this._popupBehavior._visible && (e.keyCode == Sys.UI.Key.enter || e.keyCode == Sys.UI.Key.down)) {
            this._popupBehavior.show();
        }
        else if (this._popupBehavior._visible && (e.keyCode == Sys.UI.Key.enter || e.keyCode == Sys.UI.Key.up)) {
            this._popupBehavior.hide();
        }

        e.stopPropagation();
        e.preventDefault();

        // give focus to the text box
        var textBoxID = this.get_textBoxControl().id;
        setTimeout(function() { document.getElementById(textBoxID).focus(); }, 0);
        return false;

    },
    _onButtonKeyPress: function(e) {

        // sometimes user can type while the button has focus
        if (e.charCode == Sys.UI.Key.tab || e.charCode == 16) { // 16==SHIFT key
            return true;
        }
        e.stopPropagation();
        e.preventDefault();
        return false;

    },
    _onListMouseWheel: function(e) {

        // event is invoked by either this prototype or the DOM option list object
        var _this = this._thisPrototype;
        if (typeof (_this) === 'undefined') {
            _this = this;
        }

        // enforce mousewheel scrolling
        var direction;
        if (typeof (this._thisPrototype) === 'undefined') {
            // not firefox
            direction = (e.rawEvent.wheelDelta > 1) ? -1 : 1;
        }
        else {
            // firefox
            direction = (e.detail >= 1) ? 1 : -1;
        }

        // each event scrolls approximately 1 list item up or down
        var scrollStep = _this._getOptionListItemHeight() * direction;
        var newScrollTop = _this.get_optionListControl().scrollTop + scrollStep;
        _this.get_optionListControl().scrollTop = newScrollTop;

        // tell parents we have handled this event
        e.stopPropagation();
        e.preventDefault();
        return false;

    },
    _onListMouseOver: function(e) {

        // do not highlight unless an LI is being hovered
        if (e.target !== this.get_optionListControl()) {
            var target = e.target;
            var children = this.get_optionListControl().childNodes;

            // loop through children to find a match with the target
            for (var i = 0; i < children.length; ++i) {
                // match found, highlight item and break loop
                if (target === children[i]) {
                    this._highlightListItem(i, true);
                    break;
                }
            }
        }

    },
    _onListMouseOut: function(e) {

        // unhighlight the highlighted item if the list is open in suggestappend mode
        // prevents overriding user-typed text when determining the selectedindex
        if (this._popupBehavior._visible
            && this.get_autoCompleteMode() == AjaxControlToolkit.ComboBoxAutoCompleteMode.SuggestAppend) {
            this._highlightListItem(this._highlightedIndex, false);
        }

    },
    _onListMouseDown: function(e) {

        if (e.target == this.get_optionListControl() || e.target.tagName == 'scrollbar') {
            return true;
        }

        // set the TextBox to the highlighted ListItem's text and update selectedIndex
        if (e.target !== this.get_optionListControl()) {
            var highlightedItem = this.get_optionListControl().
				childNodes[this._highlightedIndex];
            var text = this._optionListItems[this._highlightedIndex].text;
            this.get_textBoxControl().value = text;
            this.set_selectedIndex(this._highlightedIndex);

            // return focus to the TextBox
            this._supressFocusHide = false;
            this.get_textBoxControl().focus();
        }
        else {
            return true;
        }
        e.preventDefault();
        e.stopPropagation();
        return false;

    },
    _onListClick: function(e) {

        if (e.target == this.get_optionListControl()) {
            return true;
        }

        // prevent ItemList clicks from triggering document clicks
        e.preventDefault();
        e.stopPropagation();
        return false;

    },
    _onListDrag: function(e) {

        // prevent selection of ListItem text
        e.preventDefault();
        e.stopPropagation();
        return false;

    },
    _onListSelectStart: function(e) {

        // prevent selection of ListItem text
        e.preventDefault();
        e.stopPropagation();
        return false;

    },
    _onTextBoxClick: function(e) {

        // in Simple mode, always display the list
        if (this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.Simple) {
            this._popupBehavior.show();
        }

        // prevent TextBox clicks from triggering document clicks
        e.preventDefault();
        e.stopPropagation();
        return false;

    },
    _onTextBoxFocus: function(e) {

        // hide the option list and optionally trigger postback
        if (!this._supressFocusHide && this._popupBehavior._visible) {
            this._popupBehavior.hide();
            this._supressFocusHide = true;
            if (this.get_autoPostBack() && !this._doingPostBack && this._originalSelectedIndex != this.get_selectedIndex()) {
                this._doingPostBack = true;
                __doPostBack(this.get_element().id, '');
            }
        }

        // in Simple mode, always display the list
        if (this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.Simple) {
            this._popupBehavior.show();
        }

        // select the entire string in the text box
        this._setTextSelectionRange(
            this.get_textBoxControl(),
            0,
            this.get_textBoxControl().value.length);

        e.preventDefault();
        e.stopPropagation();

    },
    _onTextBoxBlur: function(e) {

        // select the correct index based on text box value
        var textBoxValue = this.get_textBoxControl().value.trim();
        var matchedIndex = -3;

        // search items
        for (var i = 0; i < this._optionListItems.length; i++) {
            var item = this._optionListItems[i];
            if (this._isExactMatch(item.text, textBoxValue)) {
                matchedIndex = i;
                break;
            }
        }

        // when in suggest mode, a suggested index may already be set
        if (this._highlightSuggestedItem == true && this._highlightedIndex != null && this._highlightedIndex >= 0) {
            this.set_selectedIndex(this._highlightedIndex);
            this.get_textBoxControl().value = this._optionListItems[this.get_selectedIndex()].text;
        }

        // selected index is -2 when custom text is entered in dropdownlist mode
        else if (matchedIndex == -3 && textBoxValue.length > 0
            && this.get_dropDownStyle() != AjaxControlToolkit.ComboBoxStyle.DropDownList) {
            this.set_selectedIndex(-2);
        }

        // selected index is -1 when there are no items in the list and there is no custom text
        else if (this._optionListItems.length < 1 && (textBoxValue == ''
            || this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.DropDownList)) {
            this.set_selectedIndex(-1);
            this.get_textBoxControl().value = '';
        }

        // when list contains items but none matched, select the first item by default
        else if (this._optionListItems.length >= 0 && matchedIndex == -3
            && this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.DropDownList) {
            this.set_selectedIndex(0);
            this.get_textBoxControl().value = this._optionListItems[0].text;
        }

        // when list contains a matchable item, set the selected index
        else if (matchedIndex >= 0) {
            this.set_selectedIndex(matchedIndex);
            this.get_textBoxControl().value = this._optionListItems[matchedIndex].text;
        }

        // hide the option list and optionally trigger postback
        this._popupBehavior.hide();
        if (this.get_autoPostBack() == true && !this._doingPostBack && this._originalSelectedIndex != this.get_selectedIndex()) {
            this._doingPostBack = true;
            __doPostBack(this.get_element().id, '');
        }

    },
    _onTextBoxKeyDown: function(e) {

        // keydown is not fired in ff or opera. keypress is fired instead.
        // in ie and safari, keydown is fired before keypress for character keys and the ENTER key.
        // in ie and safari, keydown is fired instead of keypress for ARROWS, BACKSPACE, and DELETE keys.
        // only keyCodes are sent to this event: charCodes are always undefined here.

        // user presses ENTER while text box has focus
        var enterResult = this._handleEnterKey(e);
        if (enterResult != null) {
            return enterResult;
        }

        this._handleArrowKey(e);

        // handle backspace and delete keystrokes
        var erasureKeyResult = this._handleErasureKeys(e);
        if (erasureKeyResult != null) {
            return erasureKeyResult;
        }

        return true;

    },
    _onTextBoxKeyPress: function(e) {

        // user presses ENTER while text box has focus
        var enterResult = this._handleEnterKey(e);
        if (enterResult != null) {
            return enterResult;
        }

        // some browsers, like ff and Opera, send arrow strokes here instead of keydown 
        var arrowResult = this._handleArrowKey(e);
        if (arrowResult != null) {
            return arrowResult;
        }

        // do not prevent all keypresses, only character keypresses.
        var nonCharacterKeyResult = this._handleNonCharacterKey(e);
        if (nonCharacterKeyResult != null) {
            return nonCharacterKeyResult;
        }

        // always show list in simple mode
        if (this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.Simple && !this._popupBehavior._visible) {
            this._popupBehavior.show();
        }

        // prevent typing when there are no items in the list
        if (this.get_selectedIndex() == -1 && this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.DropDownList) {
            this.get_textBoxControl().value = '';
            e.preventDefault();
            e.stopPropagation();
            return false;
        }

        // get info about the text and selection
        var info = this._getTextSelectionInfo(this.get_textBoxControl(), e);
        var newSelectionStart = info.selectionStart;
        var newSelectionEnd = info.selectionEnd;
        var allText = info.selectionPrefix + info.typedCharacter
            + info.selectionText.substring(1) + info.selectionSuffix;
        var userText = info.selectionPrefix + info.typedCharacter;
        var suggestedIndex = this._suggestIndex(allText, userText);

        // setup suggest behavior
        if (this.get_autoCompleteMode() == AjaxControlToolkit.ComboBoxAutoCompleteMode.Suggest
                || this.get_autoCompleteMode() == AjaxControlToolkit.ComboBoxAutoCompleteMode.SuggestAppend) {
            this._highlightSuggestedItem = true;
            if (!this._popupBehavior._visible) {
                this._popupBehavior.show();
            }
        }

        // suggestedIndex can be a valid index or -1.
        if (suggestedIndex >= 0) {

            // handle append behavior
            if (this.get_autoCompleteMode() == AjaxControlToolkit.ComboBoxAutoCompleteMode.Append
                    || this.get_autoCompleteMode() == AjaxControlToolkit.ComboBoxAutoCompleteMode.SuggestAppend) {
                this.get_textBoxControl().value = this._optionListItems[suggestedIndex].text;
                newSelectionStart = info.selectionStart + 1;
                newSelectionEnd = this.get_textBoxControl().value.length;
            }
            // do not append suggestion
            else {
                this.get_textBoxControl().value = this._optionListItems[suggestedIndex].text.substring(0, userText.length);
                newSelectionStart = this.get_textBoxControl().value.length;
                newSelectionEnd = this.get_textBoxControl().value.length;
            }
        }

        // when suggestedIndex is -1, there is no match.
        else if (this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.Simple
                || this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.DropDown) {
            this.get_textBoxControl().value = userText;
            newSelectionStart = userText.length;
            newSelectionEnd = userText.length;
        }

        // handle backspace and delete keystrokes
        var erasureKeyResult = this._handleErasureKeys(e);
        if (erasureKeyResult != null) {
            return erasureKeyResult;
        }

        // automatically highlight and scroll based on typing
        this._ensureHighlightedIndex();
        this._ensureScrollTop();
        this._setTextSelectionRange(this.get_textBoxControl(), newSelectionStart, newSelectionEnd);

        e.preventDefault();
        e.stopPropagation();
        return false;

    },
    _onDocumentClick: function(e) {

        // hide the option list when users click document
        if (this._popupBehavior._visible) {
            this._popupBehavior.hide();
        }

    },
    _onDocumentMouseWheel: function(e) {

        // event is invoked by either 'this' prototype or the DOM document object
        var _this = this.ajax__combobox_prototypes;
        if (typeof (_this) === 'undefined') {
            _this = this;
        }

        // hide the option list when user mousewheel scrolls outside of it
        if (typeof (this.ajax__combobox_prototypes) === 'undefined') {
            this._popupBehavior.hide();
        }
        else {
            for (var i = 0; i < this.ajax__combobox_prototypes.length; i++) {
                this.ajax__combobox_prototypes[i]._popupBehavior.hide();
            }
        }

        return true;

    },
    _highlightListItem: function(index, isHighlighted) {

        // only highlight valid indices
        if (index == undefined || index < 0) {
            if (this._highlightedIndex != undefined && this._highlightedIndex >= 0) {
                this._highlightListItem(this._highlightedIndex, false);
            }
            return;
        }

        var children = this.get_optionListControl().childNodes;
        var liElement = children[index];

        // item is being hovered
        if (isHighlighted == true) {

            // skip if already highlighted
            if (this._highlightedIndex == index)
                return;

            // apply hover css class
            if (index >= 0) {
                // to avoid scrollbar flickering during scrolls in IE, do not set className unless it is provided
                if (this.get_listItemHoverCssClass() == undefined || this.get_listItemHoverCssClass() == '') {
                    liElement.style.backgroundColor = 'Highlight';
                    liElement.style.color = 'HighlightText'
                }
                else {
                    liElement.className = this.get_listItemHoverCssClass;
                }
            }

            // unselect previously highlighted item
            if (this._highlightedIndex != null && this._highlightedIndex != index && this._highlightedIndex >= 0) {
                this._highlightListItem(this._highlightedIndex, false);
            }

            // update control state
            this._highlightedIndex = index;
        }

        // item is not being hovered
        else {
            if (this.get_listItemHoverCssClass() == undefined || this.get_listItemHoverCssClass() == '') {
                liElement.style.backgroundColor = '';
                liElement.style.color = ''
            }
            else {
                liElement.className = '';
            }

            if (index == this._highlightedIndex) {
                this._highlightedIndex = -1;
            }
        }

    },
    _suggestIndex: function(allText, userText) {

        // suggest closest option list match based on user's typing
        var suggestedIndex = -1;
        var firstMatch = false;
        var exactMatch = false;

        // loop through all options in the list
        for (var i = 0; i < this._optionListItems.length; i++) {
            itemText = this._optionListItems[i].text;

            // skip empty elements
            if (itemText.length < 1)
                continue;

            // skip elements that don't match on first character
            if (itemText.substring(0, 1).toLowerCase() != userText.substring(0, 1).toLowerCase())
                continue;

            // first, check if strings are exact match
            var allCandidate = itemText.substring(0, allText.length);
            exactMatch = (allCandidate == allText);
            if (!exactMatch && !this.get_caseSensitive()) {
                exactMatch = (allCandidate.toLowerCase() == allText.toLowerCase());
            }

            // always return exact matches before first matches
            if (exactMatch) {
                suggestedIndex = i;
                break;
            }

            // otherwise, look for a partial match and keep going
            else if (!firstMatch) {
                var userCandidate = itemText.substring(0, userText.length);
                firstMatch = (userCandidate == userText);
                if (!firstMatch && !this.get_caseSensitive())
                    firstMatch = (userCandidate.toLowerCase() == userText.toLowerCase());
                if (firstMatch)
                    suggestedIndex = i;
            }
        }
        return suggestedIndex;

    },
    _getKeyboardCode: function(e) {

        if (e.type == 'keypress') {
            return e.charCode;
        } else if (e.type == 'keydown') {
            return e.keyCode;
        }
        return undefined;

    },
    _handleArrowKey: function(e) {

        var code = this._getKeyboardCode(e);

        // cycle through items when up & down arrow keys are used
        if (code == Sys.UI.Key.up || code == Sys.UI.Key.down) {
            if (this._popupBehavior._visible) {
                var vector = code - 39;
                if ((vector == -1 && this._highlightedIndex > 0) || (vector == 1 && this._highlightedIndex < this._optionListItems.length - 1)) {
                    var newIndex = (this._highlightedIndex + vector);
                    this.get_textBoxControl().value = this._optionListItems[newIndex].text;
                    this._highlightListItem(newIndex, true);
                    this.set_selectedIndex(newIndex);
                    this._ensureScrollTop();
                }
            }
            else {
                this._popupBehavior.show();
            }

            if (e.type == 'keypress') {
                e.preventDefault();
                e.stopPropagation();
                return false;
            }
            return true;
        }
        return null;

    },
    _handleEnterKey: function(e) {

        var code = this._getKeyboardCode(e);

        if (code == Sys.UI.Key.enter) {
            // if the dropdown is open, close it.
            if (this._popupBehavior._visible) {
                if (this._highlightedIndex >= 0) {
                    this.get_textBoxControl().value = this._optionListItems[this._highlightedIndex].text
                    this.set_selectedIndex(this._highlightedIndex);
                }
                this._popupBehavior.hide();
                e.preventDefault();
                e.stopPropagation();
                return false;
            }

            // allow form submits for free text
            else if (this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.Simple
                || this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.DropDown) {
                return true;
            }

            // allow form submits for valid selected indices
            else if (this._highlightedIndex == this.get_selectedIndex()) {
                return true;
            }

            e.preventDefault();
            e.stopPropagation();
            return false;
        }
        return null;

    },
    _handleErasureKeys: function(e) {

        var code = this._getKeyboardCode(e);

        var isBackspaceKey = (code == Sys.UI.Key.backspace);
        var isDeleteKey = (code == Sys.UI.Key.del);
        if (e.type == 'keypress') {
            isDeleteKey = (code == 46);
        }

        if (isBackspaceKey || isDeleteKey) {

            var info = this._getTextSelectionInfo(this.get_textBoxControl(), e);
            var newSelectionStart, newSelectionEnd;

            // always delete selected characters
            if (info.selectionStart < info.selectionEnd) {
                this.get_textBoxControl().value = info.selectionPrefix + info.selectionSuffix;
                newSelectionStart = info.selectionStart;
                newSelectionEnd = info.selectionStart;
            }

            // otherwise, there is no selection -- only a carat
            else if (info.selectionStart == info.selectionEnd) {
                if (isBackspaceKey && info.selectionStart > 0) {
                    var newValue = info.selectionPrefix.substr(0, info.selectionPrefix.length - 1);
                    newValue += info.selectionSuffix;
                    this.get_textBoxControl().value = newValue;
                    newSelectionStart = info.selectionStart - 1;
                    newSelectionEnd = info.selectionStart - 1;
                }
                else if (isDeleteKey && info.selectionStart < info.textBoxValue.length) {
                    var newValue = info.selectionSuffix;
                    newValue = info.selectionPrefix + newValue.substr(1, info.selectionSuffix.length - 1);
                    this.get_textBoxControl().value = newValue;
                    newSelectionStart = info.selectionStart;
                    newSelectionEnd = info.selectionStart;
                    this._setTextSelectionRange(this.get_textBoxControl(), info.selectionStart, info.selectionStart);
                }
            }

            this._ensureHighlightedIndex();
            this._ensureScrollTop();
            this._setTextSelectionRange(this.get_textBoxControl(), newSelectionStart, newSelectionEnd);

            // in custom text modes with suggestion, need to re-check the highlighted item
            if ((this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.Simple
                || this.get_dropDownStyle() == AjaxControlToolkit.ComboBoxStyle.DropDown)
                && (this.get_autoCompleteMode() == AjaxControlToolkit.ComboBoxAutoCompleteMode.Suggest
                || this.get_autoCompleteMode() == AjaxControlToolkit.ComboBoxAutoCompleteMode.SuggestAppend)
                && this._highlightedIndex >= 0) {
                var _isExactMatch = this._isExactMatch(this._optionListItems[this._highlightedIndex].text, this.get_textBoxControl().value);
                if (!_isExactMatch) {
                    this._highlightListItem(this._highlightedIndex, false);
                }
            }

            e.preventDefault();
            e.stopPropagation();
            return false;
        }
        return null;

    },
    _handleNonCharacterKey: function(e) {

        var code = this._getKeyboardCode(e);

        var isBackspaceKey = (code == Sys.UI.Key.backspace);
        var isDeleteKey = (code == Sys.UI.Key.del);
        if (e.type == 'keypress') {
            isDeleteKey = (code == 46);
        }

        if (isBackspaceKey || isDeleteKey) {

            return null;
        }

        if (this._isNonCharacterKey(e)) {
            // prevent event validation errors when ESC is hit twice
            if (code == Sys.UI.Key.esc) {
                this._popupBehavior.hide();
                this.get_textBoxControl().blur();
                e.preventDefault();
                e.stopPropagation();
                return false;
            }
            return true;
        }
        return null;
    },
    _isNonCharacterKey: function(e) {

        // MS Ajax uses following codes for Key enumeration
        // backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127
        var code = this._getKeyboardCode(e);

        // return true if keypress actions should be allowed
        if (code == Sys.UI.Key.enter || code == Sys.UI.Key.esc) { // allow RETURN/ENTER and ESC keys for all browsers

            return true;
        }
        else if (Sys.Browser.agent == Sys.Browser.Safari && Sys.Browser.version < 500) {

            // allow special funky apple keypresses
            if (code == 8           // BACKSPACE in Safari 2
                || code == 9        // TAB in Safari 2
                || code == 63272    // DELETE in Safari 2
                || code == 63276    // PAGEUP in Safari 2
                || code == 63277    // PAGEDOWN in Safari 2
                || code == 63275    // END in Safari 2
                || code == 63273    // HOME in Safari 2
                || code == 63234    // ARROWLEFT in Safari 2
                || code == 63235    // ARROWRIGHT in Safari 2
                || (code >= 63236 && code <= 63243) // FUNCTION keys in Safari 2
                || code == 63248       // F13 key in Safari 2
            ) {
                return true;
            }
        }
        else if (Sys.Browser.agent == Sys.Browser.WebKit) {

            // allow special funky apple webkit keypresses
            if (code == 8            // BACKSPACE in Safari 3
                || code == 9         // TAB in Safari 3
                || code == 19        // PAUSE BREAK Safari 3
                || code == 33        // PAGEUP in Safari 3
                || code == 34        // PAGEDOWN in Safari 3
                || code == 35        // END in Safari 3
                || code == 36        // HOME in Safari 3
                || code == 37        // ARROWLEFT in Safari 3
                || code == 39        // ARROWRIGHT in Safari 3
                || code == 45        // INSERT in Safari 3
                || code == 46        // DELETE in Safari 3
                || code == 91        // WINDOWS LEFT Safari 3
                || code == 92        // WINDOWS RIGHT Safari 3
                || code == 93        // MENU Safari 3
                || code == 113       // F2 Safari 3
                || code == 115       // F4 Safari 3
                || code == 118       // F7 Safari 3
                || code == 119       // F8 Safari 3
                || code == 120       // F9 Safari 3
                || code == 122       // F11 Safari 3
                || code == 145       // SCROLL LOCK Safari 3
            )
                return true;
        }
        else if (Sys.Browser.agent != Sys.Browser.InternetExplorer) {

            // allow kepress events triggered by FF & Opera
            if (code == 8           // BACKSPACE in non-microsoft browsers
                || code == 9        // TAB in non-microsoft browsers
                || code == 33       // PAGEUP in non-microsoft browsers
                || code == 34       // PAGEDOWN in non-microsoft browsers
                || code == 35       // END in non-microsoft browsers
                || code == 36       // HOME in non-microsoft browsers
                || code == 37       // ARROWLEFT in non-microsoft browsers
                || code == 39       // ARROWRIGHT in non-microsoft browsers
                || code == 45       // INSERT in non-microsoft browsers
                || code == 46       // DELETE in non-microsoft browsers
            //|| (code >= 112 && code <= 123) // FUNCTION keys in non-microsoft browsers
            ) {
                if (!e.shiftKey)
                    return true;
            }
            else if (code == 145) {

                // allow SCROLL LOCK events triggered by weird combos
                return true;

            }
            else if (code == 19) {

                // allow PAUSE BREAK events triggered by weird combos
                return true;

            }
            else if (Sys.Browser.agent == Sys.Browser.Opera) {

                // allow kepress events triggered only by Opera
                if (code == 0       // MENU key in Opera
                    || code == 16   // SHIFT key in Opera
                    || code == 17   // CONTROL key in Opera
                ) {
                    return true;
                }
            }
            else if (Sys.Browser.agent == Sys.Browser.Firefox) {

                // allow kepress events triggered only by Firefox
                if (code == 91      // WINDOWS LEFT key in Firefox
                    || code == 92   // WINDOWS RIGHT key in Firefox
                    || code == 93   // MENU key in Firefox
                ) {
                    return true;
                }
            }
        }
        return false;

    },
    _ensureScrollTop: function() {

        // automatically scroll if the highlighted index is not visible. 
        if (this._highlightedIndex >= 0) {
            var itemHeight = this._getOptionListItemHeight();
            var itemTop = itemHeight * this._highlightedIndex;
            var scrollBottom = this.get_optionListControl().scrollTop + this.get_optionListControl().clientHeight;

            if (itemTop <= this.get_optionListControl().scrollTop || itemTop >= scrollBottom)
                this.get_optionListControl().scrollTop = this._highlightedIndex * itemHeight;
        }

    },
    _ensureSelectedIndex: function() {

        // server may not always invoke set_selectedIndex(), need to make sure this is always an integer
        var selectedIndex = this.get_hiddenFieldControl().value;
        if (selectedIndex == '') {
            selectedIndex = (this._optionListItems.length > 0) ? 0 : -1;
            this.get_hiddenFieldControl().value = selectedIndex.toString();
        }
        if (this._originalSelectedIndex == null) {
            this._originalSelectedIndex = parseInt(selectedIndex);
        }


    },
    _ensureHighlightedIndex: function() {

        // highlight an index according to textbox value
        var textBoxValue = this.get_textBoxControl().value;

        // first, check the current highlighted index
        if (this._highlightedIndex != null && this._highlightedIndex >= 0
            && this._isExactMatch(this._optionListItems[this._highlightedIndex].text, textBoxValue)) {
            return;
        }

        // need to find the correct index
        var firstMatch = -1;
        var ensured = false;
        for (var i = 0; i < this._optionListItems.length; i++) {
            var itemText = this._optionListItems[i].text;
            if (this._isExactMatch(itemText, textBoxValue)) {
                this._highlightListItem(i, true);
                ensured = true;
                break;
            }

            // if in DropDownList mode, save first match.
            else if (firstMatch < 0 && this._highlightSuggestedItem) {
                if (this._isPrefixMatch(itemText, textBoxValue)) {
                    firstMatch = i;
                }
            }
        }

        if (!ensured) {
            this._highlightListItem(firstMatch, true);
        }

    },
    _isExactMatch: function(itemText, userText) {

        // whether strings match exactly, depending on case sensitivity
        var exactMatch = (itemText == userText);
        if (!exactMatch && !this.get_caseSensitive())
            exactMatch = (itemText.toLowerCase() == userText.toLowerCase())

        return exactMatch;

    },
    _isPrefixMatch: function(itemText, userText) {

        // whether the user-typed text matches as the prefix of an option in the list
        return this._isExactMatch(itemText.substring(0, userText.length), userText);

    },
    _setTextSelectionRange: function(textBox, selectionStart, selectionEnd) {

        // set the selection range on the text box
        var strategy = this._getTextSelectionStrategy();
        if (strategy == AjaxControlToolkit.ComboBoxTextSelectionStrategy.Microsoft) {
            var range = textBox.createTextRange();
            range.collapse(true);
            range.moveEnd('character', selectionEnd);
            range.moveStart('character', selectionStart);
            range.select();

            // opera wants to also invoke the W3C setSelectionRange method
            if (Sys.Browser.agent == Sys.Browser.Opera) {
                textBox.setSelectionRange(selectionStart, selectionEnd)
            }
        }
        else if (strategy == AjaxControlToolkit.ComboBoxTextSelectionStrategy.W3C) {
            textBox.setSelectionRange(selectionStart, selectionEnd)
        }

    },
    _getTextSelectionStrategy: function() {

        // different browsers have different API's for selecting text
        if (this._textSelectionStrategy == null) {
            if (this.get_textBoxControl().createTextRange) {
                this._textSelectionStrategy =
                    AjaxControlToolkit.ComboBoxTextSelectionStrategy.Microsoft;
            }
            else if (this.get_textBoxControl().setSelectionRange) {
                this._textSelectionStrategy =
                    AjaxControlToolkit.ComboBoxTextSelectionStrategy.W3C;
            }
            else {
                this._textSelectionStrategy =
                    AjaxControlToolkit.ComboBoxTextSelectionStrategy.Unknown;
            }
        }

        return this._textSelectionStrategy;

    },
    _getTextSelectionInfo: function(textBox, e) {

        // returns a helper object with information about textbox selection
        var info = new Object();

        // strategy
        info.strategy = this._getTextSelectionStrategy();

        // selectionStart & selectionEnd
        if (info.strategy == AjaxControlToolkit.ComboBoxTextSelectionStrategy.Microsoft) {
            var userRange = document.selection.createRange();
            info.selectionStart = 0;
            info.selectionEnd = textBox.value.length;
            while (userRange.moveStart('character', -1) != 0) {
                info.selectionStart++;
            }
            while (userRange.moveEnd('character', 1) != 0) {
                info.selectionEnd--;
            }
        }
        else if (info.strategy == AjaxControlToolkit.ComboBoxTextSelectionStrategy.W3C) {
            info.selectionStart = textBox.selectionStart;
            info.selectionEnd = textBox.selectionEnd;
        }

        // typedCharacter, textBoxValue, selectionPrefix, selectionSuffix, selectionTextFirst
        info.typedCharacter = String.fromCharCode(e.charCode);
        info.textBoxValue = textBox.value;
        info.selectionPrefix = (info.textBoxValue.length >= info.selectionStart)
            ? info.textBoxValue.substring(0, info.selectionStart)
            : '';
        info.selectionText = (info.textBoxValue.length >= info.selectionEnd)
            ? info.textBoxValue.substring(info.selectionStart, info.selectionEnd)
            : '';
        info.selectionSuffix = (info.textBoxValue.length >= info.selectionEnd)
            ? info.textBoxValue.substring(info.selectionEnd, info.textBoxValue.length)
            : '';
        info.selectionTextFirst = info.selectionText.substring(0, 1);

        return info;

    },
    _getOptionListItemHeight: function() {

        // gets the height of an individual option list item
        if (this._optionListItemHeight == null && this.get_optionListControl().scrollHeight > 0) {
            this._optionListItemHeight = Math.round(this.get_optionListControl().scrollHeight / this._optionListItems.length);
        }
        else if (Sys.Browser.agent === Sys.Browser.InternetExplorer && Sys.Browser.version < 7
            && Math.round(this.get_optionListControl().scrollHeight / this._optionListItems.length) < this._optionListItemHeight) {
            this._optionListItemHeight = Math.round(this.get_optionListControl().scrollHeight / this._optionListItems.length);
        }
        return this._optionListItemHeight;

    },
    _getOptionListBounds: function() {

        var bounds = {
            width: this._getOptionListWidth(),
            height: this._getOptionListHeight()
        };
        return bounds;

    },
    _getOptionListHeight: function() {

        // gets the total height of the option list
        if (this._optionListHeight == null || (this._getOptionListItemHeight() * this._optionListItems.length) < this._optionListHeight) {
            // multiply the height of one item by the total number of items
            this._optionListHeight = this._getOptionListItemHeight() * this._optionListItems.length;
        }

        return this._optionListHeight;

    },
    _getOptionListWidth: function() {

        // gets the width of the option list
        if (this._optionListWidth == null) {
            var leftBorder = 1;
            var rightBorder = 1;
            var leftPadding = 0;
            var rightPadding = 0;
            var style = this.get_optionListControl().style;


            // before doing anything, make sure overflow is auto
            style.overflow = 'auto';

            // first, default to the clientWidth of the container
            var bestWidth = this.get_comboTableControl().offsetWidth;

            // subtract borders from the offsetWidth
            bestWidth -= (leftBorder + rightBorder);

            // in order for ths list's scrollWidth to be correct, must set its width
            var originalWidth = style.width;
            style.width = bestWidth + 'px';

            // now compare the list's scrollWidth to the box width
            if (this.get_comboTableControl().offsetWidth < this.get_optionListControl().scrollWidth) {
                // allow the list to extend as wide as necessary according to its contents
                bestWidth = this.get_optionListControl().scrollWidth + rightPadding + leftPadding;
            }

            // hide the overflow, as there shouldn't be any scrollbars needed now
            style.overflow = 'hidden';

            // reset the list's width style to its original setting
            style.width = originalWidth;

            this._optionListWidth = bestWidth;
        }
        return this._optionListWidth;

    },
    _getWindowBounds: function() {

        var bounds = {
            x: this._getScrollLeft(),
            y: this._getScrollTop(),
            width: this._getWindowWidth(),
            height: this._getWindowHeight()
        };
        return bounds;

    },
    _getWindowHeight: function() {

        var windowHeight = 0;
        if (typeof (window.innerHeight) == 'number') {
            windowHeight = window.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        }
        else if (document.body && document.body.clientHeight) {
            windowHeight = document.body.clientHeight;
        }
        return windowHeight;

    },
    _getWindowWidth: function() {

        var windowWidth = 0;
        if (typeof (window.innerWidth) == 'number') {
            windowWidth = window.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientWidth) {
            windowWidth = document.documentElement.clientWidth;
        }
        else if (document.body && document.body.clientWidth) {
            windowWidth = document.body.clientWidth;
        }
        return windowWidth;

    },
    _getScrollTop: function() {

        var scrollTop = 0;
        if (typeof (window.pageYOffset) == 'number') {
            scrollTop = window.pageYOffset;
        }
        if (document.body && document.body.scrollTop) {
            scrollTop = document.body.scrollTop;
        }
        else if (document.documentElement && document.documentElement.scrollTop) {
            scrollTop = document.documentElement.scrollTop;
        }
        return scrollTop;

    },
    _getScrollLeft: function() {

        var scrollLeft = 0;
        if (typeof (window.pageXOffset) == 'number') {
            scrollLeft = window.pageXOffset;
        }
        else if (document.body && document.body.scrollLeft) {
            scrollLeft = document.body.scrollLeft;
        }
        else if (document.documentElement && document.documentElement.scrollLeft) {
            scrollLeft = document.documentElement.scrollLeft;
        }
        return scrollLeft;

    },
    set_comboTableControl: function(value) {

        if (this._comboTableControl !== value) {
            this._comboTableControl = value;
            this.raisePropertyChanged('comboTableControl');
        }

    },
    get_comboTableControl: function() {

        return this._comboTableControl;

    },
    set_textBoxControl: function(value) {

        if (this._textBoxControl !== value) {
            this._textBoxControl = value;
            this.raisePropertyChanged('textBoxControl');
        }

    },
    get_textBoxControl: function() {

        return this._textBoxControl;

    },
    set_buttonControl: function(value) {

        if (this._buttonControl !== value) {
            this._buttonControl = value;
            this.raisePropertyChanged('buttonControl');
        }

    },
    get_buttonControl: function() {
        return this._buttonControl;
    },
    set_optionListControl: function(value) {

        if (this._optionListControl !== value) {
            this._optionListControl = value;
            this.raisePropertyChanged('optionListControl');
        }

    },
    get_optionListControl: function() {

        return this._optionListControl;

    },
    set_hiddenFieldControl: function(value) {

        if (this._hiddenFieldControl !== value) {
            this._hiddenFieldControl = value;
            this.raisePropertyChanged('hiddenFieldControl');
        }

    },
    get_hiddenFieldControl: function() {

        return this._hiddenFieldControl;

    },
    set_selectedIndex: function(value) {

        if (this.get_hiddenFieldControl().value !== value.toString()) {
            this.get_hiddenFieldControl().value = value.toString();
            this._ensureSelectedIndex();
            this.raisePropertyChanged('selectedIndex');
        }

    },
    get_selectedIndex: function() {

        this._ensureSelectedIndex();
        var selectedIndex = this.get_hiddenFieldControl().value;
        return parseInt(selectedIndex);

    },
    set_autoPostBack: function(value) {

        if (this._autoPostBack !== value) {
            this._autoPostBack = value;
            this.raisePropertyChanged('autoPostBack');
        }

    },
    get_autoPostBack: function() {

        return this._autoPostBack;

    },
    set_autoCompleteMode: function(value) {

        if (this._autoCompleteMode !== value) {
            this._autoCompleteMode = value;
            this.raisePropertyChanged('autoCompleteMode');
        }

    },
    get_autoCompleteMode: function() {

        return this._autoCompleteMode;

    },
    set_dropDownStyle: function(value) {

        if (this._dropDownStyle !== value) {
            this._dropDownStyle = value;
            this.raisePropertyChanged('dropDownStyle');
        }

    },
    get_dropDownStyle: function() {

        return this._dropDownStyle;

    },
    set_caseSensitive: function(value) {

        if (this._caseSensitive !== value) {
            this._caseSensitive = value;
            this.raisePropertyChanged('caseSensitive');
        }

    },
    get_caseSensitive: function() {

        return this._caseSensitive;

    },
    set_listItemHoverCssClass: function(value) {

        if (this._listItemHoverCssClass !== value) {
            this._listItemHoverCssClass = value;
            this.raisePropertyChanged('listItemHoverCssClass');
        }

    },
    get_listItemHoverCssClass: function() {

        return this._listItemHoverCssClass;

    }

}

AjaxControlToolkit.ComboBox.registerClass('AjaxControlToolkit.ComboBox', Sys.UI.Control);

//if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();


//END AjaxControlToolkit.ComboBox.ComboBox.js
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {$get('ctl00_ctl00_ScriptManager_HiddenField').value += ';;AjaxControlToolkit, Version=3.0.30512.28916, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:ru-RU:57654e7c-4dcd-4553-9076-d5b7c7fab784:1df13a87:e2e86ef9:9ea3f0e2:9e8e87e9:4c9865be:ba594826:a5000a55';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
