function validar(form1)
{

if (form1.name.value.length < 2)
{
 alert("Inserte el nombre");
 form1.name.focus();
 return (false);
}

//var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ\" + "abcdefghijklmnñopqrstuvwxyzáéíóú\";
var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ" + "abcdefghijklmnñopqrstuvwxyzáéíóú";
var checkStr = form1.name.value;
var allValid = true;
var uword = hex_md5(document.getElementById('uword').value);
for (i = 0; i < checkStr.length; i++)
{
 ch = checkStr.charAt(i);
 for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break;
 if (j == checkOK.length) 
  {
   allValid = false;
   break;
  }
}

if (!allValid)
{
 alert('inserte el nombre');
 form1.name.focus();
 return (false);
}

if ((form1.email.value.indexOf ('@', 0) == -1) ||
   (form1.email.value.length < 9) || 
   (form1.email.value.indexOf ('.', 0)== -1))
{
 alert("inserte el email");
 form1.email.focus();
 return (false);
}

if (form1.message.value.length < 7)
{
 alert("inserte el mensaje");
 form1.message.focus();
 return (false);
}

if (uword==cword[anum-1])
{
 return true;
}
else 
{
 alert("inserte el código de la imagen");
 document.getElementById('uword').focus();
 return false;
}



return (true);

}

