			var errorStyle = "error"
			var regularStyle = ""
			function submit_form(method, location, geoPointId) {
				if (location)
                                    resetValidation(location);
				var zip = validate_zip();
				var dropdowns = validate_dropdowns(method);
				var frm = document.forms["pricingForm"];
				var zipLabel = $("zipLabel");
				var zipError = $("zipError");
				if(!zip) {
					zipLabel.className = errorStyle;
					zipError.style.display = "block";
					zipError.style.fontSize = "12px";
					zipError.style.fontWeight = "bold";
					window.location.href="#zipAnchor";
				} else if(!dropdowns) {
					window.location.href="#dropdownAnchor";
				} else {
					$('methodSubmit').value = method
					var suffix = ''
					if(method == 'advanced')
						suffix = 'Advanced'
					$('baseVehIdSubmit').value = $('baseVehId' + suffix).value
					$('yearSubmit').value = $('year' + suffix).options[$('year' + suffix).selectedIndex].value
					$('makeSubmit').value = $('makeHidden' + suffix).value
					$('modelSubmit').value = $('modelHidden' + suffix).value
					$('submodelSubmit').value = $('submodelHidden' + suffix).value
                                        
                                        if (geoPointId)
                                            return !addressHelper.geocodeAndThenSubmitForm(frm["zip"].value.replace(/ /, ""), 'pricingForm', geoPointId);

					frm.submit()
				}
			}
			function resetValidation(location) {
				var zipError = $("zipError");
				var zipLabel = $("zipLabel");
				zipLabel.className = regularStyle;
				zipError.style.display = "none";
				resetDropdowns(location);
			}
			function resetDropdowns(location) {
				$("vehicleError").style.display = "none";
				$("vehicle.yearLabel").className = regularStyle;
				$("vehicle_makeLabel").className = regularStyle;
				$("vehicle_modelLabel").className = regularStyle;
				$("vehicle_submodelLabel").className = regularStyle;
				if(location != 'home') {
					$("sizeError").style.display = "none";
					$("crossSectionLabel").className = regularStyle;
					$("aspectRatioLabel").className = regularStyle;
					$("rimSizeLabel").className = regularStyle;
					$("advanced.yearLabel").className = regularStyle;
					$("advanced_makeLabel").className = regularStyle;
					$("advanced_modelLabel").className = regularStyle;
					$("advanced_submodelLabel").className = regularStyle;
				}
			}
			function requireDropdowns(method) {
				var suffix = ''
				if(method == 'advanced')
					suffix = 'Advanced';
				var vehicleError = $("vehicleError")
				vehicleError.style.display = "block";
				vehicleError.style.fontSize = "12px";
				vehicleError.style.fontWeight = "bold";
				var fYear = $("year"+suffix);
				var yearIndex = fYear.selectedIndex;
				var fMake = $("make"+suffix);
				var makeIndex = fMake.selectedIndex;
				var fModel = $("model"+suffix);
				var modelIndex = fModel.selectedIndex;
				var fSubmodel = $("submodel"+suffix);
				var submodelIndex = fSubmodel.selectedIndex;
				if(fYear.options[yearIndex].value == "")
					$(method + ".yearLabel").className = errorStyle;
				if(yearIndex > 0
						&& fMake.options[makeIndex].value == "")
					$(method + "_makeLabel").className = errorStyle;
				if(makeIndex > 0
						&& fModel.options[modelIndex].value == "")
					$(method + "_modelLabel").className = errorStyle;
				if(modelIndex > 0
						&& fSubmodel.options[submodelIndex].value == "")
					$(method + "_submodelLabel").className = errorStyle;
			}
			function validate_zip() {
				var valid="0123456789";
				var frm = document.forms["pricingForm"];				
				var zip = frm["zip"].value;
				var zipError = $("zipError");
				if(zip == null || zip.length != 5) {
					zipError.innerHTML = "Your ZIP Code is required."
					return false;
				}
				for(var i=0; i<5; i++) {
					if(valid.indexOf(zip.substring(i, i+1)) == -1) {
						zipError.innerHTML = "Please enter a valid ZIP Code."
						return false;
					}
				}
				return true;
			}
			function validate_dropdowns(method) {
				var suffix = ''
				if(method == 'advanced')
					suffix = 'Advanced';
				var frm = document.forms["pricingForm"];				
				if (method != 'size' && $('submodelHidden'+suffix).value == '') {
					requireDropdowns(method);
					return false;
				}
				if (method == 'size') {
					var size = document.forms["sizeForm"];
					var cross = size.cross.options.selectedIndex;
					var aspect = size.aspect.options.selectedIndex;
					var rim = size.rim.options.selectedIndex;
					var zeroCount = 0;
					if(cross == 0)
						zeroCount++;
					if(aspect == 0)
						zeroCount++;
					if(rim == 0)
						zeroCount++;
					if(zeroCount>1) {
						$("sizeError").style.display = "inline";
						if(cross==0)
							$("crossSectionLabel").className = errorStyle;
						if(aspect==0)
							$("aspectRatioLabel").className = errorStyle;
						if(rim==0)
							$("rimSizeLabel").className = errorStyle;
						return false;
					}
					frm.cross.value = size.cross.options[cross].value;
					frm.aspect.value = size.aspect.options[aspect].value;
					frm.rim.value = size.rim.options[rim].value;
				}
				return true;
			}
