/* Validate Portada Spots Form */
function validateAccount(theform) {

    reAccount = new RegExp(/^[-_a-zA-Z0-9\[\]]+$/);
    if (!reAccount.test(theform.username.value))
    {
       alert("El Nombre de Usuario posee caracteres inválidos");
       return false;
    }

    reAccount2 = new RegExp(/^[-_]+.*$/);
    if (reAccount2.test(theform.username.value))
    {
       alert("El Nombre de Usuario no puede comenzar con los caracteres - o _");
       return false;
    }


    if ((theform.username.value.length <= 0) || 
        (theform.password.value.length <= 0) ||
        (theform.email.value.length <= 0))
    {
       alert("Debe completar todos los campos.");
       return false;
    }

    if (theform.username.value.length > 15) {
		alert("El nombre de la cuenta debe tener como máximo 15 caracteres.");
		return false; }

	if (theform.password.value.length > 12) {
 		alert("El password de la cuenta debe tener como máximo 12 caracteres.");
		return false; }

	if (theform.question.value.length <= 0) {
 		alert("Por favor ingrese una pregunta secreta.");
		return false; }

	if (theform.answer.value.length <= 0) {
 		alert("Debe ingresar una respuesta que recordará para su pregunta secreta.");
		return false; }
   
	return(true);
}
