function set_submodel(id) { var method='vehicle' if(id=='2') method='advanced' else id = ''; fYear = getRef("Year", id) fMake = getRef("Make", id) fModel = getRef("Model", id) fSubmodel = getRef("Submodel", id) fPricing = document.forms["pricingForm"] fPricing.year.value = fYear.options[fYear.selectedIndex].value fPricing.make.value = fMake.options[fMake.selectedIndex].value fPricing.model.value = fModel.options[fModel.selectedIndex].value fPricing[method+'Submodel'].value = fSubmodel.options[fSubmodel.selectedIndex].value if(fPricing[method+'Submodel'].value == "") fPricing[method+'Submodel'].value = "Default" } function clear_submodel(id) { var method='vehicle' var otherId='2' if(id=='2') { method='advanced' otherId='' } else id = ''; // reset_dropdowns(otherId) document.forms["pricingForm"].advancedSubmodel.value = "" document.forms["pricingForm"].vehicleSubmodel.value = "" document.forms["pricingForm"].submodel.value = "" } function reset_dropdowns(id) { disableYear(id) disableMake(id) disableModel(id) disableSubmodel(id) }