//Namespace
Zapient = {

    //Form Checks
    FormValidations : {
      
        //Check input for any value
        //
        //input       = Input element we are checking
        //id_or_error = ID of the error label/span/etc
        validate_required : function(input) {
            input = $(input);
            var error = $(input.id + '_error');
            if ($(input).getValue().blank()) {
                error.update('- Required');
                error.show();
                return false;
            } else {
                error.hide();
                return true;
            }
        },
        
        //Validate Email Address
        //
        //input = Input element we are checking
        EMAIL_FILTER : /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,
        validate_email : function(input) {
            input = $(input);
            var error = $(input.id + '_error');
            if (!this.EMAIL_FILTER.test($(input).getValue())) {
                error.update('- Invalid Address');
                error.show();
                return false;
            } else {
                error.hide();
                return true;
            }
        }
    }

}
