// JavaScript Document
function validate(form1) {
if (form1.name.value.length < 2) {
	alert('Error in name')
	form1.name.focus();
	return (false);
}

var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ" + "abcdefghijklmnñopqrstuvwxyzáéíóú" + " ";
var checkStr = form1.name.value;
var allValid = true;
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('Error in name');
	form1.name.focus();
	return (false);
}
if ((form1.email.value.indexOf ('@', 0) == -1)||(form1.email.value.length < 9) || form1.email.value.indexOf ('.', 0)== -1 ){
	alert('Enter a valid email address');
	form1.email.focus();return (false);
}
if (form1.message.value.length < 7) {
	alert('Please enter your message');
	form1.message.focus();return (false);
}

return (true);
}
