Login field validator
Why not add some JSDoc to your code:

/**
*@constructor
*@param {Array} txtbox - An array of whatever
*@returns {Validator}
*/
function Validator(txtbox) {
    /**
    *@private
    */
    this.txtbox = txtbox;
}

var validator = new Validator([ "username", "password"]);

/**
*@public
*@memberOf Validator.prototype
*@param {Form} form - The form holding the login information
*/
Validator.prototype.validate = function(form) {
    for(var i = 0, l=this.txtbox.length; i &lt; l; i++) {
        var status = document.getElementById("status-msg");
        if (form[this.txtbox[i]].value == 0) {
            status.innerHTML="The " + form[this.txtbox[i]].name + " is empty";
            status.style.display = "inline-block"
            status.className = "error";
            return false;
        }
        else {
             status.innerHTML="Login successful";
            status.style.display = "inline-block"
             status.className = "success";
        }
    }
}

function runValidate(form) {
    validator.validate(form);
}