var email,regexEmail,datos,suma;
function error(n){
	document.getElementById('check'+n).src="../img/checkError.gif";
	document.getElementById('check'+n).style.display = "";
	document.getElementById(n.toLowerCase()).style.color = "#FF7F7F";
	document.getElementById(n.toLowerCase()).style.borderColor = "#FF7F7F";
}
function bien(n){
	document.getElementById('check'+n).src="../img/check.gif";
	document.getElementById('check'+n).style.display = "";
	document.getElementById(n.toLowerCase()).style.color = "#52BA75";
	document.getElementById(n.toLowerCase()).style.borderColor = "#52BA75";	
	suma ++;	
}
function validaEmail(){
	email = document.getElementById("email").value;
	regexEmail = "^([0-9a-zA-Z\xF1]+(?:[._][0-9a-zA-Z\xF1]+)*)\@([0-9a-zA-Z\xF1]+(?:[._-][0-9a-zA-Z]+)*(?:[.][0-9a-zA-Z]{2,3}))$";
	if (email.match(regexEmail)!=null){
		bien('email');
	}else{
		error('email');
	}
}

function validaRecomienda(){
	email = document.getElementById('form').email.value;
	suma = 0; 
	/*Validacion, 1 = ok*/
	validaEmail();
	if (suma == 1){//Los campos que valida son 1 si no error.
			datos = "email="+email;
			document.getElementById("form").action = "./?"+datos;
			document.getElementById("form").submit();
	}else{
		alert('Compruebe los puntos en Rojo');
	suma=0;
	}	
}