function validate_required(field)
{
with (field)
{
if (value==null||value=="")
  {return false;}
else {return true}
}
}

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
}
}

function checkForm(thisform)
{
with (thisform)
{
if (validate_required(nimi)==false)
  {alert("Nimi on pakollinen!");nimi.focus();return false;}
if (validate_email(email,"Sähköpostiosoite tyhjä tai virheellinen!")==false)
  {email.focus();return false;}
}
}