
function hutsik(izena, koment, mezua) {
izena = document.forms[0].nombre.value 
asuntua = document.forms[0].asunto.value
mezua = document.forms[0].mensaje.value
    if (izena == "" || izena == null || !isNaN(izena) || izena.charAt(0) == ' ')
    {
    alert("\"nombre\" es un campo obligatorio.\nPor favor introdúzca el nombre.")
    return false;
    }
    if (asuntua == "" || asuntua == null || asuntua.charAt(0) == ' ')
    {
    alert("\"asunto\" es un campo obligatorio.\nPor favor introdúzca el asunto.")
    return false;
    }
    if (mezua == "" || mezua == null || mezua.charAt(0) == ' ')
    {
    alert("\"mensaje\" es un campo obligatorio.\nPor favor escriba el mensaje.")
    return false;
    }
    return true;
}

function emailOK(emilio){
  kodigoa = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  emilio = document.forms[0].email.value;
  
    if (emilio.search(kodigoa) == -1) 
   {
      alert('La dirección de e-mail no es correcta.\nPor favor, introdúzcala de nuevo.');
      return false;
    } 
    return true; 
}

//function aukera(nori) {
//nori = document.forms[0].para.value
//	   	if(document.forms[0].info.checked) {
//		return true
//		}
//		else{
//		nori = document.forms[0].eraiki.value
//		}
//	return false
//}


function kontrolatu(form){
if (hutsik(form.nombre)){
  if (emailOK(form.email)){
    if (hutsik(form.asunto)){
		if (hutsik(form.mensaje)){
			if (aukera(form.para)){
		  return true;
		}
	  }
	}
  }
}
return false;
}
