/*
	Author: Omar Ellis
	Subject: Javascript Validation and Formatting library.
	Date Created: 6/28/2006

	The function will valid any SSN type (e.g. dashes, spaces, or no spaces).
	@ param sSSN The SSN to be validated.
	return bool
*/
function ValidateSSN(sSSN){
	return /^(\d){3}[-|\s](\d){2}[-|\s](\d){4}$/.test( sSSN );
}
/*
	The function will valid any Currency type (e.g. X.XXX).
	@ param sCurrency The Currency to be validated.
	return bool
*/
function ValidateCurrency(sCurrency){
	return /^(\d){1,}[.](\d){2,}$/.test( sCurrency );
}
/*
	The function will valid any DSI type (e.g. DXXXXXXXX).
	@ param sDSI The DSI to be validated.
	return bool
*/
function ValidateDSI(sDSI){
	return /^[D|d](\d){8}/.test( sDSI );
}

/*
	The function will valid SSN only with dashes.
	@ param sSSN The SSN to be validated.
	return bool
*/
function ValidateSSN_Dashed(sSSN){
	return /^(\d){3}[-](\d){2}[-](\d){4}$/.test( sSSN );
}
/*
	The function will valid Time.
	@ param sTime The Time to be validated.
	return bool
*/
function ValidateTime(sTime){
	return /^(\d){1,2}[:](\d){2}$/.test( sTime );
}
/*
	The function will valid SSN only with dashes.
	@ param sSSN The SSN to be validated.
	return bool
*/
function ValidateDate(sDate){
	return /^(\d){2}[/](\d){2}[/](\d){4}$/.test( sDate );
}
/*
	The function will valid a four digit year.
	@ param sYear The Year to be validated.
	return bool
*/
function ValidateFourDigitYear(sYear){
	return /^(\d){4}$/.test( sYear );
}
/*
	The function will valid a phone number with an area code in parentheses.
	A single dash or space is required to seperate the last section.
	@ param sPhoneNumber The phone number to be validated.
	return bool
*/        
function ValidatePhone_WithParaAreaCode(sPhoneNumber){
	return /^[((](\d){3}[))](\d){3}[-|\s]{1}(\d){4}$/.test(sPhoneNumber)
}
/*
	The function will valid a phone number with an area code excluding the parentheses.
	A single dash or space is required to seperate the sections.
	@ param sPhoneNumber The phone number to be validated.
	return bool
*/        
function ValidatePhone_WithoutParaAreaCode(sPhoneNumber){
	return /^(\d){3}[-|\s]{1}(\d){3}[-|\s]{1}(\d){4}$/.test(sPhoneNumber)
}
/*
	The function will valid an email address.
	@ param sEmail The email that will be validated.
	return bool
*/        
function ValidateEmail(sEmail){
	return /^[\w\.-]+@[\w\.-]+\.[a-z]{2,3}|[A-Z]{2,3}$/.test(sEmail);
}
/*
	The function will valid a US zip code.
	@ param sZipCode The zip code to be validated.
	return bool
*/                
function ValidateUSAZipCode(sZipCode){
	return /^(\d){5}([-](\d){4})?$/.test(sZipCode);
}

