<!--
var recuento=0,pedrito=0;

////////////////////////////////////////////////////////////////////////////////////
// comprobar campo text, se le pasa el valor del campo y la descripcion del alert,
////////////////////////////////////////////////////////////////////////////////////

function comprova_camp(nomcamp,descript,camp,form) {
var t;
var vacio=true;

for (t=0;t<nomcamp.value.length;t++) {
	if (nomcamp.value.charAt(t)!=' ') {vacio=false;}}

	if (nomcamp.length <= 0 || vacio)
       {
    
        return(1);
      }
       return(0);
}

function comprova_mail(text1,form){

var count=0;
for (t=0;t<text1.length;t++) {
	
	if ( (text1.charAt(t) =='ñ') || (text1.charAt(t) =='+') || (text1.charAt(t) =='-') || (text1.charAt(t) =='.') || (text1.charAt(t) =='_') || (text1.charAt(t) =='@') || (text1.charAt(t) >='a' && text1.charAt(t) <='z') || (text1.charAt(t) >='A' && text1.charAt(t) <='Z') || (text1.charAt(t) >='0' && text1.charAt(t) <='9') ) 
	{ 
	if (text1.charAt(t) !='@' && text1.charAt(t) !='.' && count==0) count=1; 
	if (text1.charAt(t) =='@' && count==1) count=2; 
	if (text1.charAt(t) !='@' && text1.charAt(t) !='.' && count==2) count=3; 
	if (text1.charAt(t) =='.' && count==3 ) count=4; 
	if (text1.charAt(t) !='@' && text1.charAt(t) !='.' && count==5) count=6; 
	if (text1.charAt(t) !='@' && text1.charAt(t) !='.' && count==4) count=5; 
	}
	else {	
	form.email.value="";

	;return(1);
	}

}

if (count!=6) {
	form.email.value="";
	return(1);
	}

return(0);
}


function Comprueba(form) {
form.camp0.value=comprova_camp(form.nombre,"Falta intoducir el nombre"," nombre ",form);
form.camp1.value=comprova_camp(form.nombre2,"Falta intoducir el nombre de tu amigo"," nombre2 ",form);
form.camp2.value=comprova_camp(form.mensaje,"Falta intoducir el mensaje"," mensaje ",form);
form.camp3.value=comprova_mail(form.email.value,form);
form.camp4.value=comprova_mail(form.email2.value,form);
for (t=0;t<5;t++) {
objeto="form.camp"+t+".value";
pedrito=eval(objeto);
recuento=recuento+pedrito;
}

if (recuento==0)
{
	form.action="./recomiendanos_run.cfm";
	form.submit();
	}
else {
	alert("Algunos campos del formulario son incorrectos");
	form.action="./recomiendanos.cfm";
	form.submit();
}
}
-->