﻿
//bug 57149 - ajm - datepicker getting script errors in IE
// Workaround because this function from AJAX throws an error when 'vals' is nothing
// i attempted to put this in core.js however, this needs to run after jquery gets added
// and there are functions in core.js that need to run before jquery gets added to the page
(function() {
    var $ = BLACKBAUD.netcommunity.jQuery.v1_3_2;
    $(function() {
        if (window.ValidatorOnChange) {
            window.ValidatorOnChange = function(event) {
                if (!event) {
                    event = window.event;
                }
                Page_InvalidControlToBeFocused = null;
                var targetedControl;
                if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
                    targetedControl = event.srcElement;
                }
                else {
                    targetedControl = event.target;
                }
                var vals;
                if (typeof (targetedControl.Validators) != "undefined") {
                    vals = targetedControl.Validators;
                }
                else {
                    if (targetedControl.tagName.toLowerCase() == "label") {
                        targetedControl = document.getElementById(targetedControl.htmlFor);
                        vals = targetedControl.Validators;
                    }
                }
                if (vals) // Correction: checks if this variable was assigned a value...
                {
                    var i;
                    for (i = 0; i < vals.length; i++) {
                        ValidatorValidate(vals[i], null, event);
                    }
                }
                ValidatorUpdateIsValid();
            };
        } //end if
        
    });
})();



////////////////////////////////////////////
// End of script
if (typeof (Sys) !== 'undefined') {
    Sys.Application.notifyScriptLoaded();
}
////////////////////////////////////////////
// Do not add any code below this
////////////////////////////////////////////
