<!--
	// Check to see if illegal chars are used (OK: a-z A-Z; 0-9; ,.' [space])
	// Parameters: "name" form field from function validate
	// Output: true/false
	function nameIllegalChars(str) {
		var illegalChars = /[^a-z0-9\,\.\-\ \']/i
		
		if (str.match(illegalChars)) {
			return false;
		} else {
			return true;
		}
	}
	
	
	// Check to see if name has 2+ words
	// Parameters: "name" form field from function validate
	// Output: true/false
	function fullName(str) {
		var nameFormat = /^([^,]+)\s+(\S+)$/
		
		if (str.match(nameFormat)) {
			return true;
		} else {
			return false;
		}
	}
	
	
	/* Verify that email address is in proper format
		Matches: bob@somewhere.com | bob.jones@[1.1.1.1] | bob@a.b.c.d.info
		Non-Matches: bob@com | bob.jones@some.where | bob@1.1.1.123 */
	function validEmail(str) {
		var emailFormat = /^([\w\-\.]+)@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])|(([\w\-]+\.)+)([a-zA-Z]{2,7}))$/i
		
		if (str.match(emailFormat)) {
			return true;
		} else {
			return false;
		}
	}
	
	
	/* Verify that phone number is in proper format
		Matches: (123) 456-7890 | (123) 456-7890 x123
		Non-Matches: (123) 456-7890 x123x | (123) 456-7890 x123 x123 | (123) 456-7890 x */
	function validPhone(str) {
		var phoneFormat = /((\(\d{3}\) ?)|(\d{3}[- \.]))?\d{3}[- \.]\d{4}(\s(x\d+)?){0,1}$/
		/* var phoneFormat = /^(?!\d[1]{2}|[5]{3})([2-9]\d{2})([. -]*)\d{4}$/ */
		
		if (str.match(phoneFormat)) {
			return true;
		} else {
			return false;
		}
	}
	
	
	/* Verify that zip code is in proper format
		Matches: 00501 | 84118-3423 | n3a 3B7
		Non-Matches: 501-342 | 123324 | Q4B 5C5 */
	function validZip(str) {
		var zipFormat = /^((\d{5}-\d{4})|(\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d))$/
		
		if (str.match(zipFormat)) {
			return true;
		} else {
			return false;
		}
	}
	
	
	// Validate currency (no dollar sign)
	// Parameters: "amount" form field from function validate
	// Output: true/false
	function validCurrency(str) {
		var currencyFormat = /^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$/
		//var currencyFormat = /^\$?\d+(\.(\d{2}))?$/
		
		if (str.match(currencyFormat)) {
			return true;
		} else {
			return false;
		}
	}


	// Validate number (including decimal)
	// Parameters: "amount" form field from function validate
	// Output: true/false
	function validNumber(str) {
		var numberFormat = /^\d*\.?\d*$/

		if (str.match(numberFormat)) {
			return true;
		} else {
			return false;
		}
	}
	
	
	/* Verify that at least one radio button in set is checked */
	function checkRadio(str) {
		var radioValue = ""
		
		for (i=0;i<str.length;i++) {
			if (str[i].checked) {
				radioValue = str[i].value
			}
		}
	
		if (radioValue!="") {
			return true;
		} else {
			return false;
		}
	}
	
	
	/* Get value of radio button */
	function getRadioValue(str) {
		if(!str)
			return "";
		var radioLength = str.length;
		if(radioLength == undefined)
			if(str.checked)
				return str.value;
			else
				return "";
		for(var i = 0; i < radioLength; i++) {
			if(str[i].checked) {
				return str[i].value;
			}
		}
		return "";
	}
// -->
