var validators = {};

/* Language specific validators */
validators['phone']   = /^[\d\.\s\-]+$/;
validators['date']    = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/;
validators['time']    = /^(\d{1,2})\:(\d{1,2})\:(\d{1,2})$/;

var 
	msg_correct_the_errors = 'Please correct the following errors and try again',
	msg_required_field = ' is a required field',
	msg_not_valid_value = ' is not valid value for',
	msg_allowed_chars = 'Allowed characters for',
	msg_are = 'are',
	msg_and = 'and',
	msg_the = 'The',
	msg_not_typed_correctly = ' was not retyped correctly',
	msg_must_be_selected = ' must be selected',
	//msg_invalid_extension = ' invalid File Extension! Allowed Extensions ',
	msg_invalid_extension = 'invalid file extension!',
	msg_format_date = ' (The date format is mm/dd/yyyy)';
	msg_format_date_time = ' (The date format is mm/dd/yyyy H:M:S)';

// Month is first in the date, Day is second, Year is third.
function jsvalidator_check_date(RegExp){
	if (RegExp.$1 > 12 || RegExp.$2 > 31) return false; // check allowed ranges	
	var dt_test = new Date(RegExp.$3, Number(RegExp.$1-1), RegExp.$2); // check number of days in month
	if (dt_test.getMonth() != Number(RegExp.$1-1)) return false;
	return true;
}

