//for the Focus script...
window.onload = initFormFieldFocus;
function initFormFieldFocus()
{
	focusField(document.getElementById("name"));

	return true;
}

// Only script specific to this form goes here.
// General-purpose routines are in a separate file.
  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 (!validateTelnr  (document.forms.ContactForm.telnr, 'inf_telnr', true)) errs += 1; 
    if (!validateEmail  (document.forms.ContactForm.email, 'inf_email', true)) errs += 1; 
    if (!validatePresent(document.forms.ContactForm.name,  'inf_name'))        errs += 1; 

    if (errs>1)  {
    alert('There are field(s) which need correction before sending');
    return false;
    }

    else if (errs==1) {
      alert('There is a field which needs correction before sending');
      return false;
     }
    
    else {
    	document.form.ContactForm.Submit.disabled=true;
    	document.form.ContactForm.Submit.value = 'Thank You!';
    	
    	return true;
     }
 
  }

	function display(obj, id1) {
		txt = obj.options[obj.selectedIndex].value;
		document.getElementById(id1).style.display = 'none';
		if ( txt.match(id1) ) {
			document.getElementById(id1).style.display = 'block';
		}
	}

