function validateOnSubmit(theForm) {
	var elem;
	var errs=0;

	// execute all element validations in reverse order, so focus gets
	// set to the first one in error.
	if (!validatePresent (theForm.NAME, 'name_error')) errs += 1;
	if (!validatePresent (theForm.TELEPHONE, 'telephone_error')) errs += 1;
	if (!validatePresent (theForm.COUNTRY, 'country_error')) errs += 1;
	if (!validatePresent (theForm.ZIPCODE, 'zipcode_error')) errs += 1;
	if (!validatePresent (theForm.CITY, 'city_error')) errs += 1;
	if (!validatePresent (theForm.STREET_ADDRESS, 'address_error')) errs += 1;
	if (!validateEmail(theForm.EMAIL_ADDRESS, 'email_error', true)) errs += 1;	<!-- field IDs, NOT names -->
		
	if (errs>=1)  alert('There are fields which need correction before sending');

	return (errs==0);
	};
