	function checkForm(theForm) {
		var why = "";
		why += checkBlank("* First Name", theForm.shippingFirstName.value);
		why += checkBlank("* Last Name", theForm.shippingLastName.value);
		why += checkBlank("* Address", theForm.shippingAddress1.value);
		why += checkBlank("* City", theForm.shippingCity.value);
		why += checkBlank("* State", theForm.shippingState.value);
		why += checkBlank("* Country", theForm.shippingCountry.options[theForm.shippingCountry.selectedIndex].text);
		why += checkZip(theForm.ShippingPostalCode.value);
		why += checkBlank("* Phone", theForm.ShippingDayPhone.value);
		why += checkEmail(theForm.email.value);
		
		if (why != "") {
			alert(why);
			return false;
		} else {
			return true;
		}
	} 
	
	// Empty Field Checker
    	function checkBlank (field, strng) {
		var error = "";
		if (strng == "") {
			error = "Required field is empty: " + field + "\n";
		}
		return error;
	}

	//phone
	function checkPhone (field, strng) {
		var error="";
		if (strng == "") {
			error = "Required field is empty: " + field + "\n";
			return error;
		} else {

		//strip out acceptable non-numeric characters
		var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');
			
			if (isNaN(parseInt(stripped))) {
				error = "The phone number contains illegal characters.\n";
				return error;
			}
			
			if (!(stripped.length == 10)) {
				error = "The phone number is the wrong length. Format number as XXX-XXX-XXXX\n";
				return error;
			}
		}
		return error;
	} 
	
	// email
    function checkEmail (strng) {
		var error="";
		if (strng == "") {
			error = "You didn't enter an email address.\n";
		}

		var emailFilter=/^.+@.+\..{2,3}$/;
		if (!(emailFilter.test(strng))) { 
			error = "Please enter a valid email address.\n";
		} else {

		//test email for illegal characters
			var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
			if (strng.match(illegalChars)) {
				error = "The email address contains illegal characters.\n";
			}
		}
		return error;    
    }

    function checkZip (strng) {
		var error = "";
		if (strng == "") {
			error = "You didn't enter a zip code.\n";
		}

		/*
		var stripped = strng.replace(/^\d$/, ''); //strip out acceptable non-numeric characters
		if (isNaN(parseInt(stripped))) {
			error = "The Zip Code contains illegal characters.\n";
		}

		if (!(stripped.length == 5)) {
			error = "Please use a 5 digit zip code.\n";
		} 
		*/
		return error;
    }