function userreg_valid(theForm)
{
 if (theForm.Login.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Nombre de Usuario\" ");
    theForm.Login.focus();
    return (false);
  }
  if (theForm.Login.value.length < 4 || theForm.Login.value.length > 15)
  {
    alert("El campo \"Nombre de Usuario\" debe tener una longitud entre 4 y 15 caracteres.");
    theForm.Login.focus();
    return (false);
  }
  if ((theForm.Login.value.indexOf(" ")!=-1)) {
	alert("Lo siento, pero el \"Nombre de Usuario\" no debe contener espacios en blanco");
	theForm.Login.select();
	theForm.Login.focus();
	return (false);
  }
  if (theForm.Pass.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Contraseņa\" ");
    theForm.Pass.focus();
    return (false);
  }
  if (theForm.Pass.value.length < 6 || theForm.Pass.value.length > 10)
  {
    alert("El campo \"Contraseņa\" debe tener una longitud entre 6 y 10 caracteres.");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Pass.value != theForm.Pass2.value)
  {
    alert("La Contraseņa no coincide al confirmarla ");
    theForm.Pass.focus();
    return (false);
  }
  if (theForm.Pregunta.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Pregunta Secreta\" ");
    theForm.Pregunta.focus();
    return (false);
  }
  if (theForm.Respuesta.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Respuesta\" ");
    theForm.Respuesta.focus();
    return (false);
  }
  if (theForm.email.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Email Alterno\" ");
    theForm.email.focus();
    return (false);
  }
  if (theForm.email.value.length > 50)
  {
    alert("Inserta una cadena menor de 50 caracteres en el campo\"Email Alterno\".");
    theForm.email.focus();
    return (false);
  }
  
  // Email valitacion
	if(theForm.email.value!="")
		{
			 if ((theForm.email.value.indexOf(" ")!=-1)) {
	   	    	alert("Lo siento, pero el Email Alterno no debe contener espacios en blanco");
				theForm.email.select();
				theForm.email.focus();
			    return false;
			    }
		 	if ((theForm.email.value.indexOf("@")==-1)) {
				 alert("Lo siento, pero el Email Alterno debe contener el caracter @");
			   	 theForm.email.select();
			   	 theForm.email.focus();
			  	 return false;
			 	}
		 	if (theForm.email.value.indexOf("@")<2) {
			   	 alert("Lo siento, pero esta es una direccion invalida"+ "\n"+ "Por favor verifica el texto antes de '@'");
				 theForm.email.select();
				 theForm.email.focus();
				 return false ;
                 }	
		 	 if ((theForm.email.value.indexOf(".",theForm.email.value.indexOf("@")) - theForm.email.value.indexOf("@")) < 2 ) {
				 	alert("Lo siento, pero esta es una direccion invalida" + "\n"+ "el dominio no esta especificado")
				    theForm.email.select();
				    theForm.email.focus();
				    return false;
					}
 			if ((theForm.email.value.length - theForm.email.value.indexOf(".",theForm.email.value.indexOf("@"))) < 2 ) {
				 	alert("Lo siento, pero esta es una direccion invalida")
			 		theForm.email.select();
					theForm.email.focus();
				 	return false;
				    }
			if (theForm.email.value.charAt(theForm.email.value.length-1) == "." ) {
		 			alert("Lo siento, pero esta es una direccion invalida " + "\n"+ "el punto no puede ser el ultimo caracter")
				    theForm.email.select();
				    theForm.email.focus();
				    return false;
				   }
		 }
  
  if (theForm.correo.value == "")
  {
    alert("Por favor Indica si deseas una cuenta de Correo en Arcelia.Net ");
    theForm.correo.focus();
    return (false);
  }
  if (theForm.Name.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Nombre\" ");
    theForm.Name.focus();
    return (false);
  }
  if (theForm.Ape.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Apellidos\" ");
    theForm.Ape.focus();
    return (false);
  }
  return (true);
}
function OtroMail(form, valor){
  form.Login.value = valor;
}
function Login_valid(theForm){
  if (theForm.Login.value == "")
  {
    alert("Por favor Inserte un Valor para el campo \"Nombre de Usuario\" ");
    theForm.Login.focus();
    return (false);
  }
  if ((theForm.Login.value.indexOf(" ")!=-1)) {
	alert("Lo siento, pero el \"Nombre de Usuario\" no debe contener espacios en blanco");
	theForm.Login.select();
	theForm.Login.focus();
	return (false);
  }
}

