// Check that the test string contains something other than just whitespace
function isEmpty(testStr){var reWhitespace=/^\s+$/;return(testStr==null||testStr.length==0||reWhitespace.test(testStr))}
// Check that the test string contains valid e-mail formatting
function isEmail(testStr){var reEmail=/^.+\@.+\..+$/;return(!isEmpty(testStr)&&reEmail.test(testStr))}
// Check that the test string contains valid U.S. ZIP code formatting
function isUSZip(testStr){var reUSZip=/(^\d{5}$)|(^\d{5}-\d{4}$)/;return(!isEmpty(testStr)&&reUSZip.test(testStr))}
// Check that the test string contains valid Canadian postal code formatting
function isCAPostal(testStr){var reCAPostal=/^((\D{1}\d{1}\D{1})+(\s?|\-?)+(\d{1}\D{1}\d{1}))$/;return(!isEmpty(testStr)&&reCAPostal.test(testStr))}
// Check that the test string contains only numbers
function isNumeric(testStr){var reInteger=/^\d+$/;return(!isEmpty(testStr)&&reInteger.test(testStr))}

// Check that the test string contains only numbers and is the correct length
function isNumLn(testStr){return(testStr.length==11||testStr.length==14&&isNumeric(testStr))}
function isNumLnPhone(testStr,strLength){return(testStr.length==strLength||testStr.length==strLength&&isNumeric(testStr))}
// Check that the test string contains only numbers and is within the correct length range
function isNumLnRng(testStr,lenLow,lenUp){return((testStr.length>=lenLow&&testStr.length<=lenUp)&&isNumeric(testStr))}
// Display an error message to the user if the form data is invalid
function isInvalid(fieldObj,msgText){alert(msgText);fieldObj.focus()}
