function billing_n3case_grid_invoice_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_invoice" + seqRow).html();
}

function billing_n3case_grid_invoice_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_invoice" + seqRow).html(newValue);
}

function billing_n3case_grid_case_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_case" + seqRow).html();
}

function billing_n3case_grid_case_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_case" + seqRow).html(newValue);
}

function billing_n3case_grid_smit_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_smit" + seqRow).html();
}

function billing_n3case_grid_smit_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_smit" + seqRow).html(newValue);
}

function billing_n3case_grid_yds_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_yds" + seqRow).html();
}

function billing_n3case_grid_yds_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_yds" + seqRow).html(newValue);
}

function billing_n3case_grid_bl_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_bl" + seqRow).html();
}

function billing_n3case_grid_bl_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_bl" + seqRow).html(newValue);
}

function billing_n3case_grid_suffix_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_suffix" + seqRow).html();
}

function billing_n3case_grid_suffix_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_suffix" + seqRow).html(newValue);
}

function billing_n3case_grid_type_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_type" + seqRow).html();
}

function billing_n3case_grid_type_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_type" + seqRow).html(newValue);
}

function billing_n3case_grid_status_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_status" + seqRow).html();
}

function billing_n3case_grid_status_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_status" + seqRow).html(newValue);
}

function billing_n3case_grid_pafdot_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_pafdot" + seqRow).html();
}

function billing_n3case_grid_pafdot_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_pafdot" + seqRow).html(newValue);
}

function billing_n3case_grid_dye_lot_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_dye_lot" + seqRow).html();
}

function billing_n3case_grid_dye_lot_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_dye_lot" + seqRow).html(newValue);
}

function billing_n3case_grid_pafdos_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_pafdos" + seqRow).html();
}

function billing_n3case_grid_pafdos_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_pafdos" + seqRow).html(newValue);
}

function billing_n3case_grid_p_o_number_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_p_o_number" + seqRow).html();
}

function billing_n3case_grid_p_o_number_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_p_o_number" + seqRow).html(newValue);
}

function billing_n3case_grid_grwt_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_grwt" + seqRow).html();
}

function billing_n3case_grid_grwt_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_grwt" + seqRow).html(newValue);
}

function billing_n3case_grid_trwt_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_trwt" + seqRow).html();
}

function billing_n3case_grid_trwt_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_trwt" + seqRow).html(newValue);
}

function billing_n3case_grid_ndate_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_ndate" + seqRow).html();
}

function billing_n3case_grid_ndate_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_ndate" + seqRow).html(newValue);
}

function billing_n3case_grid_style_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_style" + seqRow).html();
}

function billing_n3case_grid_style_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_style" + seqRow).html(newValue);
}

function billing_n3case_grid_color_no_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_color_no" + seqRow).html();
}

function billing_n3case_grid_color_no_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_color_no" + seqRow).html(newValue);
}

function billing_n3case_grid_shade_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_shade" + seqRow).html();
}

function billing_n3case_grid_shade_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_shade" + seqRow).html(newValue);
}

function billing_n3case_grid_color_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_color" + seqRow).html();
}

function billing_n3case_grid_color_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_color" + seqRow).html(newValue);
}

function billing_n3case_grid_width_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_width" + seqRow).html();
}

function billing_n3case_grid_width_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_width" + seqRow).html(newValue);
}

function billing_n3case_grid_grade_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_grade" + seqRow).html();
}

function billing_n3case_grid_grade_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_grade" + seqRow).html(newValue);
}

function billing_n3case_grid_pcs_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_pcs" + seqRow).html();
}

function billing_n3case_grid_pcs_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_pcs" + seqRow).html(newValue);
}

function billing_n3case_grid_lbs_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_lbs" + seqRow).html();
}

function billing_n3case_grid_lbs_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_lbs" + seqRow).html(newValue);
}

function billing_n3case_grid_sm_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_sm" + seqRow).html();
}

function billing_n3case_grid_sm_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_sm" + seqRow).html(newValue);
}

function billing_n3case_grid_it_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_it" + seqRow).html();
}

function billing_n3case_grid_it_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_it" + seqRow).html(newValue);
}

function billing_n3case_grid_loc_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_loc" + seqRow).html();
}

function billing_n3case_grid_loc_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_loc" + seqRow).html(newValue);
}

function billing_n3case_grid_bin_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_bin" + seqRow).html();
}

function billing_n3case_grid_bin_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_bin" + seqRow).html(newValue);
}

function billing_n3case_grid_id2_getValue(seqRow) {
  seqRow = scSeqNormalize(seqRow);
  return $("#id_sc_field_id2" + seqRow).html();
}

function billing_n3case_grid_id2_setValue(newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  $("#id_sc_field_id2" + seqRow).html(newValue);
}

function billing_n3case_grid_getValue(field, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("invoice" == field) {
    return billing_n3case_grid_invoice_getValue(seqRow);
  }
  if ("case" == field) {
    return billing_n3case_grid_case_getValue(seqRow);
  }
  if ("smit" == field) {
    return billing_n3case_grid_smit_getValue(seqRow);
  }
  if ("yds" == field) {
    return billing_n3case_grid_yds_getValue(seqRow);
  }
  if ("bl" == field) {
    return billing_n3case_grid_bl_getValue(seqRow);
  }
  if ("suffix" == field) {
    return billing_n3case_grid_suffix_getValue(seqRow);
  }
  if ("type" == field) {
    return billing_n3case_grid_type_getValue(seqRow);
  }
  if ("status" == field) {
    return billing_n3case_grid_status_getValue(seqRow);
  }
  if ("pafdot" == field) {
    return billing_n3case_grid_pafdot_getValue(seqRow);
  }
  if ("dye_lot" == field) {
    return billing_n3case_grid_dye_lot_getValue(seqRow);
  }
  if ("pafdos" == field) {
    return billing_n3case_grid_pafdos_getValue(seqRow);
  }
  if ("p_o_number" == field) {
    return billing_n3case_grid_p_o_number_getValue(seqRow);
  }
  if ("grwt" == field) {
    return billing_n3case_grid_grwt_getValue(seqRow);
  }
  if ("trwt" == field) {
    return billing_n3case_grid_trwt_getValue(seqRow);
  }
  if ("ndate" == field) {
    return billing_n3case_grid_ndate_getValue(seqRow);
  }
  if ("style" == field) {
    return billing_n3case_grid_style_getValue(seqRow);
  }
  if ("color_no" == field) {
    return billing_n3case_grid_color_no_getValue(seqRow);
  }
  if ("shade" == field) {
    return billing_n3case_grid_shade_getValue(seqRow);
  }
  if ("color" == field) {
    return billing_n3case_grid_color_getValue(seqRow);
  }
  if ("width" == field) {
    return billing_n3case_grid_width_getValue(seqRow);
  }
  if ("grade" == field) {
    return billing_n3case_grid_grade_getValue(seqRow);
  }
  if ("pcs" == field) {
    return billing_n3case_grid_pcs_getValue(seqRow);
  }
  if ("lbs" == field) {
    return billing_n3case_grid_lbs_getValue(seqRow);
  }
  if ("sm" == field) {
    return billing_n3case_grid_sm_getValue(seqRow);
  }
  if ("it" == field) {
    return billing_n3case_grid_it_getValue(seqRow);
  }
  if ("loc" == field) {
    return billing_n3case_grid_loc_getValue(seqRow);
  }
  if ("bin" == field) {
    return billing_n3case_grid_bin_getValue(seqRow);
  }
  if ("id2" == field) {
    return billing_n3case_grid_id2_getValue(seqRow);
  }
}

function billing_n3case_grid_setValue(field, newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("invoice" == field) {
    billing_n3case_grid_invoice_setValue(newValue, seqRow);
  }
  if ("case" == field) {
    billing_n3case_grid_case_setValue(newValue, seqRow);
  }
  if ("smit" == field) {
    billing_n3case_grid_smit_setValue(newValue, seqRow);
  }
  if ("yds" == field) {
    billing_n3case_grid_yds_setValue(newValue, seqRow);
  }
  if ("bl" == field) {
    billing_n3case_grid_bl_setValue(newValue, seqRow);
  }
  if ("suffix" == field) {
    billing_n3case_grid_suffix_setValue(newValue, seqRow);
  }
  if ("type" == field) {
    billing_n3case_grid_type_setValue(newValue, seqRow);
  }
  if ("status" == field) {
    billing_n3case_grid_status_setValue(newValue, seqRow);
  }
  if ("pafdot" == field) {
    billing_n3case_grid_pafdot_setValue(newValue, seqRow);
  }
  if ("dye_lot" == field) {
    billing_n3case_grid_dye_lot_setValue(newValue, seqRow);
  }
  if ("pafdos" == field) {
    billing_n3case_grid_pafdos_setValue(newValue, seqRow);
  }
  if ("p_o_number" == field) {
    billing_n3case_grid_p_o_number_setValue(newValue, seqRow);
  }
  if ("grwt" == field) {
    billing_n3case_grid_grwt_setValue(newValue, seqRow);
  }
  if ("trwt" == field) {
    billing_n3case_grid_trwt_setValue(newValue, seqRow);
  }
  if ("ndate" == field) {
    billing_n3case_grid_ndate_setValue(newValue, seqRow);
  }
  if ("style" == field) {
    billing_n3case_grid_style_setValue(newValue, seqRow);
  }
  if ("color_no" == field) {
    billing_n3case_grid_color_no_setValue(newValue, seqRow);
  }
  if ("shade" == field) {
    billing_n3case_grid_shade_setValue(newValue, seqRow);
  }
  if ("color" == field) {
    billing_n3case_grid_color_setValue(newValue, seqRow);
  }
  if ("width" == field) {
    billing_n3case_grid_width_setValue(newValue, seqRow);
  }
  if ("grade" == field) {
    billing_n3case_grid_grade_setValue(newValue, seqRow);
  }
  if ("pcs" == field) {
    billing_n3case_grid_pcs_setValue(newValue, seqRow);
  }
  if ("lbs" == field) {
    billing_n3case_grid_lbs_setValue(newValue, seqRow);
  }
  if ("sm" == field) {
    billing_n3case_grid_sm_setValue(newValue, seqRow);
  }
  if ("it" == field) {
    billing_n3case_grid_it_setValue(newValue, seqRow);
  }
  if ("loc" == field) {
    billing_n3case_grid_loc_setValue(newValue, seqRow);
  }
  if ("bin" == field) {
    billing_n3case_grid_bin_setValue(newValue, seqRow);
  }
  if ("id2" == field) {
    billing_n3case_grid_id2_setValue(newValue, seqRow);
  }
}

function scJQAddEvents(seqRow) {
  seqRow = scSeqNormalize(seqRow);
}

function scSeqNormalize(seqRow) {
  var newSeqRow = seqRow.toString();
  if ("" == newSeqRow) {
    return "";
  }
  if ("_" != newSeqRow.substr(0, 1)) {
    return "_" + newSeqRow;
  }
  return newSeqRow;
}
function ajax_navigate(opc, parm)
{
    scAjaxProcOn();
    $.ajax({
      type: "POST",
      url: "index.php",
      data: "nmgp_opcao=ajax_navigate&script_case_init=" + document.F4.script_case_init.value + "&script_case_session=" + document.F4.script_case_session.value + "&opc=" + opc  + "&parm=" + parm,
      success: function(jsonNavigate) {
        var i, oResp;
        eval("oResp = " + jsonNavigate);
        if (oResp["redirInfo"]) {
           scAjaxRedir(oResp);
        }
        if (oResp["setValue"]) {
          for (i = 0; i < oResp["setValue"].length; i++) {
               $("#" + oResp["setValue"][i]["field"]).html(oResp["setValue"][i]["value"]);
          }
        }
        if (oResp["setVar"]) {
          for (i = 0; i < oResp["setVar"].length; i++) {
               eval (oResp["setVar"][i]["var"] + ' = \"' + oResp["setVar"][i]["value"] + '\"');
          }
        }
        if (oResp["setDisplay"]) {
          for (i = 0; i < oResp["setDisplay"].length; i++) {
               document.getElementById(oResp["setDisplay"][i]["field"]).style.display = oResp["setDisplay"][i]["value"];
          }
        }
        if (oResp["setDisabled"]) {
          for (i = 0; i < oResp["setDisabled"].length; i++) {
               document.getElementById(oResp["setDisabled"][i]["field"]).disabled = oResp["setDisabled"][i]["value"];
          }
        }
        if (oResp["setClass"]) {
          for (i = 0; i < oResp["setClass"].length; i++) {
               document.getElementById(oResp["setClass"][i]["field"]).className = oResp["setClass"][i]["value"];
          }
        }
        if (oResp["setSrc"]) {
          for (i = 0; i < oResp["setSrc"].length; i++) {
               document.getElementById(oResp["setSrc"][i]["field"]).src = oResp["setSrc"][i]["value"];
          }
        }
        if (oResp["redirInfo"]) {
           scAjaxRedir(oResp);
        }
        if (oResp["htmOutput"]) {
           scAjaxShowDebug(oResp);
        }
        if (!SC_Link_View)
        {
            if (Qsearch_ok)
            {
                scQSInitVal = $("#SC_fast_search_top").val();
                scQSInit = true;
                scQuickSearchInit(false, '');
                $('#SC_fast_search_top').listen();
                scQuickSearchKeyUp('top', null);
                scQSInit = false;
            }
            SC_init_jquery();
            tb_init('a.thickbox, area.thickbox, input.thickbox');
        }
        scAjaxProcOff();
      }
    });
}
