
function removeChar(s,x)
{var tmp=''
for(i=0;i<s.length;i++)
{var c=s.charAt(i)
if(c!=x)tmp=tmp+c}
return tmp}
function isBlankSpaces(s)
{var tmp=''
for(i=0;i<s.length;i++)
{var c=s.charAt(i)
if(c!=' ')return false;}
return true;}
function FIsValidEmail(email){var i;if(email.length<4)
return false;else if(email.lastIndexOf('\'')!=-1)
return false;else if((i=email.lastIndexOf('@'))==-1)
return false;else{var tail=email.substring(i+1,email.length);if(tail.length<3)
return false;else if((i=tail.lastIndexOf('.'))==-1)
return false;else{var tailend=tail.substring(i+1,tail.length);if(tailend.length==0)
return false;}}
return true;}
function validate()
{var f=document.frmTheForm
var strEmail=""+f.email.value;var strFirstName=""+f.firstName.value;var strLastName=""+f.lastName.value;var sOut=""
if((strFirstName=="")||(isBlankSpaces(strFirstName)))
sOut+="\n   * "+"Escriba su nombre"
if((strLastName=="")||(isBlankSpaces(strLastName)))
sOut+="\n   * "+"Escriba sus apellidos"
if(f.connection.selectedIndex==0)
sOut+="\n   * "+"Especifique su tipo de conexión"
if(!FIsValidEmail(strEmail))
sOut+="\n   * "+"Escriba una dirección de correo electrónico válida"
var sDesc=""+f.description.value
sDesc=removeChar(sDesc,' ')
if(sDesc=="")
sOut+="\n   * "+"Escriba una descripción detalla del problema"
var sTemp=""+f.description.value
if(sTemp.length>2500)
sOut+="\n   * "+"Reduzca la descripción del problema a 2.500 caracteres o menos."
if(sOut!="")
{sOut="El formulario está incompleto. Rellene los cambios enumerados a continuación y vuelva a enviarlo."+sOut
alert(sOut)
return false}
return true}