// 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.cwebform.Contactname, 'inf_contactname')) errs += 1; 
    if (!validateBaddress (document.forms.cwebform.Baddress,  'inf_baddress')) errs += 1; 
	if (!validateCity (document.forms.cwebform.City,  'inf_city')) errs += 1;
	if (!validateState (document.forms.cwebform.State,  'inf_state')) errs += 1;
	if (!validateCountry (document.forms.cwebform.Country,  'inf_country')) errs += 1;
	if (!validateTelnr (document.forms.cwebform.Telnr,  'inf_telnr', true)) errs += 1;
	if (!validateEmail (document.forms.cwebform.Email,  'inf_email', true)) errs += 1;
	if (!validateConame (document.forms.cwebform.Coname,  'inf_coname', true)) errs += 1;
	if (!validateSeo (document.forms.cwebform.Seo,  'inf_seo', true)) errs += 1;
    if (!validateAudience (document.forms.cwebform.Audience,  'inf_audience', true)) errs += 1;
    if (!validateProvform (document.forms.cwebform.Provform,  'inf_provform', true)) errs += 1;
	if (!validateExpectations (document.forms.cwebform.Expectations,  'inf_expectations', true)) errs += 1;
	if (!validateEmphasize (document.forms.cwebform.Emphasize,  'inf_emphasize', true)) errs += 1;				
	if (!validateHavlogo (document.forms.cwebform.Havlogo,  'inf_havlogo', true)) errs += 1;
	if (!validateKeywords (document.forms.cwebform.Keywords,  'inf_keywords', true)) errs += 1;
	if (!validateScreensize (document.forms.cwebform.Screensize,  'inf_screensize', true)) errs += 1;	
	if (!validateWrittencont (document.forms.cwebform.Writtencont,  'inf_writtencont', true)) errs += 1;
	if (!validateMainpages (document.forms.cwebform.Mainpages,  'inf_mainpages', true)) errs += 1;
	if (!validateImages (document.forms.cwebform.Images,  'inf_images', true)) errs += 1;
    if (!validateAboutus (document.forms.cwebform.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);
};
