// JavaScript Document

 
 
function chequeo() {


var email= document.formu.mail.value;
if(!isEmail(email))
{
//alerta para cuando el mail no es valido
coolMessage('alert',"Por favor, introduzca un email válido");

document.formu.mail.focus()
return false;
}

if(document.formu.acepta.checked)
{
document.formu.submit()
}
else
{
coolMessage('alert',"Por favor, acepte la política de privacidad");

}


}

/*----------------------------------------------------------------------------------------------
DESCRIPTION: returns true if the string is not empty.
------------------------------------------------------------------------------------------------*/
function isRequired(str){
	return (str == null) || (str.length == 0);
}
/*----------------------------------------------------------------------------------------------
DESCRIPTION: returns true if the string is a valid email.
------------------------------------------------------------------------------------------------*/
function isEmail(str){
	if(isRequired(str)) return false;
	var re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i
	return re.test(str);
}
