

<!-- JAVASCRIPT INCLUDE for USA DEALER LOCATOR-->

		//DEALER LOCATOR - US ZIP CODE FORM VALIDATION

		function isNum(passedVal) {
			if (passedVal == "") {
				return false;
			}
			for (i=0; i<passedVal.length; i++) {
				if (passedVal.charAt(i) < "0") {
					return false;
				}
				if (passedVal.charAt(i) > "9") {
					return false;
				}
			}
			return true;
		}

		function validZip(inZip) {
			if (inZip == "") {
				return true;
			}
			if (isNum(inZip)) {
				return true;
			}
			return false;
		}

		//ZIP CODE LOCATOR
		function submitZipCode(dealerlocator) {
			if (dealerlocator.zipcode.value == "") {
				alert("You must enter a U.S. Zip Code")
				dealerlocator.zipcode.focus()
				dealerlocator.zipcode.select()
				return false;
			}
	
			if (!validZip(dealerlocator.zipcode.value)) {
				alert("That is an invalid Zip Code")
				dealerlocator.zipcode.focus()
				dealerlocator.zipcode.select()
				return false;
			}
	
			return true;
		}
		
		//DEALER LOCATOR BY DEALER NAME
		function submitDealerName(dealerfind) {
			if (dealerfind.dealername.value == "") {
				alert("You must enter a U.S. Dealer Name")
				dealerfind.dealername.focus()
				//dealerfind.dealername.select()
				return false;
			}
	
			if (dealerfind.state.selectedIndex == "") {
				alert("You must select a State")
				dealerfind.state.focus()
				//dealerfind.state.select()
				return false;
			}
	
			return true;
		}
		
		//DEALER LOCATOR BY CITY
		function submitCity(dealerfind) {
			if (dealerfind.state.selectedIndex == 0) {
				alert("You must select a State")
				dealerfind.state.focus()
				//dealerfind.state.select()
				return false;
			}
			if (dealerfind.city.selectedIndex == "") {
				alert("You must select a City")
				dealerfind.city.focus()
				//dealerfind.city.select()
				return false;
			}			
	
			return true;
		}	

		//DEALER LOCATOR BY CITY - Check to make sure user does not select another state while cities are currently populated			
		function checkCity() {
		var s = document.dealerfind.state.selectedIndex;
		var c = document.dealerfind.city.selectedIndex;

			//check the form only if a state is already selected
			if (c != 0) {

				//so since a state is already selected, then reset the city to default <Select City> value
				if (s != 0) {
					document.dealerfind.city.options[0].selected = true;
					dealerfind.submit();
				}
			}
		} 	
		
	<!-- JAVASCRIPT INCLUDE for USA DEALER LOCATOR-->						
