
function form_onsubmit(theform) {
	if(theform.Companyname.value==""){
		alert("Company name is required.");
		theform.Companyname.focus();
		return false;
		}
	if(theform.Companyaddress1.value==""){
		alert("Address is required.");
		theform.Companyaddress1.focus();
		return false;
		}
	if(theform.Companycity.value==""){
		alert("City is required.");
		theform.Companycity.focus();
		return false;
		}
	if(theform.CompanyCountry.value==""){
		alert("Country is required.");
		theform.CompanyCountry.focus();
		return false;
		}

	if(theform.Companystate.value==""){
		alert("State/Province is required.");
		theform.Companystate.focus();
		return false;
		}

	if(theform.Companyzipcode.value==""){
		alert("Zip/Postal code is required.");
		theform.Companyzipcode.focus();
		return false;
		}

	if(!validateNumberEntry(theform.CompanyFax)){
		return false
	}
	
	if(theform.CompanyEmail.value==""){
		alert("Company E-mail Address is required.");
		theform.CompanyEmail.focus();
		return false;
		}
	else{
		address=theform.CompanyEmail.value
		if(address.length<5 || address.indexOf('@')<0 || address.indexOf('.')<0 ){
			alert("E-mail format is incorrect.");
			theform.CompanyEmail.focus();
			return false;
			}
	}	

//	if(theform.WebURL.value==""){
//		alert("Web Site URL is required.");
		//theform.WebURL.focus();
		//return false;
		//}

	if(theform.ContactFirstName.value==""){
		alert("Contact's First Name required");
		theform.ContactFirstName.focus();
		return false;
		}

	if(theform.ContactLastName.value==""){
		alert("Contact's Last Name required");
		theform.ContactLastName.focus();
		return false;
		}
	if(!validateNumberEntry(theform.ContactFaxNumber)){
		return false
	}

	if(theform.ContactEmailAddress.value==""){
		alert("Contact's E-mail Address required.");
		theform.ContactEmailAddress.focus();
		return false;
		}
	return true;		
}

