function analiza(cadena,cSpecials,dosseguidos){ var i=0; var Existextrano=false; reservadas="ABUSE@,POSTMASTER@,NOSPAM@,@ANTISPAM.,HOSTMASTER@,ROOT@,NOC@,SECURITY@,ANTISPAM@,IPADMIN@"; if(reservadas.indexOf(cadena)!=-1){ return false; } for(i=0;i57 && datoACode<65) || datoACode>90){ if(cSpecials.indexOf(datoA)==-1){ return false; } else{ if(Existextrano){ if(!dosseguidos){ return false; } } Existextrano=true; } } else{ Existextrano=false; } } return true; } function longitudPartes(matrizDom){ dominiosNo="COM,NET,ORG,INT"; noDominios="ARPA,MIL"; var i=0; var ExistDomi=false; var reexp=/\d/; for(i=0;i2){ return false; } if(dominiosNo.indexOf(matrizDom[i])!=-1 && matrizDom[i].length==3){ if(ExistDomi){ return false; } ExistDomi=true; } if(i==matrizDom.length-1 || (i==matrizDom.length-2 && matrizDom.length>2)){ if(matrizDom[i].length<2){ return false; } } if(i==matrizDom.length-1){ if(matrizDom[i].match(reexp) || matrizDom[i].length>6){ return false; } } } return true; } function verificamail(campo,mensaje){ /*expresion regular*/ var mailexp=/.[^@]*@[\w]*[\w\.-][\w]*\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]/; Strmail=campo.value.toUpperCase(); mailDepurado=Strmail.match(mailexp); if(mailDepurado!=Strmail){ alert(mensaje);campo.focus();return false; } partesMail=Strmail.split('@'); if(!analiza(partesMail[0],".,-,_,!,#,$,%,&,',+,/,=,?,`,{,},|,~",true)){ alert(mensaje);campo.focus();return false; } segPartMail=partesMail[1].split('.'); if(!longitudPartes(segPartMail)){ alert(mensaje);campo.focus();return false; } if(!analiza("@"+segPartMail[0]+".","@,.,-",false)){ alert(mensaje);campo.focus();return false; } return true; } /*Devuelve false cuando el campo esta vacio*/ function verificatxt(campo,mensaje){ if(!mensaje){ alerta="El campo "+campo.name+" no puede estar vacio"; } else{ alerta=mensaje; } retorno=true; longitud=campo.value.length; if(longitud<1){alert(alerta);campo.focus();retorno=false;} return retorno; } /*Si en un formulario de checkboxs no hay ninguno marcado devuelve false*/ function verificacheck(formul){ retorno=false; var i=0; for(i=0;imaximo){alert("Has superado el maximo de caracteres permitido");campo.focus();retorno=false;} if(longitud