Type.registerNamespace("AjaxControlToolkit");
AjaxControlToolkit.AutoCompleteBehavior = function(d) {
var c = false, b = null, a = this;
AjaxControlToolkit.AutoCompleteBehavior.initializeBase(a, [d]);
a._servicePath = b;
a._serviceMethod = b;
a._contextKey = b;
a._useContextKey = c;
a._minimumPrefixLength = 3;
a._completionSetCount = 10;
a._completionInterval = 1e3;
a._completionListElementID = b;
a._completionListElement = b;
a._textColor = "windowtext";
a._textBackground = "window";
a._popupBehavior = b;
a._popupBehaviorHiddenHandler = b;
a._onShowJson = b;
a._onHideJson = b;
a._timer = b;
a._cache = b;
a._currentPrefix = b;
a._selectIndex = -1;
a._focusHandler = b;
a._blurHandler = b;
a._bodyClickHandler = b;
a._completionListBlurHandler = b;
a._keyDownHandler = b;
a._mouseDownHandler = b;
a._mouseUpHandler = b;
a._mouseOverHandler = b;
a._tickHandler = b;
a._enableCaching = true;
a._flyoutHasFocus = c;
a._textBoxHasFocus = c;
a._completionListCssClass = b;
a._completionListItemCssClass = b;
a._highlightedItemCssClass = b;
a._delimiterCharacters = b;
a._firstRowSelected = c;
a._showOnlyCurrentWordInCompletionListItem = c;
a._webRequest = b
};
AjaxControlToolkit.AutoCompleteBehavior.prototype = {
initialize: function() {
var b = null, a = this;
AjaxControlToolkit.AutoCompleteBehavior.callBaseMethod(a, "initialize");
$common.prepareHiddenElementForATDeviceUpdate();
a._popupBehaviorHiddenHandler = Function.createDelegate(a, a._popupHidden);
a._tickHandler = Function.createDelegate(a, a._onTimerTick);
a._focusHandler = Function.createDelegate(a, a._onGotFocus);
a._blurHandler = Function.createDelegate(a, a._onLostFocus);
a._keyDownHandler = Function.createDelegate(a, a._onKeyDown);
a._mouseDownHandler = Function.createDelegate(a, a._onListMouseDown);
a._mouseUpHandler = Function.createDelegate(a, a._onListMouseUp);
a._mouseOverHandler = Function.createDelegate(a, a._onListMouseOver);
a._completionListBlurHandler = Function.createDelegate(a, a._onCompletionListBlur);
a._bodyClickHandler = Function.createDelegate(a, a._onCompletionListBlur);
a._timer = new Sys.Timer;
a.initializeTimer(a._timer);
var c = a.get_element();
a.initializeTextBox(c);
c.blur();
if (a._completionListElementID !== b) a._completionListElement = $get(a._completionListElementID);
if (a._completionListElement == b) {
a._completionListElement = document.createElement("ul");
a._completionListElement.id = a.get_id() + "_completionListElem";
if (Sys.Browser.agent === Sys.Browser.Safari) document.body.appendChild(a._completionListElement);
else c.parentNode.insertBefore(a._completionListElement, c.nextSibling)
}
a.initializeCompletionList(a._completionListElement);
a._popupBehavior = $create(AjaxControlToolkit.PopupBehavior, {
id: a.get_id() + "PopupBehavior", parentElement: c, positioningMode: AjaxControlToolkit.PositioningMode.BottomLeft
}
, b, b, a._completionListElement);
a._popupBehavior.add_hidden(a._popupBehaviorHiddenHandler);
if (a._onShowJson) a._popupBehavior.set_onShow(a._onShowJson);
if (a._onHideJson) a._popupBehavior.set_onHide(a._onHideJson)
}
, dispose: function() {
var b = null, a = this;
a._onShowJson = b;
a._onHideJson = b;
if (a._popupBehavior) {
if (a._popupBehaviorHiddenHandler) a._popupBehavior.remove_hidden(a._popupBehaviorHiddenHandler);
a._popupBehavior.dispose();
a._popupBehavior = b
}
if (a._timer) {
a._timer.dispose();
a._timer = b
}
var c = a.get_element();
if (c) {
$removeHandler(c, "focus", a._focusHandler);
$removeHandler(c, "blur", a._blurHandler);
$removeHandler(c, "keydown", a._keyDownHandler);
$removeHandler(a._completionListElement, "blur", a._completionListBlurHandler);
$removeHandler(a._completionListElement, "mousedown", a._mouseDownHandler);
$removeHandler(a._completionListElement, "mouseup", a._mouseUpHandler);
$removeHandler(a._completionListElement, "mouseover", a._mouseOverHandler)
}
if (a._bodyClickHandler) {
$removeHandler(document.body, "click", a._bodyClickHandler);
a._bodyClickHandler = b
}
a._popupBehaviorHiddenHandler = b;
a._tickHandler = b;
a._focusHandler = b;
a._blurHandler = b;
a._keyDownHandler = b;
a._completionListBlurHandler = b;
a._mouseDownHandler = b;
a._mouseUpHandler = b;
a._mouseOverHandler = b;
AjaxControlToolkit.AutoCompleteBehavior.callBaseMethod(a, "dispose")
}
, initializeTimer: function(a) {
a.set_interval(this._completionInterval);
a.add_tick(this._tickHandler)
}
, initializeTextBox: function(a) {
a.autocomplete = "off";
$addHandler(a, "focus", this._focusHandler);
$addHandler(a, "blur", this._blurHandler);
$addHandler(a, "keydown", this._keyDownHandler)
}
, initializeCompletionList: function(c) {
var b = this;
if (b._completionListCssClass) Sys.UI.DomElement.addCssClass(c, b._completionListCssClass);
else {
var a = c.style;
a.textAlign = "left";
a.visibility = "hidden";
a.cursor = "default";
a.listStyle = "none";
a.padding = "0px";
a.margin = "0px! important";
if (Sys.Browser.agent === Sys.Browser.Safari) {
a.border = "solid 1px gray";
a.backgroundColor = "white";
a.color = "black"
}
else {
a.border = "solid 1px buttonshadow";
a.backgroundColor = b._textBackground;
a.color = b._textColor
}
}
$addHandler(c, "mousedown", b._mouseDownHandler);
$addHandler(c, "mouseup", b._mouseUpHandler);
$addHandler(c, "mouseover", b._mouseOverHandler);
$addHandler(c, "blur", b._completionListBlurHandler);
$addHandler(document.body, "click", b._bodyClickHandler)
}
, _currentCompletionWord: function() {
var b = this, f = b.get_element(), c = f.value, d = c;
if (b.get_isMultiWord()) {
var a = b._getCurrentWordStartIndex(), e = b._getCurrentWordEndIndex(a);
if (e <= a) d = c.substring(a);
else d = c.substring(a, e)
}
return d
}
, _getCursorIndex: function() {
return this.get_element().selectionStart
}
, _getCurrentWordStartIndex: function() {
var a = this, g = a.get_element(), f = g.value.substring(0, a._getCursorIndex()), b = 0, c = -1;
for (var d = 0; d < a._delimiterCharacters.length; ++d) {
var e = f.lastIndexOf(a._delimiterCharacters.charAt(d));
if (e > c) c = e
}
b = c;
if (b >= a._getCursorIndex()) b = 0;
return b < 0 ? 0 : b + 1
}
, _getCurrentWordEndIndex: function(d) {
var e = this.get_element(), f = e.value.substring(d), a = 0;
for (var c = 0; c < this._delimiterCharacters.length; ++c) {
var b = f.indexOf(this._delimiterCharacters.charAt(c));
if (b > 0 && (b < a || a == 0)) a = b
}
return a <= 0 ? e.value.length : a + d
}
, get_isMultiWord: function() {
return this._delimiterCharacters != null && this._delimiterCharacters != ""
}
, _getTextWithInsertedWord: function(d) {
var b = this, h = d, j = 0, i = b.get_element(), c = i.value;
if (b.get_isMultiWord()) {
var a = b._getCurrentWordStartIndex(), e = b._getCurrentWordEndIndex(a), f = "", g = "";
if (a > 0) f = c.substring(0, a);
if (e > a) g = c.substring(e);
h = f + d + g
}
return h
}
, _hideCompletionList: function() {
var a = new Sys.CancelEventArgs;
this.raiseHiding(a);
if (a.get_cancel()) return;
this.hidePopup()
}
, showPopup: function() {
this._popupBehavior.show();
this.raiseShown(Sys.EventArgs.Empty)
}
, hidePopup: function() {
if (this._popupBehavior) this._popupBehavior.hide();
else this._popupHidden()
}
, _popupHidden: function() {
var a = this;
a._completionListElement.innerHTML = "";
a._selectIndex = -1;
a._flyoutHasFocus = false;
a.raiseHidden(Sys.EventArgs.Empty)
}
, _highlightItem: function(c) {
var a = this, e = a._completionListElement.childNodes;
for (var d = 0; d < e.length; d++) {
var b = e[d];
if (b._highlighted) {
if (a._completionListItemCssClass) {
Sys.UI.DomElement.removeCssClass(b, a._highlightedItemCssClass);
Sys.UI.DomElement.addCssClass(b, a._completionListItemCssClass)
}
else if (Sys.Browser.agent === Sys.Browser.Safari) {
b.style.backgroundColor = "white";
b.style.color = "black"
}
else {
b.style.backgroundColor = a._textBackground;
b.style.color = a._textColor
}
a.raiseItemOut(new AjaxControlToolkit.AutoCompleteItemEventArgs(b, b.firstChild.nodeValue, b._value))
}
}
if (a._highlightedItemCssClass) {
Sys.UI.DomElement.removeCssClass(c, a._completionListItemCssClass);
Sys.UI.DomElement.addCssClass(c, a._highlightedItemCssClass)
}
else if (Sys.Browser.agent === Sys.Browser.Safari) c.style.backgroundColor = "lemonchiffon";
else {
c.style.backgroundColor = "highlight";
c.style.color = "highlighttext"
}
c._highlighted = true;
a.raiseItemOver(new AjaxControlToolkit.AutoCompleteItemEventArgs(c, c.firstChild.nodeValue, c._value))
}
, _onCompletionListBlur: function() {
this._hideCompletionList()
}
, _onListMouseDown: function(b) {
var a = this;
if (b.target !== a._completionListElement) {
a._setText(b.target);
a._flyoutHasFocus = false
}
else a._flyoutHasFocus = true
}
, _onListMouseUp: function() {
try {
this.get_element().focus()
}
catch (a) {
}
}
, _onListMouseOver: function(e) {
var a = this, c = e.target;
if (c !== a._completionListElement) {
var d = a._completionListElement.childNodes;
for (var b = 0; b < d.length; ++b) if (c === d[b]) {
a._highlightItem(c);
a._selectIndex = b;
break
}
}
}
, _onGotFocus: function() {
var a = this;
a._textBoxHasFocus = true;
if (a._flyoutHasFocus) a._hideCompletionList();
if (a._minimumPrefixLength == 0 && !a.get_element().value) a._timer.set_enabled(true)
}
, _onKeyDown: function(b) {
var a = this;
a._textBoxHasFocus = true;
a._timer.set_enabled(false);
var c = b.keyCode ? b.keyCode : b.rawEvent.keyCode;
if (c === Sys.UI.Key.esc) {
a._hideCompletionList();
b.preventDefault()
}
else if (c === Sys.UI.Key.up) {
if (a._selectIndex > 0) {
a._selectIndex--;
a._handleScroll(a._completionListElement.childNodes[a._selectIndex], a._selectIndex);
a._highlightItem(a._completionListElement.childNodes[a._selectIndex]);
b.stopPropagation();
b.preventDefault()
}
}
else if (c === Sys.UI.Key.down) {
if (a._selectIndex < a._completionListElement.childNodes.length - 1) {
a._selectIndex++;
a._handleScroll(a._completionListElement.childNodes[a._selectIndex], a._selectIndex);
a._highlightItem(a._completionListElement.childNodes[a._selectIndex]);
b.stopPropagation();
b.preventDefault()
}
}
else if (c === Sys.UI.Key.enter) if (a._selectIndex !== -1) {
a._setText(a._completionListElement.childNodes[a._selectIndex]);
b.preventDefault()
}
else a.hidePopup();
else if (c === Sys.UI.Key.tab) {
if (a._selectIndex !== -1) a._setText(a._completionListElement.childNodes[a._selectIndex])
}
else a._timer.set_enabled(true)
}
, _handleScroll: function(e, c) {
var a = this._completionListElement, b = $common.getBounds(e), d = this._completionListElement.childNodes.length;
if (b.height * c - (a.clientHeight + a.scrollTop) >= 0) a.scrollTop += b.height * c - (a.clientHeight + a.scrollTop) + b.height;
if (b.height * (d - (c + 1)) - (a.scrollHeight - a.scrollTop) >= 0) a.scrollTop -= b.height * (d - (c + 1)) - (a.scrollHeight - a.scrollTop) + b.height;
if (a.scrollTop % b.height !== 0) if (b.height * (c + 1) - (a.clientHeight + a.scrollTop) >= 0) a.scrollTop -= a.scrollTop % b.height;
else a.scrollTop += b.height - a.scrollTop % b.height
}
, _handleFlyoutFocus: function() {
var a = this;
if (!a._textBoxHasFocus) if (!a._flyoutHasFocus) {
if (a._webRequest) {
a._webRequest.get_executor().abort();
a._webRequest = null
}
a._hideCompletionList()
}
}
, _onLostFocus: function() {
var a = this;
a._textBoxHasFocus = false;
a._timer.set_enabled(false);
window.setTimeout(Function.createDelegate(a, a._handleFlyoutFocus), 500)
}
, _onMethodComplete: function(b, a) {
this._webRequest = null;
this._update(a, b, true)
}
, _onMethodFailed: function() {
this._webRequest = null
}
, _onTimerTick: function(f, d) {
var c = false, a = this;
a._timer.set_enabled(c);
if (a._servicePath && a._serviceMethod) {
var b = a._currentCompletionWord();
if (b.trim().length < a._minimumPrefixLength) {
a._currentPrefix = null;
a._update("", null, c);
return
}
if (a._currentPrefix !== b || b == "" && a._minimumPrefixLength == 0) {
a._currentPrefix = b;
if (b != "" && a._cache && a._cache[b]) {
a._update(b, a._cache[b], c);
return
}
var d = new Sys.CancelEventArgs;
a.raisePopulating(d);
if (d.get_cancel()) return;
var e = {
prefixText: a._currentPrefix, count: a._completionSetCount
};
if (a._useContextKey) e.contextKey = a._contextKey;
if (a._webRequest) {
a._webRequest.get_executor().abort();
a._webRequest = null
}
a._webRequest = Sys.Net.WebServiceProxy.invoke(a.get_servicePath(), a.get_serviceMethod(), c, e, Function.createDelegate(a, a._onMethodComplete), Function.createDelegate(a, a._onMethodFailed), b);
$common.updateFormToRefreshATDeviceBuffer()
}
}
}
, _setText: function(b) {
var a = this, e = b && b.firstChild ? b.firstChild.nodeValue : null;
a._timer.set_enabled(false);
var d = a.get_element(), c = d.control, f = a._showOnlyCurrentWordInCompletionListItem ? a._getTextWithInsertedWord(e) : e;
if (c && c.set_text) c.set_text(f);
else d.value = f;
$common.tryFireEvent(d, "change");
a.raiseItemSelected(new AjaxControlToolkit.AutoCompleteItemEventArgs(b, e, b ? b._value : null));
a._currentPrefix = a._currentCompletionWord();
a._hideCompletionList()
}
, _update: function(k, c, n) {
var e = null, a = this;
if (n && a.get_enableCaching()) {
if (!a._cache) a._cache = {
};
a._cache[k] = c
}
if (!a._textBoxHasFocus || k != a._currentCompletionWord()) {
a._hideCompletionList();
return
}
if (c && c.length) {
a._completionListElement.innerHTML = "";
a._selectIndex = -1;
var h = e, f = e, i = e;
for (var g = 0; g < c.length; g++) {
var b = e;
if (a._completionListElementID) b = document.createElement("div");
else b = document.createElement("li");
if (h == e) h = b;
try {
var j = Sys.Serialization.JavaScriptSerializer.deserialize("(" + c[g] + ")");
if (j && j.First) {
f = j.First;
i = j.Second
}
else {
f = c[g];
i = f
}
}
catch (p) {
f = c[g];
i = c[g]
}
var o = a._showOnlyCurrentWordInCompletionListItem ? f : a._getTextWithInsertedWord(f);
b.appendChild(document.createTextNode(o));
b._value = i;
b.__item = "";
if (a._completionListItemCssClass) Sys.UI.DomElement.addCssClass(b, a._completionListItemCssClass);
else {
var d = b.style;
d.padding = "0px";
d.textAlign = "left";
d.textOverflow = "ellipsis";
if (Sys.Browser.agent === Sys.Browser.Safari) {
d.backgroundColor = "white";
d.color = "black"
}
else {
d.backgroundColor = a._textBackground;
d.color = a._textColor
}
}
a._completionListElement.appendChild(b)
}
var m = $common.getBounds(a.get_element());
a._completionListElement.style.width = Math.max(1, m.width - 2) + "px";
a._completionListElement.scrollTop = 0;
a.raisePopulated(Sys.EventArgs.Empty);
var l = new Sys.CancelEventArgs;
a.raiseShowing(l);
if (!l.get_cancel()) {
a.showPopup();
if (a._firstRowSelected && h != e) {
a._highlightItem(h);
a._selectIndex = 0
}
}
}
else a._hideCompletionList()
}
, get_onShow: function() {
return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson
}
, set_onShow: function(b) {
var a = this;
if (a._popupBehavior) a._popupBehavior.set_onShow(b);
else a._onShowJson = b;
a.raisePropertyChanged("onShow")
}
, get_onShowBehavior: function() {
return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null
}
, onShow: function() {
if (this._popupBehavior) this._popupBehavior.onShow()
}
, get_onHide: function() {
return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson
}
, set_onHide: function(b) {
var a = this;
if (a._popupBehavior) a._popupBehavior.set_onHide(b);
else a._onHideJson = b;
a.raisePropertyChanged("onHide")
}
, get_onHideBehavior: function() {
return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null
}
, onHide: function() {
if (this._popupBehavior) this._popupBehavior.onHide()
}
, get_completionInterval: function() {
return this._completionInterval
}
, set_completionInterval: function(a) {
if (this._completionInterval != a) {
this._completionInterval = a;
this.raisePropertyChanged("completionInterval")
}
}
, get_completionList: function() {
return this._completionListElement
}
, set_completionList: function(a) {
if (this._completionListElement != a) {
this._completionListElement = a;
this.raisePropertyChanged("completionList")
}
}
, get_completionSetCount: function() {
return this._completionSetCount
}
, set_completionSetCount: function(a) {
if (this._completionSetCount != a) {
this._completionSetCount = a;
this.raisePropertyChanged("completionSetCount")
}
}
, get_minimumPrefixLength: function() {
return this._minimumPrefixLength
}
, set_minimumPrefixLength: function(a) {
if (this._minimumPrefixLength != a) {
this._minimumPrefixLength = a;
this.raisePropertyChanged("minimumPrefixLength")
}
}
, get_serviceMethod: function() {
return this._serviceMethod
}
, set_serviceMethod: function(a) {
if (this._serviceMethod != a) {
this._serviceMethod = a;
this.raisePropertyChanged("serviceMethod")
}
}
, get_servicePath: function() {
return this._servicePath
}
, set_servicePath: function(a) {
if (this._servicePath != a) {
this._servicePath = a;
this.raisePropertyChanged("servicePath")
}
}
, get_contextKey: function() {
return this._contextKey
}
, set_contextKey: function(b) {
var a = this;
if (a._contextKey != b) {
a._contextKey = b;
a.set_useContextKey(true);
a.raisePropertyChanged("contextKey")
}
}
, get_useContextKey: function() {
return this._useContextKey
}
, set_useContextKey: function(a) {
if (this._useContextKey != a) {
this._useContextKey = a;
this.raisePropertyChanged("useContextKey")
}
}
, get_enableCaching: function() {
return this._enableCaching
}
, set_enableCaching: function(a) {
if (this._enableCaching != a) {
this._enableCaching = a;
this.raisePropertyChanged("enableCaching")
}
}
, get_completionListElementID: function() {
return this._completionListElementID
}
, set_completionListElementID: function(a) {
if (this._completionListElementID != a) {
this._completionListElementID = a;
this.raisePropertyChanged("completionListElementID")
}
}
, get_completionListCssClass: function() {
return this._completionListCssClass
}
, set_completionListCssClass: function(a) {
if (this._completionListCssClass != a) {
this._completionListCssClass = a;
this.raisePropertyChanged("completionListCssClass")
}
}
, get_completionListItemCssClass: function() {
return this._completionListItemCssClass
}
, set_completionListItemCssClass: function(a) {
if (this._completionListItemCssClass != a) {
this._completionListItemCssClass = a;
this.raisePropertyChanged("completionListItemCssClass")
}
}
, get_highlightedItemCssClass: function() {
return this._highlightedItemCssClass
}
, set_highlightedItemCssClass: function(a) {
if (this._highlightedItemCssClass != a) {
this._highlightedItemCssClass = a;
this.raisePropertyChanged("highlightedItemCssClass")
}
}
, get_delimiterCharacters: function() {
return this._delimiterCharacters
}
, set_delimiterCharacters: function(a) {
if (this._delimiterCharacters != a) {
this._delimiterCharacters = a;
this.raisePropertyChanged("delimiterCharacters")
}
}
, get_firstRowSelected: function() {
return this._firstRowSelected
}
, set_firstRowSelected: function(a) {
if (this._firstRowSelected != a) {
this._firstRowSelected = a;
this.raisePropertyChanged("firstRowSelected")
}
}
, get_showOnlyCurrentWordInCompletionListItem: function() {
return this._showOnlyCurrentWordInCompletionListItem
}
, set_showOnlyCurrentWordInCompletionListItem: function(a) {
if (this._showOnlyCurrentWordInCompletionListItem != a) {
this._showOnlyCurrentWordInCompletionListItem = a;
this.raisePropertyChanged("showOnlyCurrentWordInCompletionListItem")
}
}
, 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)
}
, 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_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)
}
, add_itemSelected: function(a) {
this.get_events().addHandler("itemSelected", a)
}
, remove_itemSelected: function(a) {
this.get_events().removeHandler("itemSelected", a)
}
, raiseItemSelected: function(b) {
var a = this.get_events().getHandler("itemSelected");
if (a) a(this, b)
}
, add_itemOver: function(a) {
this.get_events().addHandler("itemOver", a)
}
, remove_itemOver: function(a) {
this.get_events().removeHandler("itemOver", a)
}
, raiseItemOver: function(b) {
var a = this.get_events().getHandler("itemOver");
if (a) a(this, b)
}
, add_itemOut: function(a) {
this.get_events().addHandler("itemOut", a)
}
, remove_itemOut: function(a) {
this.get_events().removeHandler("itemOut", a)
}
, raiseItemOut: function(b) {
var a = this.get_events().getHandler("itemOut");
if (a) a(this, b)
}
};
AjaxControlToolkit.AutoCompleteBehavior.registerClass("AjaxControlToolkit.AutoCompleteBehavior", AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.AutoCompleteBehavior.descriptor = {
properties: [{
name: "completionInterval", type: Number
}
, {
name: "completionList", isDomElement: true
}
, {
name: "completionListElementID", type: String
}
, {
name: "completionSetCount", type: Number
}
, {
name: "minimumPrefixLength", type: Number
}
, {
name: "serviceMethod", type: String
}
, {
name: "servicePath", type: String
}
, {
name: "enableCaching", type: Boolean
}
, {
name: "showOnlyCurrentWordInCompletionListItem", type: Boolean
}
]
};
AjaxControlToolkit.AutoCompleteItemEventArgs = function(c, d, b) {
var a = this;
AjaxControlToolkit.AutoCompleteItemEventArgs.initializeBase(a);
a._item = c;
a._text = d;
a._value = b !== undefined ? b : null
};
AjaxControlToolkit.AutoCompleteItemEventArgs.prototype = {
get_item: function() {
return this._item
}
, set_item: function(a) {
this._item = a
}
, get_text: function() {
return this._text
}
, set_text: function(a) {
this._text = a
}
, get_value: function() {
return this._value
}
, set_value: function(a) {
this._value = a
}
};
AjaxControlToolkit.AutoCompleteItemEventArgs.registerClass("AjaxControlToolkit.AutoCompleteItemEventArgs", Sys.EventArgs);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.DynamicPopulateBehavior=function(c){var b=null,a=this;AjaxControlToolkit.DynamicPopulateBehavior.initializeBase(a,[c]);a._servicePath=b;a._serviceMethod=b;a._contextKey=b;a._cacheDynamicResults=false;a._populateTriggerID=b;a._setUpdatingCssClass=b;a._clearDuringUpdate=true;a._customScript=b;a._clickHandler=b;a._callID=0;a._currentCallID=-1;a._populated=false};AjaxControlToolkit.DynamicPopulateBehavior.prototype={initialize:function(){var a=this;AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(a,"initialize");$common.prepareHiddenElementForATDeviceUpdate();if(a._populateTriggerID){var b=$get(a._populateTriggerID);if(b){a._clickHandler=Function.createDelegate(a,a._onPopulateTriggerClick);$addHandler(b,"click",a._clickHandler)}}},dispose:function(){var a=this;if(a._populateTriggerID&&a._clickHandler){var b=$get(a._populateTriggerID);if(b)$removeHandler(b,"click",a._clickHandler);a._populateTriggerID=null;a._clickHandler=null}AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(a,"dispose")},populate:function(contextKey){var a=this;if(a._populated&&a._cacheDynamicResults)return;if(a._currentCallID==-1){var eventArgs=new Sys.CancelEventArgs;a.raisePopulating(eventArgs);if(eventArgs.get_cancel())return;a._setUpdating(true)}if(a._customScript){var scriptResult=eval(a._customScript);a._setTargetHtml(scriptResult);a._setUpdating(false)}else{a._currentCallID=++a._callID;if(a._servicePath&&a._serviceMethod){Sys.Net.WebServiceProxy.invoke(a._servicePath,a._serviceMethod,false,{contextKey:contextKey?contextKey:a._contextKey},Function.createDelegate(a,a._onMethodComplete),Function.createDelegate(a,a._onMethodError),a._currentCallID);$common.updateFormToRefreshATDeviceBuffer()}}},_onMethodComplete:function(b,a){if(a!=this._currentCallID)return;this._setTargetHtml(b);this._setUpdating(false)},_onMethodError:function(b,c){var a=this;if(c!=a._currentCallID)return;if(b.get_timedOut())a._setTargetHtml(AjaxControlToolkit.Resources.DynamicPopulate_WebServiceTimeout);else a._setTargetHtml(String.format(AjaxControlToolkit.Resources.DynamicPopulate_WebServiceError,b.get_statusCode()));a._setUpdating(false)},_onPopulateTriggerClick:function(){this.populate(this._contextKey)},_setUpdating:function(b){var a=this;a.setStyle(b);if(!b){a._currentCallID=-1;a._populated=true;a.raisePopulated(a,Sys.EventArgs.Empty)}},_setTargetHtml:function(b){var a=this.get_element();if(a)if(a.tagName=="INPUT")a.value=b;else a.innerHTML=b},setStyle:function(c){var a=this,b=a.get_element();if(a._setUpdatingCssClass)if(!c){b.className=a._oldCss;a._oldCss=null}else{a._oldCss=b.className;b.className=a._setUpdatingCssClass}if(c&&a._clearDuringUpdate)a._setTargetHtml("")},get_ClearContentsDuringUpdate:function(){return this._clearDuringUpdate},set_ClearContentsDuringUpdate:function(a){if(this._clearDuringUpdate!=a){this._clearDuringUpdate=a;this.raisePropertyChanged("ClearContentsDuringUpdate")}},get_ContextKey:function(){return this._contextKey},set_ContextKey:function(a){if(this._contextKey!=a){this._contextKey=a;this.raisePropertyChanged("ContextKey")}},get_PopulateTriggerID:function(){return this._populateTriggerID},set_PopulateTriggerID:function(a){if(this._populateTriggerID!=a){this._populateTriggerID=a;this.raisePropertyChanged("PopulateTriggerID")}},get_ServicePath:function(){return this._servicePath},set_ServicePath:function(a){if(this._servicePath!=a){this._servicePath=a;this.raisePropertyChanged("ServicePath")}},get_ServiceMethod:function(){return this._serviceMethod},set_ServiceMethod:function(a){if(this._serviceMethod!=a){this._serviceMethod=a;this.raisePropertyChanged("ServiceMethod")}},get_cacheDynamicResults:function(){return this._cacheDynamicResults},set_cacheDynamicResults:function(a){if(this._cacheDynamicResults!=a){this._cacheDynamicResults=a;this.raisePropertyChanged("cacheDynamicResults")}},get_UpdatingCssClass:function(){return this._setUpdatingCssClass},set_UpdatingCssClass:function(a){if(this._setUpdatingCssClass!=a){this._setUpdatingCssClass=a;this.raisePropertyChanged("UpdatingCssClass")}},get_CustomScript:function(){return this._customScript},set_CustomScript:function(a){if(this._customScript!=a){this._customScript=a;this.raisePropertyChanged("CustomScript")}},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)},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)}};AjaxControlToolkit.DynamicPopulateBehavior.registerClass("AjaxControlToolkit.DynamicPopulateBehavior",AjaxControlToolkit.BehaviorBase);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.PopupControlBehavior=function(c){var b=null,a=this;AjaxControlToolkit.PopupControlBehavior.initializeBase(a,[c]);a._popupControlID=b;a._commitProperty=b;a._commitScript=b;a._position=b;a._offsetX=0;a._offsetY=0;a._extenderControlID=b;a._popupElement=b;a._popupBehavior=b;a._popupVisible=false;a._focusHandler=b;a._popupKeyDownHandler=b;a._popupClickHandler=b;a._bodyClickHandler=b;a._onShowJson=b;a._onHideJson=b};AjaxControlToolkit.PopupControlBehavior.prototype={initialize:function(){var b="click",a=this;AjaxControlToolkit.PopupControlBehavior.callBaseMethod(a,"initialize");var c=a.get_element();a._popupElement=$get(a._popupControlID);a._popupBehavior=$create(AjaxControlToolkit.PopupBehavior,{id:a.get_id()+"PopupBehavior",parentElement:c},null,null,a._popupElement);if(a._onShowJson)a._popupBehavior.set_onShow(a._onShowJson);if(a._onHideJson)a._popupBehavior.set_onHide(a._onHideJson);a._focusHandler=Function.createDelegate(a,a._onFocus);a._popupClickHandler=Function.createDelegate(a,a._onPopupClick);a._bodyClickHandler=Function.createDelegate(a,a._onBodyClick);a._popupKeyDownHandler=Function.createDelegate(a,a._onPopupKeyDown);$addHandler(c,"focus",a._focusHandler);$addHandler(c,b,a._focusHandler);$addHandler(document.body,b,a._bodyClickHandler);$addHandler(a._popupElement,b,a._popupClickHandler);$addHandler(a._popupElement,"keydown",a._popupKeyDownHandler);a.registerPartialUpdateEvents();if(AjaxControlToolkit.PopupControlBehavior.__VisiblePopup&&a.get_id()==AjaxControlToolkit.PopupControlBehavior.__VisiblePopup.get_id())a._onFocus(null)},dispose:function(){var c="click",b=null,a=this,d=a.get_element();a._onShowJson=b;a._onHideJson=b;if(a._popupBehavior){a._popupBehavior.dispose();a._popupBehavior=b}if(a._focusHandler){$removeHandler(d,"focus",a._focusHandler);$removeHandler(d,c,a._focusHandler);a._focusHandler=b}if(a._bodyClickHandler){$removeHandler(document.body,c,a._bodyClickHandler);a._bodyClickHandler=b}if(a._popupClickHandler){$removeHandler(a._popupElement,c,a._popupClickHandler);a._popupClickHandler=b}if(a._popupKeyDownHandler){$removeHandler(a._popupElement,"keydown",a._popupKeyDownHandler);a._popupKeyDownHandler=b}AjaxControlToolkit.PopupControlBehavior.callBaseMethod(a,"dispose")},showPopup:function(){var a=this,b=AjaxControlToolkit.PopupControlBehavior.__VisiblePopup;if(b&&b._popupBehavior)b.hidePopup();AjaxControlToolkit.PopupControlBehavior.callBaseMethod(a,"populate");a._popupBehavior.set_x(a._getLeftOffset());a._popupBehavior.set_y(a._getTopOffset());a._popupBehavior.show();a._popupVisible=true;AjaxControlToolkit.PopupControlBehavior.__VisiblePopup=a},hidePopup:function(){this._popupBehavior.hide();this._popupVisible=false;AjaxControlToolkit.PopupControlBehavior.__VisiblePopup=null},_onFocus:function(a){if(!this._popupVisible)this.showPopup();if(a)a.stopPropagation()},_onPopupKeyDown:function(a){if(this._popupVisible&&a.keyCode==27)this.get_element().focus()},_onPopupClick:function(a){a.stopPropagation()},_onBodyClick:function(){if(this._popupVisible)this.hidePopup()},_close:function(result){var a=this,e=a.get_element();if(null!=result){if("$$CANCEL$$"!=result){if(a._commitProperty)e[a._commitProperty]=result;else if("text"==e.type)e.value=result;else Sys.Debug.assert(false,String.format(AjaxControlToolkit.Resources.PopupControl_NoDefaultProperty,e.id,e.type));if(a._commitScript)eval(a._commitScript)}a.hidePopup()}},_partialUpdateEndRequest:function(d,c){var a=this;AjaxControlToolkit.PopupControlBehavior.callBaseMethod(a,"_partialUpdateEndRequest",[d,c]);if(a.get_element()){var b=c.get_dataItems()[a.get_element().id];if(undefined===b&&AjaxControlToolkit.PopupControlBehavior.__VisiblePopup&&a.get_id()==AjaxControlToolkit.PopupControlBehavior.__VisiblePopup.get_id())b=c.get_dataItems()["_PopupControl_Proxy_ID_"];if(undefined!==b)a._close(b)}},_onPopulated:function(b,a){AjaxControlToolkit.PopupControlBehavior.callBaseMethod(this,"_onPopulated",[b,a]);if(this._popupVisible)this._popupBehavior.show()},_getLeftOffset:function(){var a=this;if(AjaxControlToolkit.PopupControlPopupPosition.Left==a._position)return -1*a.get_element().offsetWidth+a._offsetX;else if(AjaxControlToolkit.PopupControlPopupPosition.Right==a._position)return a.get_element().offsetWidth+a._offsetX;else return a._offsetX},_getTopOffset:function(){var a=this,b;if(AjaxControlToolkit.PopupControlPopupPosition.Top==a._position)b=-1*a.get_element().offsetHeight+a._offsetY;else if(AjaxControlToolkit.PopupControlPopupPosition.Bottom==a._position)b=a.get_element().offsetHeight+a._offsetY;else b=a._offsetY;return b},get_onShow:function(){return this._popupBehavior?this._popupBehavior.get_onShow():this._onShowJson},set_onShow:function(b){var a=this;if(a._popupBehavior)a._popupBehavior.set_onShow(b);else a._onShowJson=b;a.raisePropertyChanged("onShow")},get_onShowBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onShowBehavior():null},onShow:function(){if(this._popupBehavior)this._popupBehavior.onShow()},get_onHide:function(){return this._popupBehavior?this._popupBehavior.get_onHide():this._onHideJson},set_onHide:function(b){var a=this;if(a._popupBehavior)a._popupBehavior.set_onHide(b);else a._onHideJson=b;a.raisePropertyChanged("onHide")},get_onHideBehavior:function(){return this._popupBehavior?this._popupBehavior.get_onHideBehavior():null},onHide:function(){if(this._popupBehavior)this._popupBehavior.onHide()},get_PopupControlID:function(){return this._popupControlID},set_PopupControlID:function(a){if(this._popupControlID!=a){this._popupControlID=a;this.raisePropertyChanged("PopupControlID")}},get_CommitProperty:function(){return this._commitProperty},set_CommitProperty:function(a){if(this._commitProperty!=a){this._commitProperty=a;this.raisePropertyChanged("CommitProperty")}},get_CommitScript:function(){return this._commitScript},set_CommitScript:function(a){if(this._commitScript!=a){this._commitScript=a;this.raisePropertyChanged("CommitScript")}},get_Position:function(){return this._position},set_Position:function(a){if(this._position!=a){this._position=a;this.raisePropertyChanged("Position")}},get_ExtenderControlID:function(){return this._extenderControlID},set_ExtenderControlID:function(a){if(this._extenderControlID!=a){this._extenderControlID=a;this.raisePropertyChanged("ExtenderControlID")}},get_OffsetX:function(){return this._offsetX},set_OffsetX:function(a){if(this._offsetX!=a){this._offsetX=a;this.raisePropertyChanged("OffsetX")}},get_OffsetY:function(){return this._offsetY},set_OffsetY:function(a){if(this._offsetY!=a){this._offsetY=a;this.raisePropertyChanged("OffsetY")}},get_PopupVisible:function(){return this._popupVisible},add_showing:function(a){if(this._popupBehavior)this._popupBehavior.add_showing(a)},remove_showing:function(a){if(this._popupBehavior)this._popupBehavior.remove_showing(a)},raiseShowing:function(a){if(this._popupBehavior)this._popupBehavior.raiseShowing(a)},add_shown:function(a){if(this._popupBehavior)this._popupBehavior.add_shown(a)},remove_shown:function(a){if(this._popupBehavior)this._popupBehavior.remove_shown(a)},raiseShown:function(a){if(this._popupBehavior)this._popupBehavior.raiseShown(a)},add_hiding:function(a){if(this._popupBehavior)this._popupBehavior.add_hiding(a)},remove_hiding:function(a){if(this._popupBehavior)this._popupBehavior.remove_hiding(a)},raiseHiding:function(a){if(this._popupBehavior)this._popupBehavior.raiseHiding(a)},add_hidden:function(a){if(this._popupBehavior)this._popupBehavior.add_hidden(a)},remove_hidden:function(a){if(this._popupBehavior)this._popupBehavior.remove_hidden(a)},raiseHidden:function(a){if(this._popupBehavior)this._popupBehavior.raiseHidden(a)}};AjaxControlToolkit.PopupControlBehavior.registerClass("AjaxControlToolkit.PopupControlBehavior",AjaxControlToolkit.DynamicPopulateBehaviorBase);AjaxControlToolkit.PopupControlBehavior.__VisiblePopup=null;AjaxControlToolkit.PopupControlPopupPosition=function(){throw Error.invalidOperation()};AjaxControlToolkit.PopupControlPopupPosition.prototype={Center:0,Top:1,Left:2,Bottom:3,Right:4};AjaxControlToolkit.PopupControlPopupPosition.registerEnum("AjaxControlToolkit.PopupControlPopupPosition",false);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
