function confimation(page) {
	if(page == "order_form") {
		alert("Thank you for your request;\nWe will return your inquiry as soon as possible.");
	}
}

function validate(inpForm) {

	var strInvalidError = "The";
	var intInvalidError = 0;
	
	var strEmptyError = "The";
	var intEmptyError = 0;
	var arrEmptyError = new Array;
	
	var strPhoneError = "Please enter only 10 digit phone numbers in the";
	var intPhoneError = 0;
	
	//	check company name field
	if(inpForm.company_name.value != "") {
		//	has something there
	} else {
		strEmptyError += " Company Name,";
		intEmptyError++;
	}
	
	//	check company name field
	if(inpForm.contact_name.value != "") {
		//	has something there
	} else {
		strEmptyError += " Contact Name,";
		arrEmptyError.push("Contact Name");
		intEmptyError++;
	}
	
	//	check company name field
	if(inpForm.email.value != "") {
		//	has something there
	} else {
		strEmptyError += " Email Address,";
		arrEmptyError.push("Email Address");
		intEmptyError++;
	}
	
	//	check company name field
	if(inpForm.event_date.value != "") {
		//	has something there
	} else {
		strEmptyError += " Event Date,";
		arrEmptyError.push("Event Date");
		intEmptyError++;
	}
	
	// Check Phone Number Field
	if(inpForm.phone.value != "") {
		var intPhoneNumber = inpForm.phone.value.search(/[\d]/g);
		if(intPhoneNumber == -1) {
			strPhoneError += " Phone Number,";
			intPhoneError++;
		} else {		
			arrPhoneNumber = inpForm.phone.value.match(/[\d]/g);
			if(arrPhoneNumber != null){
				switch(arrPhoneNumber.length) {
					case 10:
						var strPhoneNumber = arrPhoneNumber.join("");
						inpForm.phone.value = strPhoneNumber;
						break;
					case 11:
						arrPhoneNumber = arrPhoneNumber.slice(1);
						var strPhoneNumber = arrPhoneNumber.join("");
						inpForm.phone.value = strPhoneNumber;
						break;
					default:
						strPhoneError += "  Phone Number,";
						intPhoneError++;
						break;
				}
			}
		}
	} else {
		strEmptyError += " Phone Number,";
		arrEmptyError.push("Phone Number");
		intEmptyError++;
	}
	
	//	check company name field
	if(inpForm.shipping_address_1.value != "") {
		//	has something there
	} else {
		strEmptyError += " Shipping Address,";
		arrEmptyError.push("Shipping Address");
		intEmptyError++;
	}
	
	//	check company name field
	if(inpForm.city.value != "") {
		//	has something there
	} else {
		strEmptyError += " City,";
		arrEmptyError.push("City");
		intEmptyError++;
	}
	
	if(intInvalidError > 0) {
	strInvalidError = strInvalidError.slice(0, -1);
		if(intInvalidError == 1) {
			strInvalidError += " field contains invalid character(s).";
		} else {
			strInvalidError += " fields contain invalid character(s).";
		}
		alert(strInvalidError);	
	}
	
	if(intEmptyError > 0) {
	strEmptyError = strEmptyError.slice(0, -1);
		if(intEmptyError == 1) {
			strEmptyError = arrEmptyError[0];
			strEmptyError = "The " + strEmptyError + " field is empty.";
		} else {
			var strEmptyLast = arrEmptyError.pop();
			strEmptyError = arrEmptyError.join(", ") + " & " + strEmptyLast;
			strEmptyError = "The " + strEmptyError + " fields are empty.";
		}
		alert(strEmptyError);	
	}
	
	if(intPhoneError > 0) {
	strPhoneError = strPhoneError.slice(0, -1);
		if(intPhoneError == 1) {
			strPhoneError += " field.";
		} else {
			strPhoneError += " fields.";
		}
		alert(strPhoneError);	
	}
	
	if(intInvalidError == 0 && intEmptyError == 0 && intPhoneError == 0) {
		confirmation('order_form');
		return true;
	} else {
		return false;
	}
}