	function isRadioChecked(strng, strngname, errorArray){
		//This is for two radio states
		if ((strng[0].checked!==true)&&(strng[1].checked!==true))
			errorArray[errorArray.length]="Your " + strngname + " is not checked.\n";
		return errorArray;
	}
	function isChecked(strng, strngname, errorArray){
		if (strng!=true)
			errorArray[errorArray.length]="The " + strngname + " is not checked.\n";
		return errorArray;
	}
	function isSame(a,b, strngname, errorArray){
		if (a!=b)
			errorArray[errorArray.length]="The " + strngname + " do not match.\n";
		return errorArray;
	}
	function isEmpty(strng, strngname, errorArray) {
		  if ((strng.length == 0)||(strng == null))
			errorArray[errorArray.length]="You didn't select " + strngname + ".\n";
		return errorArray;
	}
	function checkCreditName(strng, strngname, errorArray){
		if (strng == "") {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + ".\n";
		}else if((strng.length < 4) || (strng.length > 24)) {
		    errorArray[errorArray.length] = "The " + strngname + " is the wrong length.\n";
		}else{
		  	var illegalChars = /[^\A-Z\s]/;//Anything other than char,num
		  	// allow only letters, numbers, and underscores
		    if (illegalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " may only contain uppercase letters and spaces.\n";
		    }
		}
	    return errorArray;
	}
	function checkAlphaNumeric(strng, strngname, errorArray,len){
		if (strng == "") {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + ".\n";
		}else if((strng.length > len)) {
		    errorArray[errorArray.length] = "The " + strngname + " is the wrong length.\n";
		}else{
		  	var illegalChars = /[^\A-Za-z0-9]/;//Anything other than char,num
		  	// allow only letters, numbers, and underscores
		    if (illegalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " may only contain characters and numbers.\n";
		    }
		}
	    return errorArray;
	}
	function checkPass(strng, strngname, errorArray){
		if (strng == "") {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + ".\n";
		}else if((strng.length < 4) || (strng.length > 24)) {
		    errorArray[errorArray.length] = "The " + strngname + " is the wrong length.\n";
		}else{
		  	var illegalChars = /[^\A-Za-z0-9]/;//Anything other than char,num
		  	// allow only letters, numbers, and underscores
		    if (illegalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " may only contain characters and numbers.\n";
		    }
		}
	    return errorArray;
	}
	function checkCreditCard(s, strngname, errorArray) {
		  var i, n, c, r, t, error;
		  // First, reverse the string and remove any non-numeric characters.
		  r = "";
		  for (i = 0; i < s.length; i++) {
		    c = parseInt(s.charAt(i), 10);
		    if (c >= 0 && c <= 9)
		      r = c + r;
		  }
		  // Check for a bad string.
		  if (r.length <= 1){
		    errorArray[errorArray.length] = "You didn't enter a " + strngname + ".";
	      }else{
			  // Now run through each single digit to create a new string. Even digits
			  // are multiplied by two, odd digits are left alone.
			  t = "";
			  for (i = 0; i < r.length; i++) {
			    c = parseInt(r.charAt(i), 10);
			    if (i % 2 != 0)
			      c *= 2;
			    t = t + c;
			  }

			  // Finally, add up all the single digits in this string.
			  n = 0;
			  for (i = 0; i < t.length; i++) {
			    c = parseInt(t.charAt(i), 10);
			    n = n + c;
			  }

			  // If the resulting sum is an even multiple of ten (but not zero), the
			  // card number is good.
			  if (n != 0 && n % 10 == 0){//Do Nothing
			  }else{
			    errorArray[errorArray.length] = "The " + strngname + " is invalid. Please check again.";
		      }
		  }
		    return errorArray;
	}
	function checkName (strng, strngname, errorArray) {
		if (strng == "") {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + ".\n";
		}else if((strng.length < 2) || (strng.length > 24)) {
		    errorArray[errorArray.length] = "The " + strngname + " is the wrong length.\n";
		}else{
		  	var illegalChars = /[^\A-Za-z\s\-.]/;//Anything other than A-Z, a-z, 1-9, dot, dash, space
		  	// allow only letters, numbers, and spaces
		    if (illegalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " contains illegal characters.\n";
		    }
		}
	    return errorArray;
	}
	function checkFixedNumber(strng, strngname, errorArray, len) {
		if (strng == "") {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + " number.\n";
		}else if (strng.length !== len) {
		    errorArray[errorArray.length] = "The " + strngname + " is not " + len + " characters long.\n";
		}else{
			var legalChars = /^[0-9]*$/;
		  	// allow only numbers
		    if (!legalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " contains characters that are not numbers.\n";
		    }
	    }
	    return errorArray;
	}
	function checkFixedString(strng, strngname, errorArray, len) {
		if (strng == "") {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + ".\n";
		}else if (strng.length !== len) {
		    errorArray[errorArray.length] = "The " + strngname + " is not " + len + " characters long.\n";
		}else{
			var legalChars = /^[A-Za-z]*$/;
		  	// allow only letters
		    if (!legalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " contains characters that are not letters.\n";
		    }
	    }
	    return errorArray;
	}
	function checkAddress (strng, strngname, errorArray, required) {
		if ((strng == "")&&(required)) {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + ".\n";
		}else if ((strng.length < 2) && (required)){
		    errorArray[errorArray.length] = "The " + strngname + " is too short.\n";
		}else if (strng.length > 64) {
		    errorArray[errorArray.length] = "The " + strngname + " is too long.\n";
		}else{
			//var illegalChars = /\W/;
		  	var illegalChars = /[^\1-9A-Za-z\s\-.##,]/;//Anything other than A-Z, a-z, 1-9, dot, dash, space, pound, comma
		    if (illegalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " contains characters that are not allowed.\n";
		    }
		}
	    return errorArray;
	}
	function checkEmail (strng, strngname, errorArray){
		if (strng == "") {
		   errorArray[errorArray.length] = "You left " + strngname + " blank.\n";
		}else{
		    var emailFilter=/^.+@.+\..{2,3}$/;
		    if (!(emailFilter.test(strng))) {
		       errorArray[errorArray.length] = "Please enter a valid " + strngname + ".\n";
		    }else {
		//test email for illegal characters
		       var illegalChars= /[\(\)\<\>\,\;\:\|\\\"\[\]]/
		         if (strng.match(illegalChars)) {
		          errorArray[errorArray.length] = "The " + strngname + " contains illegal characters.\n";
		       }
		    }
		}
		return errorArray;
	}
	function checkAge(strng, strngname, errorArray) {
		if (strng == "") {
			//No age is okay
			//errorArray[errorArray.length] = "You didn't enter your age.\n";
		}else if (strng.length > 3) {
		    errorArray[errorArray.length] = "Your age is more than three characters.\n";
		}else{
			var legalChars = /^[0-9]*$/;
		  	// allow only numbers
		    if (!legalChars.test(strng)) {
		       errorArray[errorArray.length] = "Your " + strngname + " contains characters that are not numbers.\n";
		    }else{
				if (parseInt(strng)>130)
		       		errorArray[errorArray.length] = "Your " + strngname + " is unreasonably high.\n";
			}
	    }
	    return errorArray;
	}
	function checkPhone(strng, strngname, errorArray) {
		if (strng == "") {
			errorArray[errorArray.length] = "You didn't enter a " + strngname + " number.\n";
		}else if (strng.length !== 10) {
		    errorArray[errorArray.length] = "The " + strngname + " is not 10 digits.\n";
		}else{
			var legalChars = /^[0-9]*$/;
		  	// allow only numbers
		    if (!legalChars.test(strng)) {
		       errorArray[errorArray.length] = "The " + strngname + " contains characters that are not numbers.\n";
		    }
	    }
	    return errorArray;
	}

