function ValidarForm(){
	var todook = true;
	document.getElementById("nombre").style.color= "black";
	document.getElementById("mensaje").style.color= "black";
	document.getElementById("mail").style.color= "black";
	
	if(document.getElementById("nombre").value == "" || document.getElementById("nombre").value.length < 4 || document.getElementById("nombre").value == "Por favor complete este campo con su nombre"){
		document.getElementById("nombre").style.color= "#999";
		document.getElementById("nombre").value = "Por favor complete este campo con su nombre";
		todook = false;
	}
	
	if(document.getElementById("mensaje").value == "" || document.getElementById("mensaje").value.length < 4 || document.getElementById("mensaje").value == "Por favor complete este campo con un mensaje"){
		document.getElementById("mensaje").style.color= "#999";
		document.getElementById("mensaje").value = "Por favor complete este campo con un mensaje";
		todook = false;
	}
	
	str = document.getElementById("mail").value;
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(at)==-1){
		ErrorEmail();
		todook = false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		ErrorEmail();
		todook = false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		ErrorEmail();
		todook = false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		ErrorEmail();
		todook = false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		ErrorEmail();
		todook = false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		ErrorEmail();
		todook = false;
	 }
	
	 if (str.indexOf(" ")!=-1){
		ErrorEmail();
		todook = false;
	 }
	
	return todook;
}

function ErrorEmail(){
	document.getElementById("mail").style.color= "#999";
	document.getElementById("mail").value = "E-mail no valido";
}