function buscarUsu(b, a){
  const parametros = new FormData();
  parametros.append("txtNom", document.formUsuarios.txtNom.value);

  $.ajax({
    data:  parametros,
    url:   "busUsuarios/data.php",
    type:  "post",
    contentType: false,
    processData: false,
    beforeSend: function () {
      alLoad("Consultando...")
    },
    success: function (jsonPhp) {
      const jsonJS = JSON.parse(jsonPhp);

      tblClear("tblUsu");
      jsonJS.usuarios.forEach(function(i){
        addRowUsu(i.usu_cod, i.usu_nom, i.usu_pue);
      });

      $("#tblUsu tbody tr").dblclick(function() {
        selecUsu(a, $(this));
      });

      $("#tblUsu tbody #btnSelecUsu").click(function() {
        selecUsu(a, $(this).parents("tr"));
      });

      alClose();
    }
  });
}

function addRowUsu(corr, nom, pue) {
  const markup =  "<tr>"
                    +"<td>"+corr+"</td>"
                    +"<td>"+nom+"</td>"
                    +"<td>"+pue+"</td>"
                    +"<td><button class='btn btn-sm btn-warning badge' id='btnSelecUsu'>"+textBtnSelec+"</button></td>"
                  +"</tr>";
  $("#tblUsu tbody").append(markup);
}

function selecUsu(a, tr) {
  if (inputUsu == "txtCod") {
    document.thisform.txtCod.value = tr.find("td:eq(0)").text();
    $("form[name='thisform'] #txtCod").trigger("change");
  } else {
    $("#"+inputUsu).val(tr.find("td:eq(0)").text());
    $("#"+inputUsu+"Nom").val(tr.find("td:eq(1)").text());
  }

  $("#pills-"+a+"-tab").click();
  $('html, body').animate( { scrollTop : 0 }, 500 );
  tblClear("tblUsu");
}