function Focus(control) {

  control.focus();

  control.select();

}



function IsEmailCorrect(email) {

  return email.match(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/)!=null;

}



function IsEmpty(pole) {

  if (pole=='') 

  	return true

	else

	return false

}






//#################################################################
function contact()

{

if (IsEmpty(document.getElementById('name').value)) {
    alert('Graag uw naam invullen.');
    Focus(document.getElementById('name'));
    return false;
  }

if (!IsEmailCorrect(document.getElementById('email').value)) {
	alert('Graag uw e-mail invullen.');
	Focus(document.getElementById('email'));
	return false;
}


if (IsEmpty(document.getElementById('subject').value)) {
    alert('Graag een onderwerp title invullen titel.');
    Focus(document.getElementById('subject'));
    return false;
  }

if (IsEmpty(document.getElementById('text').value)) {
    alert('Graag uw bericht invullen.');
    Focus(document.getElementById('text'));
    return false;
  }

return true;

}

//##################################################################

function res()

{

if (IsEmpty(document.getElementById('input2').value)) {
    alert('Graag uw voorletters invullen.');
    Focus(document.getElementById('input2'));
    return false;
  }

if (IsEmpty(document.getElementById('input3').value)) {
    alert('Graag uw achternaam invullen.');
    Focus(document.getElementById('input3'));
    return false;
  }

if (IsEmpty(document.getElementById('input4').value)) {
    alert('Graag uw telefoonnummer invullen.');
    Focus(document.getElementById('input4'));
    return false;
  }

if (!IsEmailCorrect(document.getElementById('input5').value)) {
	alert('Graag uw e-mail invullen.');
	Focus(document.getElementById('input5'));
	return false;
}

if (IsEmpty(document.getElementById('input8').value)) {
    alert('Graag uw tijdstip invullen.');
    Focus(document.getElementById('input8'));
    return false;
  }

return true;

}

//####################################################################

function vac()

{

if (IsEmpty(document.getElementById('input1').value)) {
    alert('Graag uw Voornaam invullen.');
    Focus(document.getElementById('input1'));
    return false;
  }

if (IsEmpty(document.getElementById('input2').value)) {
    alert('Graag uw Achternaam invullen.');
    Focus(document.getElementById('input2'));
    return false;
  }

if (IsEmpty(document.getElementById('input3').value)) {
    alert('Graag uw Adres invullen.');
    Focus(document.getElementById('input3'));
    return false;
  }

if (IsEmpty(document.getElementById('input5').value)) {
    alert('Graag uw Woonplaats invullen.');
    Focus(document.getElementById('input5'));
    return false;
  }

if (IsEmpty(document.getElementById('input6').value)) {
    alert('Graag uw Telefoonnummer invullen.');
    Focus(document.getElementById('input6'));
    return false;
  }

if (IsEmpty(document.getElementById('input7').value)) {
    alert('Graag uw Geboortedatum invullen.');
    Focus(document.getElementById('input7'));
    return false;
  }
  
if (IsEmpty(document.getElementById('input9').value)) {
    alert('Graag uw functie invullen.');
    Focus(document.getElementById('input9'));
    return false;
  }



return true;

}




