﻿Sys.Mvc.ValidatorRegistry.validators["email"] = function(rule) {
   return Sys.Mvc.ValidatorRegistry.validators["regularExpression"](rule);
}
Sys.Mvc.ValidatorRegistry.validators["decimal"] = function(rule, elm) {
    // initialization code can go here.
    var length = rule.ValidationParameters["length"];
    var dec = rule.ValidationParameters["decimal"];
    $(elm).keypress(function(event) { return keyCheck.isNumeric(event, this, dec, length); });
    // we return the function that actually does the validation 
    return function(value) {
        if (keyCheck.IsNumericT(value))
            return true;
        return rule.ErrorMessage;
    };
};

//Sys.Mvc.ValidatorRegistry.validators["Email"] = Sys.Mvc.ValidatorRegistry.validators["Email"]function(rule) {
//    // initialization code can go here.
//    var param = rule.ValidationParameters["param"];

//    // we return the function that actually does the validation 
//    return function(value, context) {
//        if (value COMPARE top param minValue) {
//        ..............
//                return true;
//        }

//        return rule.ErrorMessage;
//    };
//};
