var mblnDisabledVIN = false, mblnDisabledVehicle = false;

function setDisabled() {
	var objForm = document.MBPForm;
	
	if (mblnDisabledVIN == false && objForm.ModelYears.selectedIndex != 0) {
		disable(objForm.VIN);
		mblnDisabledVIN = true;
	} else if (mblnDisabledVIN == true && objForm.ModelYears.selectedIndex == 0) {
		enable(objForm.VIN);
		mblnDisabledVIN = false;
	} else if (mblnDisabledVehicle == false && objForm.VIN.value != '') {
		disable(objForm.ModelYears);
		disable(objForm.CarMakes);
		disable(objForm.CarModels);
		disable(objForm.CarSubModels);
		mblnDisabledVehicle = true;
	} else if (mblnDisabledVehicle == true && objForm.VIN.value == '') {
		enable(objForm.ModelYears);
		enable(objForm.CarMakes);
		enable(objForm.CarModels);
		enable(objForm.CarSubModels);
		mblnDisabledVehicle = false;
	}
}
function disable(Object) {
	Object.disabled = true;
	Object.style.backgroundColor = '#E5E5E5';
}
function enable(Object) {
	Object.disabled  = false;
	Object.style.backgroundColor = 'white';
}
function submitPM() {
	if (typeof document.MBPForm.UsedCommercially == "undefined" || getRadioValue(document.MBPForm.UsedCommercially) == "false") {
		document.MBPForm.submit();
		return;
	}

	var strText = 
		"Commercial Use Terms and Conditions" +
		"\n\nCommercial Use means, but is not limited to, the use of Your Vehicle for farming, " +
		"ranching, rodeo, route work, job-site activities, deliveries, service calls, construction, " +
		"hauling, daily rental, or carrying passengers for hire, whether Your Vehicle is licensed for " +
		"commercial purposes or not, or registered to a corporation or not.  Certain types of Commercial " +
		"Use is allowed ONLY if you have paid for the Commercial Use surcharge at the time of the " +
		"application for this Contract.";
	strText = strText +
		"\n\nSurcharge Commercial Use coverage absolutely excludes the following types of Commercial " +
		"Use: taxi, rental, mail carrier, snow plow, oil field, police or security, ambulance, shuttle " +
		"service, tow truck, auto transport, road construction, fire or rescue, waste removal, dump truck, " +
		"winch truck, hazardous material transportation, racing or competitive driving or any " +
		"military/federal/state/city/government use." +
		"\n\nDo you agree to these terms and conditions? Click \'OK\' for Yes, \'Cancel\' for No.";
	
	if (confirm(strText) == true)
		document.MBPForm.submit();
}
function submitOR() {
	if (typeof document.MBPForm.UsedCommercially == "undefined" || getRadioValue(document.MBPForm.UsedCommercially) == "false") {
		document.MBPForm.submit();
		return;
	}

	var strText = 
		"Light Duty Commercial Use Terms and Conditions" +
		"\n\nLight Duty Commercial will include any new vehicle " +
		"(with less than 12,000 odometer miles at the time of contract purchase) " +
		"used for the purpose of sales or route service, inspections or examinations, " +
		"maintenance or repair, construction, gardening, carrying tools to a jobsite, " +
		"and vehicles used to provide shuttle services for non-profit organizations.  " +
		"\n\nVehicles used for competitive driving, racing or off-road use, hire to the public, " +
		"rental, pool cars, or any vehicle equipped for or used as a snowplow remain ineligible for coverage." +
		"\n\nDo you agree to these terms and conditions? Click \"OK\" for Yes, \"Cancel\" for No.";
	
	if (confirm(strText) == true)
		document.MBPForm.submit();
}
