// JavaScript Document
function outputYear() {
  today = new Date();
  theYear = today.getFullYear();
  document.writeln(theYear);
}

function checkQuoteFields() {
	var objectRef = document.quote;
	var submitForm = true;
	var missingFieldList = "The following field(s) are missing." + "\n";
	missingFieldList = missingFieldList + "Please fill them out and resubmit the form." + "\n" + "\n";
	if (objectRef.name.value == "" && objectRef.business_name.value == "") {
	 	missingFieldList = missingFieldList + "- Name or Business Name" + "\n";
		submitForm = false;
	}	
	if (objectRef.address.value == "") {
	 	missingFieldList = missingFieldList + "- Address" + "\n";
		submitForm = false;
	}
	if (objectRef.city.value == "") {
	 	missingFieldList = missingFieldList + "- City" + "\n";
		submitForm = false;
	}
	if (objectRef.phone.value == "") {
	 	missingFieldList = missingFieldList + "- Phone" + "\n";
		submitForm = false;
	}
	if (submitForm) {
		return true; 
	} else {
		alert(missingFieldList);
		return false;
	}
}
