window.onload = init;

function init() {
/*	document.getElementById("contactName") = validate_required;
	
	     document.getElementById("submit_btn").onclick = verzend;
                       }

          function verzend()
               {
                   if (confirm("Druk op OK als u het formulier wilt versturen."))
	           document.frmContact.submit();
                       else
	          alert("Het formulier werd nog niet verstuurd.","");*/
	
}
///////////////////////////////////////////////////////////////

function checkEmail(field,msg)
{
with (field)
{
isApenstaart = value.indexOf("@");
isPunt = value.lastIndexOf(".");
if (isApenstaart<1||isPunt-isApenstaart<2) 
  {alert(msg);return false;}
else {return true;}
}
}
///////////////////////////////////////////////////////////////
function checkName(field,msg)
{
with (field)
{
if (value==null||value=="")
  {alert(msg);return false;}
else {return true}
}
}

///////////////////////////////////////////////////////////////
function checkNumber(field,msg)
{
with (field)
{
if (value==null||value==""||!value.toString().match(/^[-]?\d*\.?\d*$/))

  {alert(msg);return false;}
else {return true}
}
}

/*
function isNumeric(value) {
  if (value != null && !value.toString().match(/^[-]?\d*\.?\d*$/)) return false;
  return true;
}
*/
///////////////////////////////////////////////////////////////
function validForm(frmContact)
{
with (frmContact)
{
if (checkName(contactName,"vul uw naam in")==false)
	{
	contactName.focus();return false;
	} 

else if (checkEmail(contactEmail,"het lijkt erop dat je een ongeldig email adres hebt ingevoerd")==false)
	{
		contactEmail.focus();return false;
	}
	
	else if (checkNumber(nrChoice,"je gaf geen nummer in")==false)
	{
		nrChoice.focus();return false;
	}
}
}
/////////////////////////////////////////////////



