
var SELF_LOGINMSGS_USERNONEMPTY = "El nombre de usuario no puede estar en blanco.";
var SELF_LOGINMSGS_PWDNONEMPTY = "La contraseña no puede estar vacía.";

        function SELF_ValLogin() {

            with (window.document.forms['frmKWAFLogIn']) {
                if (SELF_isEmpty(KWAF_UserLogin)) {
                    alert(SELF_LOGINMSGS_USERNONEMPTY);
                    KWAF_UserLogin.focus();
                    return false;
                }

                if (SELF_isEmpty(KWAF_UserPassword)) {
                    alert(SELF_LOGINMSGS_PWDNONEMPTY);
                    KWAF_UserPassword.focus();
                    return false;
                }
                submit();
            }
        }

        function SELF_isEmpty(textForm) {
            with (window.document.forms['frmKWAFLogIn']) {
                //campo nulo
                if (textForm.value == null)
                    return true;
                //campo de longitud cero
                if (textForm.value.length == 0)
                    return true;
                else {
                    //comprueba que no se introduce una cadena de espacios en blanco
                    for (i = 0; i < textForm.value.length; i++) {
                        if (textForm.value[i] != ' ')
                            return false;
                    }
                    return true;
                }
            }
        }