﻿Type.registerNamespace('AjaxControlToolkit');var pointerBorder;var arrowCellInnerDiv;AjaxControlToolkit.CalloutPosition = function() {
throw Error.invalidOperation();}
AjaxControlToolkit.CalloutPosition.prototype = {
Right: 0,
Left: 1,
Center: 2
}
AjaxControlToolkit.CalloutPosition.registerEnum('AjaxControlToolkit.CalloutPosition');AjaxControlToolkit.CalloutPointerLocation = function() {
throw Error.invalidOperation();}
AjaxControlToolkit.CalloutPointerLocation.prototype = {
BottomLeft: 0,
BottomCenter: 1,
BottomRight: 2,
Left: 3,
Right: 4,
TopLeft: 5,
TopCenter: 6,
TopRight: 7
}
AjaxControlToolkit.CalloutPointerLocation.registerEnum('AjaxControlToolkit.CalloutPointerLocation');AjaxControlToolkit.ValidatorCalloutBehavior = function AjaxControlToolkit$ValidatorCalloutBehavior(element) {
AjaxControlToolkit.ValidatorCalloutBehavior.initializeBase(this, [element]);this._calloutPosition = AjaxControlToolkit.CalloutPosition.Right;this._offsetX = 0;this._offsetY = 0;this._calloutPointerLocation = AjaxControlToolkit.CalloutPointerLocation.BottomLeft;this._warningIconImageUrl = null;this._closeImageUrl = null;this._cssClass = "ajax__validatorcallout";this._highlightCssClass = null;this._width = "200px";this._invalid = false;this._originalValidationMethod = null;this._validationMethodOverride = null;this._elementToValidate = null;this._popupTable = null;this._errorMessageCell = null;this._calloutArrowCell = null;this._warningIconImage = null;this._closeImage = null;this._closeCellInnerDiv = null;this._popupBehavior = null;this._onShowJson = null;this._onHideJson = null;this._focusAttached = false;this._isBuilt = false;this._focusHandler = Function.createDelegate(this, this._onfocus);this._closeClickHandler = Function.createDelegate(this, this._oncloseClick);}
AjaxControlToolkit.ValidatorCalloutBehavior.prototype = {
get_offsetX: function() {
return this._offsetX;},
set_offsetX: function(position) {
this._offsetX = position;this.raisePropertyChanged('offsetX');},
get_offsetY: function() {
return this._offsetY;},
set_offsetY: function(position) {
this._offsetY = position;this.raisePropertyChanged('offsetY');},
get_calloutPosition: function() {
return this._calloutPosition;},
set_calloutPosition: function(mode) {
this._calloutPosition = mode;this.raisePropertyChanged('calloutPosition');},
get_calloutPointerLocation: function() {
return this._calloutPointerLocation;},
set_calloutPointerLocation: function(mode) {
this._calloutPointerLocation = mode;this.raisePropertyChanged('calloutPointerLocation');},
initialize: function() {
AjaxControlToolkit.ValidatorCalloutBehavior.callBaseMethod(this, 'initialize');var elt = this.get_element();if (elt.evaluationfunction) {
this._originalValidationMethod = Function.createDelegate(elt, elt.evaluationfunction);this._validationMethodOverride = Function.createDelegate(this, this._onvalidate);elt.evaluationfunction = this._validationMethodOverride;}
var clientState = this.get_ClientState();if ((null != clientState) && ("" !== clientState)) {
this._ensureCallout();if (this._highlightCssClass) {
Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass);}
this.show();}
},
_getDivs: function(startInt, numberOfDivs, className, ascendingOrder) {
if (ascendingOrder) {
for (i = startInt;i <= numberOfDivs;i++) {
this._getDivContent(i, className);}
}
else {
for (i = startInt;i >= 1;i--) {
this._getDivContent(i, className);}
}
},
_getDivContent: function(enumerator, className){
var name = className + i;name = document.createElement("div");name.className = className + i;if (className == 'Border') {
pointerBorder.appendChild(name);}
else {
arrowCellInnerDiv.appendChild(name);}
},
_ensureCallout: function() {
if (!this._isBuilt) {
var elt = this.get_element();var elementToValidate = this._elementToValidate = $get(elt.controltovalidate);var popupTableBody = document.createElement("tbody");var calloutTop = document.createElement("tr");var calloutCellTopLeft = document.createElement("td");var calloutCellTopCenter = document.createElement("td");var calloutCellTopRight = document.createElement("td");var popupTableRowTop = document.createElement("tr");if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Left) {
var topLeftCell = document.createElement("td");var bottomLeftCell = document.createElement("td");topLeftCell.className = "ajax__validatorcallout_callout_cell_Left";bottomLeftCell.className = "ajax__validatorcallout_callout_cell_Left";}
var roundCornersTopLeftCell = document.createElement("td");var roundCornersTopLeftDiv1 = document.createElement("div");var roundCornersTopLeftDiv2 = document.createElement("div");var roundCornersTopMiddleCell = document.createElement("td");var roundCornersTopRightCell = document.createElement("td");var roundCornersTopRightDiv1 = document.createElement("div");var roundCornersTopRightDiv2 = document.createElement("div");if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Right) {
var topRightCell = document.createElement("td");var bottomRightCell = document.createElement("td");topRightCell.className = "ajax__validatorcallout_callout_cell_Right";bottomRightCell.className = "ajax__validatorcallout_callout_cell_Right";}
var popupTableRow = document.createElement("tr");var calloutCellLeft = document.createElement("td");var calloutCellRight = document.createElement("td");var popupTableRowBottom = document.createElement("tr");var roundCornersBottomLeftCell = document.createElement("td");var roundCornersBottomLeftDiv1 = document.createElement("div");var roundCornersBottomLeftDiv2 = document.createElement("div");var roundCornersBottomMiddleCell = document.createElement("td");var roundCornersBottomLeftCell = document.createElement("td");var roundCornersBottomRightDiv1 = document.createElement("div");var roundCornersBottomRightDiv2 = document.createElement("div");var roundCornersBottomRightCell = document.createElement("td");var calloutBottom = document.createElement("tr");var calloutCellBottomLeft = document.createElement("td");var calloutCellBottomCenter = document.createElement("td");var calloutCellBottomRight = document.createElement("td");arrowCellInnerDiv = document.createElement("div");pointerBorder = document.createElement("div");var calloutTable = document.createElement("table");var calloutTableBody = document.createElement("tbody");var calloutTableRow = document.createElement("tr");var iconCell = document.createElement("td");var closeCell = document.createElement("td");var closeCellInnerDiv = this._closeCellInnerDiv = document.createElement("div");var popupTable = this._popupTable = document.createElement("table");var calloutArrowCell = this._calloutArrowCell = document.createElement("td");var warningIconImage = this._warningIconImage = document.createElement("img");var closeImage = this._closeImage = document.createElement("img");var errorMessageCell = this._errorMessageCell = document.createElement("td");popupTable.id = this.get_id() + "_popupTable";popupTable.cellPadding = 0;popupTable.cellSpacing = 0;popupTable.border = 0;popupTable.width = this.get_width();popupTable.className = this._cssClass;calloutTop.className = "ajax__validatorcallout_callout_Top";calloutCellTopLeft.className = "ajax__validatorcallout_callout_cell_TopLeft";calloutCellTopCenter.className = "ajax__validatorcallout_callout_cell_TopMiddle";calloutCellTopRight.className = "ajax__validatorcallout_callout_cell_TopRight";popupTableRowTop.className = "ajax__validatorcallout_popup_table_rowTop";roundCornersTopLeftCell.className = "Left";roundCornersTopMiddleCell.className = "Middle";roundCornersTopRightCell.className = "Right";roundCornersTopLeftDiv1.className = "ajax__validatorcallout_popup_table_rowTop_r1";roundCornersTopLeftDiv2.className = "ajax__validatorcallout_popup_table_rowTop_r2";roundCornersTopRightDiv1.className = "ajax__validatorcallout_popup_table_rowTop_r1";roundCornersTopRightDiv2.className = "ajax__validatorcallout_popup_table_rowTop_r2";popupTableRow.className = "ajax__validatorcallout_popup_table_row";calloutCellLeft.className = "ajax__validatorcallout_callout_cell_Left";calloutCellRight.className = "ajax__validatorcallout_callout_cell_Right";popupTableRowBottom.className = "ajax__validatorcallout_popup_table_rowBottom"
roundCornersBottomLeftCell.className = "Left";roundCornersBottomMiddleCell.className = "Middle";roundCornersBottomRightCell.className = "Right";roundCornersBottomLeftDiv1.className = "ajax__validatorcallout_popup_table_rowBottom_r1";roundCornersBottomLeftDiv2.className = "ajax__validatorcallout_popup_table_rowBottom_r2";roundCornersBottomRightDiv1.className = "ajax__validatorcallout_popup_table_rowBottom_r1";roundCornersBottomRightDiv2.className = "ajax__validatorcallout_popup_table_rowBottom_r2";calloutBottom.className = "ajax__validatorcallout_callout_Bottom";calloutCellBottomLeft.className = "ajax__validatorcallout_callout_cell_BottomLeft";calloutCellBottomCenter.className = "ajax__validatorcallout_callout_cell_BottomMiddle";calloutCellBottomRight.className = "ajax__validatorcallout_callout_cell_BottomRight";pointerBorder.className = "PointerBorder";calloutTable.cellPadding = 0;calloutTable.cellSpacing = 0;calloutTable.border = 0;calloutTable.className = "ajax__validatorcallout_callout_table";calloutTableRow.className = "ajax__validatorcallout_callout_table_row";calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell";iconCell.className = "ajax__validatorcallout_icon_cell";warningIconImage.border = 0;warningIconImage.src = this.get_warningIconImageUrl();errorMessageCell.className = "ajax__validatorcallout_error_message_cell";errorMessageCell.innerHTML = this._getErrorMessage();closeCell.className = "ajax__validatorcallout_close_button_cell";closeCellInnerDiv.className = "ajax__validatorcallout_innerdiv";closeImage.src = this.get_closeImageUrl();arrowCellInnerDiv.className = "ajax__validatorcallout_innerdiv";elt.parentNode.appendChild(popupTable)
popupTable.appendChild(popupTableBody);popupTableBody.appendChild(calloutTop);calloutTop.appendChild(calloutCellTopLeft);calloutTop.appendChild(calloutCellTopCenter);calloutTop.appendChild(calloutCellTopRight);popupTableBody.appendChild(popupTableRowTop);if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Left) {
popupTableRowTop.appendChild(topLeftCell);}
popupTableRowTop.appendChild(roundCornersTopLeftCell);roundCornersTopLeftCell.appendChild(roundCornersTopLeftDiv1);roundCornersTopLeftCell.appendChild(roundCornersTopLeftDiv2);popupTableRowTop.appendChild(roundCornersTopMiddleCell);popupTableRowTop.appendChild(roundCornersTopRightCell);roundCornersTopRightCell.appendChild(roundCornersTopRightDiv1);roundCornersTopRightCell.appendChild(roundCornersTopRightDiv2);if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Right) {
popupTableRowTop.appendChild(topRightCell);}
popupTableBody.appendChild(popupTableRow);if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Left) {
popupTableRow.appendChild(calloutCellLeft);}
popupTableRow.appendChild(iconCell);iconCell.appendChild(warningIconImage);popupTableRow.appendChild(errorMessageCell);popupTableRow.appendChild(closeCell);closeCellInnerDiv.appendChild(closeImage);closeCell.appendChild(closeCellInnerDiv);if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Right) {
popupTableRow.appendChild(calloutCellRight);}
popupTableBody.appendChild(popupTableRowBottom);if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Left) {
popupTableRowBottom.appendChild(bottomLeftCell);}
popupTableRowBottom.appendChild(roundCornersBottomLeftCell);roundCornersBottomLeftCell.appendChild(roundCornersBottomLeftDiv1);roundCornersBottomLeftCell.appendChild(roundCornersBottomLeftDiv2);popupTableRowBottom.appendChild(roundCornersBottomMiddleCell);popupTableRowBottom.appendChild(roundCornersBottomRightCell);roundCornersBottomRightCell.appendChild(roundCornersBottomRightDiv1);roundCornersBottomRightCell.appendChild(roundCornersBottomRightDiv2);if (this._calloutPointerLocation == AjaxControlToolkit.CalloutPointerLocation.Right) {
popupTableRowBottom.appendChild(bottomRightCell);}
popupTableBody.appendChild(calloutBottom);calloutBottom.appendChild(calloutCellBottomLeft);calloutBottom.appendChild(calloutCellBottomCenter);calloutBottom.appendChild(calloutCellBottomRight);calloutTable.appendChild(calloutTableBody);calloutTableBody.appendChild(calloutTableRow);calloutTableRow.appendChild(calloutArrowCell);calloutArrowCell.appendChild(arrowCellInnerDiv);arrowCellInnerDiv.appendChild(pointerBorder);switch (this._calloutPointerLocation) {
case AjaxControlToolkit.CalloutPointerLocation.BottomLeft:
calloutCellBottomLeft.appendChild(calloutTable);this._getDivs(14, 1, 'Width', false);this._getDivs(1, 3, 'Border', true);break;case AjaxControlToolkit.CalloutPointerLocation.BottomCenter:
calloutCellBottomCenter.appendChild(calloutTable);this._getDivs(14, 1, 'Width', false);this._getDivs(1, 2, 'Border', true);break;case AjaxControlToolkit.CalloutPointerLocation.BottomRight:
calloutCellBottomRight.appendChild(calloutTable);this._getDivs(14, 1, 'Width', false);this._getDivs(1, 3, 'Border', true);break;case AjaxControlToolkit.CalloutPointerLocation.Left:
calloutCellLeft.appendChild(calloutTable);this._getDivs(1, 1, 'Border', false);this._getDivs(1, 14, 'Width', true);break;case AjaxControlToolkit.CalloutPointerLocation.Right:
calloutCellRight.appendChild(calloutTable);this._getDivs(1, 1, 'Border', false);this._getDivs(1, 14, 'Width', true);break;case AjaxControlToolkit.CalloutPointerLocation.TopLeft:
calloutCellTopLeft.appendChild(calloutTable);this._getDivs(2, 2, 'Border', false);this._getDivs(1, 14, 'Width', true);break;case AjaxControlToolkit.CalloutPointerLocation.TopCenter:
calloutCellTopCenter.appendChild(calloutTable);this._getDivs(3, 3, 'Border', false);this._getDivs(1, 14, 'Width', true);break;case AjaxControlToolkit.CalloutPointerLocation.TopRight:
calloutCellTopRight.appendChild(calloutTable);this._getDivs(3, 3, 'Border', false);this._getDivs(1, 14, 'Width', true);break;}
this._popupBehavior = $create(
AjaxControlToolkit.PopupBehavior,
{
positioningMode: AjaxControlToolkit.PositioningMode.Absolute,
parentElement: elementToValidate
},
{},
null,
this._popupTable);if (this._onShowJson) {
this._popupBehavior.set_onShow(this._onShowJson);}
if (this._onHideJson) {
this._popupBehavior.set_onHide(this._onHideJson);}
$addHandler(this._closeCellInnerDiv, "click", this._closeClickHandler);this._isBuilt = true;}
},
dispose: function() {
if (this._isBuilt) {
this.hide();if (this._focusAttached) {
$removeHandler(this._elementToValidate, "focus", this._focusHandler);this._focusAttached = false;}
$removeHandler(this._closeCellInnerDiv, "click", this._closeClickHandler);this._onShowJson = null;this._onHideJson = null;if (this._popupBehavior) {
this._popupBehavior.dispose();this._popupBehavior = null;}
if (this._closeBehavior) {
this._closeBehavior.dispose();this._closeBehavior = null;}
if (this._popupTable) {
this._popupTable.parentNode.removeChild(this._popupTable);this._popupTable = null;this._errorMessageCell = null;this._elementToValidate = null;this._calloutArrowCell = null;this._warningIconImage = null;this._closeImage = null;this._closeCellInnerDiv = null;}
this._isBuilt = false;}
AjaxControlToolkit.ValidatorCalloutBehavior.callBaseMethod(this, 'dispose');},
_getErrorMessage: function() {
return this.get_element().errormessage || AjaxControlToolkit.Resources.ValidatorCallout_DefaultErrorMessage;},
show: function(force) {
if (force || !this.get_isOpen()) {
if (force && AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout) {
AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.hide();}
if (AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout != null) {
return;}
AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout = this;switch (this._calloutPosition) {
case AjaxControlToolkit.CalloutPosition.Right:
this._popupBehavior.set_x($common.getSize(this._elementToValidate).width + this._offsetX);break;case AjaxControlToolkit.CalloutPosition.Left:
this._popupBehavior.set_x(0 + this._offsetX);break;case AjaxControlToolkit.CalloutPosition.Center:
this._popupBehavior.set_x(Math.round(($common.getSize(this._elementToValidate).width / 2) + this._offsetX));break;}
this._popupBehavior.set_y(0 + this._offsetY);this._popupBehavior.show();}
},
hide: function() {
if (AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout == this) {
AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout = null;}
if (this.get_isOpen()) {
this._popupBehavior.hide();}
},
_onfocus: function(e) {
if (!this._originalValidationMethod(this.get_element())) {
this._ensureCallout();if (this._highlightCssClass) {
Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass);}
this.show(true);return false;} else {
this.hide();return true;}
},
_oncloseClick: function(e) {
this.hide();},
_onvalidate: function(val) {
if (!this._originalValidationMethod(val)) {
this._ensureCallout();if (this._highlightCssClass) {
Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass);}
if (!this._focusAttached) {
$addHandler(this._elementToValidate, "focus", this._focusHandler);this._focusAttached = true;}
this.show(false);this._invalid = true;return false;} else {
if (this._highlightCssClass && this._invalid) {
Sys.UI.DomElement.removeCssClass(this._elementToValidate, this._highlightCssClass)
}
this._invalid = false;this.hide();return true;}
},
get_onShow: function() {
return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson;},
set_onShow: function(value) {
if (this._popupBehavior) {
this._popupBehavior.set_onShow(value)
} else {
this._onShowJson = value;}
this.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(value) {
if (this._popupBehavior) {
this._popupBehavior.set_onHide(value)
} else {
this._onHideJson = value;}
this.raisePropertyChanged('onHide');},
get_onHideBehavior: function() {
return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null;},
onHide: function() {
if (this._popupBehavior) {
this._popupBehavior.onHide();}
},
get_warningIconImageUrl: function() {
return this._warningIconImageUrl;},
set_warningIconImageUrl: function(value) {
if (this._warningIconImageUrl != value) {
this._warningIconImageUrl = value;if (this.get_isInitialized()) {
this._warningIconImage.src = value;}
this.raisePropertyChanged("warningIconImageUrl");}
},
get_closeImageUrl: function() {
return this._closeImageUrl;},
set_closeImageUrl: function(value) {
if (this._closeImageUrl != value) {
this._closeImageUrl = value;if (this.get_isInitialized()) {
this._closeImage.src = value;}
this.raisePropertyChanged("closeImageUrl");}
},
get_width: function() {
return this._width;},
set_width: function(value) {
if (this._width != value) {
this._width = value;if (this.get_isInitialized()) {
this._popupTable.style.width = _width;}
this.raisePropertyChanged("width");}
},
get_cssClass: function() {
return this._cssClass;},
set_cssClass: function(value) {
if (this._cssClass != value) {
this._cssClass = value;this.raisePropertyChanged("cssClass");}
},
get_highlightCssClass: function() {
return this._highlightCssClass;},
set_highlightCssClass: function(value) {
if (this._highlightCssClass != value) {
this._highlightCssClass = value;this.raisePropertyChanged("highlightCssClass");}
},
get_isOpen: function() {
return $common.getVisible(this._popupTable);}
}
AjaxControlToolkit.ValidatorCalloutBehavior.registerClass('AjaxControlToolkit.ValidatorCalloutBehavior', AjaxControlToolkit.BehaviorBase);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();