// Only script specific to this form goes here.
// General-purpose routines are in a separate ile.
  function validateOnSubmit() {
    var elem;
    var errs=0;
    // execute all element validations in reverse order, so focus gets
    // set to the first one in error.
	if (!validateContactname (document.forms.brief.Contactname, 'inf_contactname')) errs += 1; 
    //if (!validateAge    (document.forms.demo.age,   'inf_age',  false)) errs += 1; 
    if (!validatePackage (document.forms.brief.Package, 'inf_package')) errs += 1; 
    if (!validateBaddress (document.forms.brief.Baddress,  'inf_baddress')) errs += 1; 
	if (!validateCity (document.forms.brief.City,  'inf_city')) errs += 1;
	if (!validatePcode (document.forms.brief.Pcode,  'inf_pcode')) errs += 1;
	if (!validateState (document.forms.brief.State,  'inf_state')) errs += 1;
	if (!validateCountry (document.forms.brief.Country,  'inf_country')) errs += 1;
	if (!validateTelnr (document.forms.brief.Telnr,  'inf_telnr', true)) errs += 1;
	if (!validateEmail (document.forms.brief.Email,  'inf_email', true)) errs += 1;
	if (!validateCompname (document.forms.brief.Compname,  'inf_compname')) errs += 1;
	if (!validateRelationship (document.forms.brief.Relationship,  'inf_relationship')) errs += 1;
	if (!validateAboutus (document.forms.brief.Aboutus,  'inf_aboutus')) errs += 1;
	
    if (errs>1)  alert('There are fields which need correction before sending');
    if (errs==1) alert('There is a field which needs correction before sending');
    return (errs==0);
};
