
//Provide a shortcut to reference html objects
				function $(ele){ return document.forms["amspCatalog"].elements[ele]; }
			
				function checkCountry(country) {
					if(country.value == 'PUERTO RICO') {
						$('state').disabled = false;
						$('state').value = 'PR';
					}
					else if(country.value == 'UNITED STATES' || country.value == 'CANADA') {
						$('state').disabled = false;
					} 
					else {
						$('state').selectedIndex = 0;
						$('state').disabled = true;
					}
				}
				
				//Check fields for acceptable data before submitting
				function checkForm() {
					var errorMessage = "The following fields must be completed:\n\n";
					var showError	 = 0;

					if($("catalogNo").value == "") {
						alert("Please select a catalog from the list.");
						$("catalogNo").focus();
						return false;
					}
					if($("country").value == "") {
						alert("Please select a country from the list.");
						$("country").focus();
						return false;
					}
					if(($("country").value == "UNITED STATES" || $("country").value == "CANADA") && $("state").value == "") {
						alert("Please select a state or province from the list.");
						$("state").focus();
						return false;
					}
					if($("firstName").value.replace(/\s/g,'') == "") {
						errorMessage += "  First Name\n";
						$("firstName").focus();
						showError = 1;
					}
					if($("lastName").value.replace(/\s/g,'') == "") {
						errorMessage += "  Last Name\n";
						$("lastName").focus();
						showError = 1;
					}
					if($("street").value.replace(/\s/g,'') == "") {
						errorMessage += "  Street\n";
						$("street").focus();
						showError = 1;
					}
					if($("city").value.replace(/\s/g,'') == "") {
						errorMessage += "  City\n";
						$("city").focus();
						showError = 1;
					}
					if($("zip").value.replace(/\s/g,'') == "") {
						errorMessage += "  Zip\n";
						$("zip").focus();
						showError = 1;
					}
					if($("email").value.replace(/\s/g,'') == "") {
						errorMessage += "  Email\n";
						$("email").focus();
						showError = 1;
					}

					if ( !$("mailer")[0].checked && !$("mailer")[1].checked ) {
						errorMessage += "  Update & News Opt-in\n";
						showError = 1;
					}
					else 
					if($("mailer")[0].checked) {
						$("mailing").value = $("mailer")[0].value;
					}
					else 
					if($("mailer")[1].checked) {
						$("mailing").value = $("mailer")[1].value;
					}

					if(showError == 1) {
						errorMessage += "";
						alert(errorMessage);
						$("firstName").focus();
						showError = 0;
						return false;
					}
					//Check if requestor wants to receive mail updates
					for(var i=0;i<$("mailer").length;i++) {
						if($("mailer")[i].checked == true) {
							$("mailing").value = $("mailer")[i].value;
							break; //Exit loop
						}
					}
					
					$("action").value = "SAVENEWCATALOGREQUEST";
					
				}

				//Allow the user to enter only numbers, and decimal points
				function isNumberKey(evt) {
					var charCode = (evt.which) ? evt.which : event.keyCode

					if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 45)
					{ return false; }
					
					 return true;
				}
				
				function badEmail(theEmail) 
{
 var sEmail = "" + theEmail;
 if (sEmail.indexOf('@') == -1) return true;
 if (sEmail.indexOf('.') == -1) return true; 
}