function CreateGeckoValidatorProperties(span)
{
    var ignore = new String("|class|style|id|evaluationfunction|")
	for(var att in span.attributes)
	{
		if (ignore.indexOf("|" + span.attributes[att].name + "|") == -1 && typeof(span.attributes[att].value) == "string") {
			//alert("Att:" + span.attributes[att].name);
			eval("span." + span.attributes[att].name + " = span.attributes[att].value");
        }
	}
}

var _extvalgecko_AlertKiller = 0;
function Extended_ValidatorValidate(val, validationGroup, event)
{
    //return __oldValidatorValidate(val, validationGroup, event);
    var msg = '';
    var showMsg = false;
    var alertId = (typeof(alertKiller) != "undefined") ? alertKiller++ : _extvalgecko_AlertKiller++;
    msg = "Msg: " + alertId + "\n\n";
    msg += "Extended_ValidatorValidate\n";    
    val.isvalid = true;
    if (val.enabled == "False") val.enabled = false;
    msg += val.id + "\n[" + typeof(val.evaluationfunction) +"]:" + val.evaluationfunction + "\n";
    try {
    msg += "Validator Enabled:" + val.enabled + "\r\n";
    if ((typeof(val.enabled) == "undefined" || val.enabled != false) && IsValidationGroupMatch(val, validationGroup)) {
        msg += "Attempt to validate...\n";
        if (typeof(val.evaluationfunction) == "function") {
            val.isvalid = val.evaluationfunction(val);
            msg += val.isvalid + "\n";
            if (!val.isvalid && Page_InvalidControlToBeFocused == null &&
                typeof(val.focusOnError) == "string" && val.focusOnError == "t") {
                ValidatorSetFocus(val, event);
            }
        } else if (typeof(val.evaluationfunction) == "string") {
            val.isvalid = eval(val.evaluationfunction + "(val)");
            msg += val.isvalid + "\n";
            if (!val.isvalid && Page_InvalidControlToBeFocused == null &&
                typeof(val.focusOnError) == "string" && val.focusOnError == "t") {
                ValidatorSetFocus(val, event);
            }
        } else {
            msg += "Unhandled type\n";
        }
    } else {
        msg += "Validation skipped\n";
    }
    } catch (exc) {
        msg += "Exception while validating!\n";
        msg += typeof(exc) + "\n";
        msg += exc.toString();
        //showMsg = true;
    }
    msg += "Valid:" + val.isvalid + "\n";
    //showMsg = (!val.isvalid);
    
    //showMsg = true;
    if (showMsg && (alertId < 100)) alert(msg);
    ValidatorUpdateDisplay(val);
}

// fix for problem with old lead pages
if(typeof(ValidatorValidate) == 'function')
{
    var __oldValidatorValidate = ValidatorValidate;
    ValidatorValidate = Extended_ValidatorValidate;
}