function text_onFocus(obj, value) {
   obj.value = trim(obj.value);
   obj.style.color = '#000000';
   if(obj.value == value) {
      obj.value = '';
   }
}

function text_onBlur(obj, value) {
   obj.value = trim(obj.value);
   if(obj.value == '' || obj.value == value) {
      obj.style.color = '#B5B5B5';
      obj.value = value;
   } else {
      obj.style.color = '#000000';
   }
}

function  txtUsuario_onKeyPress(ev) {
   var e = window.event || ev;
   if(e.keyCode == 13) {
      document.getElementById('txtSenha').focus();
   }
}

function  txtSenha_onKeyPress(ev) {
   var e = window.event || ev
   if(e.keyCode == 13) {
      document.getElementById('txtUsuario').focus();
      frmLogin_onSubmit(document.getElementById('frmLogin'));
   }
}

function frmLogin_onSubmit(frm) {
   frm.txtUsuario.value = trim(frm.txtUsuario.value);
   if(frm.txtUsuario.value == 'Usuário' || frm.txtUsuario.value == '') {
      alert('Por favor, informe o usuário para fazer o logon.');
      frm.txtUsuario.focus();
      return false;
   }

   frm.txtSenha.value = trim(frm.txtSenha.value);
   if(frm.txtSenha.value == 'Senha' || frm.txtSenha.value == '') {
      alert('Por favor, informe a senha para fazer o logon.');
      frm.txtSenha.focus();
      return false;
   }
   frm.submit();
}