/**
 * @author cnguyen
 */
function checkforgot() {
    var bRet = true;
    var uname = jq('#username').val().trim();
    var email = jq('#email').val().trim();

    if (uname == '' && email == '') {
        controllerMessagePanel.printMessage({
            message:'Attention',
            details:'Either a username or email address is required.',
            type:'error'
        });
        bRet = false;
    }
    return bRet;
}//end checkforgot()

function checkreset() {
    var npw = jq('#npw').val().trim();
    var cpw = jq('#cpw').val().trim();
    var pattern = /^[a-zA-Z1-9_-]{1}[a-zA-Z0-9_-]{5,}$/;
    
    if(npw == '' && cpw == '') {
        controllerMessagePanel.printMessage({
            message:'Attention',
            details:'Please enter your new password and confirmation of your new password.',
            type:'error'
        });
        return false;
    } else if(npw != cpw) {
        controllerMessagePanel.printMessage({
            message:'Attention',
            details:'Your confirmation password does not match your new password.',
            type:'error'
        });
        return false;
    }
    
    var test = pattern.test(npw);
    if(!test) {
        controllerMessagePanel.printMessage({
            message:'Invalid password',
            details:'Passwords must be at least 6 characters long. They can only contain the characters a-z, A-Z, 0-9, -, _, contain no spaces, and cannot start with a zero.',
            type:'error'
        });
        return false;
    }
    
    return true;
}//end checkreset()

