// Regular Expressions used to validate form fields

//====================================================================================================
// EMPTY STRING
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// \s					:Matches whitespace
// *					:Quantifier tells the set to match 0 or more characters
// $					:Match all the way to the end of the string
// /;					:Javascript delimiter and line ending
var re_empty = /^\s*$/;
//====================================================================================================


//====================================================================================================
// ALPHANUMERIC
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// [a-zA-Z0-9]			:Match any alphanumeric character string
// *					:Quantifier tells the set to match 0 or more characters
// /;					:Javascript delimiter and line ending
var re_alphanumeric = /^[a-zA-Z0-9]*/;
//====================================================================================================


//====================================================================================================
// TEXT
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// [a-zA-Z0-9			:Match any alphanumeric character string
// \s					:Match whitespace
// \-					:Match dash -
// \'					:Match single quote '
// \&					:Match ampersan &
// \#					:Match #
// \.					:Match period .
// \(					:Match Open parenthesis (
// \)					:Match Close parenthesis }
// \,					:Match Comma ,
// \/					:Match forward slash /
// ]					:Close set
// *					:Quantifier tells the set to match 0 or more characters
// $					:Match all the way to the end of the string
// /;					:Javascript delimiter and line ending
var re_text = /^[a-zA-Z0-9\s\-\'\&\#\.\(\)\,\/]*$/;
//====================================================================================================


//====================================================================================================
// INTERNATIONAL EMAIL
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// [a-zA-Z0-9]			:Character class matches the first of any alpha-numberic character
// (					:Begin a group
// [a-zA-Z0-9			:Specify what the set can match, in this case alphanumeric
// _					:Match underscore _
// \-					:Match dash -
// \.]					:Match period .
// *					:Quantifier tells the set to match 0 or more characters				
// )					:Close the group
// @					:Match the (literal) @ character of the email address
// ([a-zA-Z0-9_\-\.]*)	:Match a grouping of 0 or more parts of domain including any possible sub.domain(s), such as mail-1.my_domain
// (\.[a-z]{2,4}		:Match a grouping of 0 or more parts of the .com, .org, .us, .mobi, .info
// (\.[a-z]{2})			:Match a sub-grouping of an additional two-letter country code, such as .ca or .uk
// {0,2})				:Match the previous sub-grouping 0-2 times
// $					:Match all the way to the end of the string
// /;					:Javascript delimiter and line ending
var re_email = /^[a-zA-Z0-9]([a-zA-Z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2}){0,2})$/;
//====================================================================================================


//====================================================================================================
// COUNTRY
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// [0-9]				:Match any numeric character string
// {3}					:Quantifier tells the set to match exactly 3 characters of the set
// /;					:Javascript delimiter and line ending
var re_country = /^[0-9]{3}/;
//====================================================================================================


//====================================================================================================
// iTEXT - Used for International State & Zipcodes
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// [a-zA-Z0-9			:Match any alphanumeric character string
// \s					:Match whitespace
// \-					:Match dash -
// \'					:Match single quote '
// \.					:Match period .
// \,					:Match Comma ,
// \/					:Match forward slash /
// ]					:Close set
// *					:Quantifier tells the set to match 0 or more characters
// /;					:Javascript delimiter and line ending
var re_itext = /^[a-zA-Z0-9\s\-\'\.\,\/]*/;
//====================================================================================================


//====================================================================================================
// STATE - US STATES
//====================================================================================================
// /					:Javascript delimiter
// ^					:Validate from the beginning of the string
//
// /;					:Javascript delimiter and line ending
var re_state_us = /^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$/;
//====================================================================================================


//====================================================================================================
// STATE - CANADIAN PROVINCES
//====================================================================================================
// /					:Javascript delimiter
// ^					:Validate from the beginning of the string
//
// /;					:Javascript delimiter and line ending
var re_state_ca = /^(AB|BC|MB|N[BLTSU]|ON|PE|QC|SK|YT)$/;
//====================================================================================================


//====================================================================================================
// ZIP - US ZIP CODES
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// (					:Begin Zip+4 sub group
// \d{5}				:Match any 5 character string of numbers
// -					:Match dash
// \d{4}				:Match any 4 character string of numbers
// )					:End Zip+4 Sub sub group
// |					:OR qualifier
// (					:Begin Zip5 Sub sub group
// \d{5}				:Match any 5 character string of numbers
// )					:End Zip5 Sub sub group
// )					:End Sub group
// $					:Match all the way to the end of the string
// /;					:Javascript delimiter and line ending
var re_zip_us = /^(\d{5}-\d{4})|(\d{5})$/;
//====================================================================================================


//====================================================================================================
// ZIP - US ZIP & CANADIAN POSTAL CODES
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// (					:Begin sub group
// [AaBb ...]			:Match qualified letter, first letter must be one of the standard Canadian zones: A,B,C,E,G,H,J,K,L,M,N,P,R,S,T,V,X,Y
// \d					:Match any number 0-9
// [A-Za-z]				:Match any letter
// \s?					:Match a whitespace character 0 or 1 time
// \d					:Match any number 0-9
// [A-Za-z]				:Match any letter
// \d					:Match any number 0-9
// )					:End sub group
// $					:Match all the way to the end of the string
// /;					:Javascript delimiter and line ending
var re_zip_ca = /^([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d)$/;
//====================================================================================================


//====================================================================================================
// PHONE
//====================================================================================================
// /					:Javascript delimiter
// ^					:Match from the beginning of the string
// \d					:Match any number 0-9
// \+					:Match a plus +
// \-					:Match a dash -
// \.					:Match a period .
// \s					:Match a whitespace character
// *					:Quantifier tells the set to match 0 or more characters
// $					:Match all the way to the end of the string
// /;					:Javascript delimiter and line ending
var re_phone = /^[\d\+\-\.\s]*$/;
//====================================================================================================
