$(document).ready(function() {
	$('a.blank, form.blank').attr('target', '_blank');
});

function Quote_Ocean_FormValidator(theForm) {
/* Company Name */
	if (theForm.Company_Name.value == "") {
		window.alert("Please enter a value for the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	if (theForm.Company_Name.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	
/* Contact */
	if (theForm.Contact.value == "") {
		window.alert("Please enter a value for the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	if (theForm.Contact.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	
/* Address */
	if (theForm.Address.value == "") {
		window.alert("Please enter a value for the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	if (theForm.Address.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	
/* Phone */
	if (theForm.Phone.value == "") {
		window.alert("Please enter a value for the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (theForm.Phone.value.length > 30) {
		window.alert("Please enter at most 30 characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	
	var checkOK = "0123456789-. ";
	var checkStr = theForm.Phone.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else if (ch == " " && decPoints != 0) {
			validGroups = false;
			break;
		} else if (ch != " ") {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};

/* Origin of Commodity */
	if (theForm.Origin_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	if (theForm.Origin_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	
/* Destination of Commodity */
	if (theForm.Destination_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	if (theForm.Destination_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	
/* Rate Basis */
	if (theForm.Rate_Basis.selectedIndex < 0) {
		window.alert("Please select one of the \"Rate Basis\" options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	if (theForm.Rate_Basis.selectedIndex == 0) {
		window.alert("The first \"Rate Basis\" option is not a valid selection. Please choose one of the other options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	
/* Method of Transport */
	if (theForm.Method_of_Transport.selectedIndex < 0) {
		window.alert("Please select one of the \"Method of Transport\" options.");
		theForm.Method_of_Transport.focus();
		return (false);
	};
	if (theForm.Method_of_Transport.selectedIndex == 0) {
		window.alert("The first \"Method of Transport\" option is not a valid selection. Please choose one of the other options.");
		theForm.Method_of_Transport.focus();
		return (false);
	};
	
/* Description Of Goods */
	if (theForm.Description_Of_Goods.value == "") {
		window.alert("Please enter a value for the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	}
	if (theForm.Description_Of_Goods.value.length > 10000) {
		window.alert("Please enter at most 10000 characters in the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	};
	
/* Weight */
	if (theForm.Weight.value == "") {
		window.alert("Please enter a value for the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Weight.value.length > 10) {
		window.alert("Please enter at most 10 characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	
	var checkOK = "0123456789-.";
	var checkStr = theForm.Weight.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex < 0) {
		window.alert("Please select one of the \"Weight\" options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex == 0) {
		window.alert("The first \"Weight\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};

/* Dimensions */
	if (theForm.Dimensions.value == "") {
		window.alert("Please enter a value for the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	}
	if (theForm.Dimensions.value.length > 200) {
		window.alert("Please enter at most 200 characters in the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex < 0) {
		window.alert("Please select one of the \"Dimensions\" options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex == 0) {
		window.alert("The first \"Dimensions\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	
/* Type of Packing */
	if (theForm.Packing.selectedIndex < 0) {
		window.alert("Please select one of the \"Type of Packing\" options.");
		theForm.Packing.focus();
		return (false);
	};
	if (theForm.Packing.selectedIndex == 0) {
		window.alert("The first \"Type of Packing\" option is not a valid selection. Please choose one of the other options.");
		theForm.Packing.focus();
		return (false);
	};
	
	return (true);
};

function Quote_Surface1_FormValidator(theForm) {
/* Company Name */
	if (theForm.Company_Name.value == "") {
		window.alert("Please enter a value for the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	if (theForm.Company_Name.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	
/* Contact */
	if (theForm.Contact.value == "") {
		window.alert("Please enter a value for the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	if (theForm.Contact.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	
/* Address */
	if (theForm.Address.value == "") {
		window.alert("Please enter a value for the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	if (theForm.Address.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	
/* Phone */
	if (theForm.Phone.value == "") {
		window.alert("Please enter a value for the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (theForm.Phone.value.length > 30) {
		window.alert("Please enter at most 30 characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	
	var checkOK = "0123456789-. ";
	var checkStr = theForm.Phone.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else if (ch == " " && decPoints != 0) {
			validGroups = false;
			break;
		} else if (ch != " ") {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};

/* Origin of Commodity */
	if (theForm.Origin_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	if (theForm.Origin_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	
/* Destination of Commodity */
	if (theForm.Destination_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	if (theForm.Destination_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	
/* Rate Basis */
	if (theForm.Rate_Basis.selectedIndex < 0) {
		window.alert("Please select one of the \"Rate Basis\" options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	if (theForm.Rate_Basis.selectedIndex == 0) {
		window.alert("The first \"Rate Basis\" option is not a valid selection. Please choose one of the other options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	
/* Description Of Goods */
	if (theForm.Description_Of_Goods.value == "") {
		window.alert("Please enter a value for the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	}
	if (theForm.Description_Of_Goods.value.length > 10000) {
		window.alert("Please enter at most 10000 characters in the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	};
	
/* Weight */
	if (theForm.Weight.value == "") {
		window.alert("Please enter a value for the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Weight.value.length > 10) {
		window.alert("Please enter at most 10 characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	
	var checkOK = "0123456789-.";
	var checkStr = theForm.Weight.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex < 0) {
		window.alert("Please select one of the \"Weight\" options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex == 0) {
		window.alert("The first \"Weight\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};
	
/* Dimensions */
	if (theForm.Dimensions.value == "") {
		window.alert("Please enter a value for the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	}
	if (theForm.Dimensions.value.length > 200) {
		window.alert("Please enter at most 200 characters in the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex < 0) {
		window.alert("Please select one of the \"Dimensions\" options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex == 0) {
		window.alert("The first \"Dimensions\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	
/* Type of Packing */
	if (theForm.Packing.selectedIndex < 0) {
		window.alert("Please select one of the \"Type of Packing\" options.");
		theForm.Packing.focus();
		return (false);
	};
	if (theForm.Packing.selectedIndex == 0) {
		window.alert("The first \"Type of Packing\" option is not a valid selection. Please choose one of the other options.");
		theForm.Packing.focus();
		return (false);
	};
	
	return (true);
};

function Quote_Surface2_FormValidator(theForm) {
/* Company Name */
	if (theForm.Company_Name.value == "") {
		window.alert("Please enter a value for the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	if (theForm.Company_Name.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	
/* Contact */
	if (theForm.Contact.value == "") {
		window.alert("Please enter a value for the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	if (theForm.Contact.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	
/* Address */
	if (theForm.Address.value == "") {
		window.alert("Please enter a value for the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	if (theForm.Address.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	
/* Phone */
	if (theForm.Phone.value == "") {
		window.alert("Please enter a value for the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (theForm.Phone.value.length > 30) {
		window.alert("Please enter at most 30 characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	
	var checkOK = "0123456789-. ";
	var checkStr = theForm.Phone.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else if (ch == " " && decPoints != 0) {
			validGroups = false;
			break;
		} else if (ch != " ") {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};

/* Origin of Commodity */
	if (theForm.Origin_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	if (theForm.Origin_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	
/* Destination of Commodity */
	if (theForm.Destination_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	if (theForm.Destination_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	
/* Rate Basis */
	if (theForm.Rate_Basis.selectedIndex < 0) {
		window.alert("Please select one of the \"Rate Basis\" options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	if (theForm.Rate_Basis.selectedIndex == 0) {
		window.alert("The first \"Rate Basis\" option is not a valid selection. Please choose one of the other options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	
/* Description Of Goods */
	if (theForm.Description_Of_Goods.value == "") {
		window.alert("Please enter a value for the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	}
	if (theForm.Description_Of_Goods.value.length > 10000) {
		window.alert("Please enter at most 10000 characters in the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	};
	
/* Weight */
	if (theForm.Weight.value == "") {
		window.alert("Please enter a value for the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Weight.value.length > 10) {
		window.alert("Please enter at most 10 characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	
	var checkOK = "0123456789-.";
	var checkStr = theForm.Weight.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex < 0) {
		window.alert("Please select one of the \"Weight\" options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex == 0) {
		window.alert("The first \"Weight\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};
	
/* Dimensions */
	if (theForm.Dimensions.value == "") {
		window.alert("Please enter a value for the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	}
	if (theForm.Dimensions.value.length > 200) {
		window.alert("Please enter at most 200 characters in the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex < 0) {
		window.alert("Please select one of the \"Dimensions\" options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex == 0) {
		window.alert("The first \"Dimensions\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	
/* Type of Packing */
	if (theForm.Packing.selectedIndex < 0) {
		window.alert("Please select one of the \"Type of Packing\" options.");
		theForm.Packing.focus();
		return (false);
	};
	if (theForm.Packing.selectedIndex == 0) {
		window.alert("The first \"Type of Packing\" option is not a valid selection. Please choose one of the other options.");
		theForm.Packing.focus();
		return (false);
	};
	
	return (true);
};

function Quote_Air_FormValidator(theForm) {
/* Company Name */
	if (theForm.Company_Name.value == "") {
		window.alert("Please enter a value for the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	if (theForm.Company_Name.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Company Name\" field.");
		theForm.Company_Name.focus();
		return (false);
	};
	
/* Contact */
	if (theForm.Contact.value == "") {
		window.alert("Please enter a value for the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	if (theForm.Contact.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Contact\" field.");
		theForm.Contact.focus();
		return (false);
	};
	
/* Address */
	if (theForm.Address.value == "") {
		window.alert("Please enter a value for the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	if (theForm.Address.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Address\" field.");
		theForm.Address.focus();
		return (false);
	};
	
/* Phone */
	if (theForm.Phone.value == "") {
		window.alert("Please enter a value for the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (theForm.Phone.value.length > 30) {
		window.alert("Please enter at most 30 characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	
	var checkOK = "0123456789-. ";
	var checkStr = theForm.Phone.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else if (ch == " " && decPoints != 0) {
			validGroups = false;
			break;
		} else if (ch != " ") {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Phone\" field.");
		theForm.Phone.focus();
		return (false);
	};

/* Origin of Commodity */
	if (theForm.Origin_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	if (theForm.Origin_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Origin of Commodity\" field.");
		theForm.Origin_of_Commodity.focus();
		return (false);
	};
	
/* Destination of Commodity */
	if (theForm.Destination_of_Commodity.value == "") {
		window.alert("Please enter a value for the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	if (theForm.Destination_of_Commodity.value.length > 100) {
		window.alert("Please enter at most 100 characters in the \"Destination of Commodity\" field.");
		theForm.Destination_of_Commodity.focus();
		return (false);
	};
	
/* Rate Basis */
	if (theForm.Rate_Basis.selectedIndex < 0) {
		window.alert("Please select one of the \"Rate Basis\" options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	if (theForm.Rate_Basis.selectedIndex == 0) {
		window.alert("The first \"Rate Basis\" option is not a valid selection. Please choose one of the other options.");
		theForm.Rate_Basis.focus();
		return (false);
	};
	
/* Description Of Goods */
	if (theForm.Description_Of_Goods.value == "") {
		window.alert("Please enter a value for the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	}
	if (theForm.Description_Of_Goods.value.length > 10000) {
		window.alert("Please enter at most 10000 characters in the \"Description Of Goods\" field.");
		theForm.Description_Of_Goods.focus();
		return (false);
	};
	
/* Weight */
	if (theForm.Weight.value == "") {
		window.alert("Please enter a value for the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Weight.value.length > 10) {
		window.alert("Please enter at most 10 characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	
	var checkOK = "0123456789-.";
	var checkStr = theForm.Weight.value;
	var allValid = true;
	var validGroups = true;
	var decPoints = 0;
	var allNum = "";
	
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		
		for (j = 0;  j < checkOK.length;  j++) {
			if (ch == checkOK.charAt(j)) {
				break;
			};
		};
		
		if (j == checkOK.length) {
			allValid = false;
			break;
		};
		
		if (ch == ".") {
			allNum += ".";
			decPoints++;
		} else {
			allNum += ch;
		};
	};
	
	if (!allValid) {
		window.alert("Please enter only digit characters in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (decPoints > 1 || !validGroups) {
		window.alert("Please enter a valid number in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex < 0) {
		window.alert("Please select one of the \"Weight\" options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};
	if (theForm.Unit_Measurement.selectedIndex == 0) {
		window.alert("The first \"Weight\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement.focus();
		return (false);
	};
	
/* Dimensions */
	if (theForm.Dimensions.value == "") {
		window.alert("Please enter a value for the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	}
	if (theForm.Dimensions.value.length > 200) {
		window.alert("Please enter at most 200 characters in the \"Dimensions\" field.");
		theForm.Dimensions.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex < 0) {
		window.alert("Please select one of the \"Dimensions\" options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	if (theForm.Unit_Measurement_.selectedIndex == 0) {
		window.alert("The first \"Dimensions\" option is not a valid selection. Please choose one of the other options.");
		theForm.Unit_Measurement_.focus();
		return (false);
	};
	
/* Type of Packing */
	if (theForm.Packing.selectedIndex < 0) {
		window.alert("Please select one of the \"Type of Packing\" options.");
		theForm.Packing.focus();
		return (false);
	};
	if (theForm.Packing.selectedIndex == 0) {
		window.alert("The first \"Type of Packing\" option is not a valid selection. Please choose one of the other options.");
		theForm.Packing.focus();
		return (false);
	};
	
	return (true);
};


	function TreeExpand_List() {
		var stato = $(this).css('display');
		$(this).parents('li').removeClass( (stato == 'block' ? 'closed' : 'opened') ).addClass( (stato == 'block' ? 'opened' : 'closed') );
	};

	function TreeExpand_List_close() {
		var stato = $(this).css('display');
		$(this).parents('li').removeClass( (stato == 'block' ? 'opened' : 'closed') );
	};
