function validate(form) {
	
	if (trim(form.input1.value) == "") {
		alert("Please enter the name of business.");
		return false;
	}
	if (trim(form.input2.value) == "" &&
		trim(form.input3.value) == "") {
		alert("Please choose a type of business from the dropdown menu, or enter a business type.");
		return false;
	}
	if (trim(form.input4.value) == "") {
		alert("Please enter the services or products offered.");
		return false;
	}
	if (trim(form.input5.value) == "") {
		alert("Please enter the owner(s).");
		return false;
	}
	if (trim(form.input7.value) == "" ||
		trim(form.input8.value) == "" ||
		trim(form.input9.value) == "") {
		if (form.input10.checked) {
			alert("Please complete the address, even though you've specified not to show your address.  The address is for our records, and will never be displayed.");
		} else {
			alert("Please complete the address.");
		}
		return false;
	}
	if (trim(form.input11.value) == "") {
		alert("Please enter the hours/days of business.");
		return false;
	}
	if (trim(form.input12.value) == "") {
		alert("Please enter the business phone.");
		return false;
	}
	if (trim(form.input13.value) == "") {
		alert("Please enter the web site.");
		return false;
	}
	if (trim(form.input13.value)) {
		if (!trim(form.input13.value).match(/^https?:\/\//)) {
			alert("Please make sure to include \"http://\" at the beginning of the web site address, or leave the field empty.");
			return false;
		}
	}
	if (trim(form.input13.value).match(/^https?:\/\/$/)) {
		alert("Please enter the web site.");
		return false;
	}
	if (trim(form.input14.value) == "") {
		alert("Please enter the date of opening.");
		return false;
	}
	if (trim(form.input15.value) == "") {
		alert("Please enter the number of employees.");
		return false;
	}
	if (!(trim(form.input15.value)).match(/^\d+$/)) {
		alert("Please enter a valid number for the number of employees.");
		return false;
	}
	
	if (trim(form.input16.value) == "" && trim(form.input17.value) != "" ||
		trim(form.input16.value) != "" && trim(form.input17.value) == "") {
		alert("If this is a merger or a new name, please enter both the effective date and the changes in service or product.");
		return false;
	}
	
	//form.Submit.disabled = true;
	return true;
}
	
/* Trim whitespace before and after text. */
/*        Version December 3, 2006        */
function trim(sString) {
   
   if (sString == null)
      return "";
   
   return sString.replace(/^\s*|\s*$/g,"");
   
}

function enable_A_if_B_empty(a, b) {
	if (b.value == "") {
		a.disabled = false;
	} else {
		a.disabled = true;
	}
}