   function Validar(form){
    if (form.nombre.value == "")  { alert("Introduce tu nombre completo"); form.nombre.focus(); return; }
	if (form.email.value == "")  { alert("Introduce tu e-mail"); form.email.focus(); return; } 
	if (form.mensaje.value == "")  { alert("Introduce un mensaje"); form.mensaje.focus(); return; }	
	
	
invalidChars = " /:,;"
email=form.email.value

if (email == "") {                                              // cannot be empty
alert("Introduce tu e-mail correctamente, ejemplo: info@dominio.com");
form.email.focus();
return false;
}
for (i=0; i<invalidChars.length; i++) { // does it contain any invalid characters?
badChar = invalidChars.charAt(i)
if (email.indexOf(badChar,0) > -1) {
alert("Introduce tu e-mail correctamente, ejemplo: info@dominio.com");
form.email.focus();
return false;
}
}
atPos = email.indexOf("@",1)                    // there must be one "@" symbol
if (atPos == -1) {
alert("Introduce tu e-mail correctamente, ejemplo: info@dominio.com");
form.email.focus();
return false;
}
if (email.indexOf("@",atPos+1) != -1) { // and only one "@" symbol
alert("Introduce tu e-mail correctamente, ejemplo: info@dominio.com");
form.email.focus();
return false;
}
periodPos = email.indexOf(".",atPos)
if (periodPos == -1) {                                  // and at least one "." after the "@"
alert("Introduce tu e-mail correctamente, ejemplo: info@dominio.com");
form.email.focus();
return false;
}
if (periodPos+3 > email.length) {               // must be at least 2 characters after the "."
alert("Introduce tu e-mail correctamente, ejemplo: info@dominio.com");
form.email.focus();
return false;
}

form.submit();
}