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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

function pack_pyalloc_grid_getValue(field, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("yarn_order" == field) {
    return pack_pyalloc_grid_yarn_order_getValue(seqRow);
  }
  if ("p_o_number" == field) {
    return pack_pyalloc_grid_p_o_number_getValue(seqRow);
  }
  if ("lbs_ordere" == field) {
    return pack_pyalloc_grid_lbs_ordere_getValue(seqRow);
  }
  if ("twarp" == field) {
    return pack_pyalloc_grid_twarp_getValue(seqRow);
  }
  if ("warp_perc" == field) {
    return pack_pyalloc_grid_warp_perc_getValue(seqRow);
  }
  if ("lbs_warped" == field) {
    return pack_pyalloc_grid_lbs_warped_getValue(seqRow);
  }
  if ("cost_lb_y" == field) {
    return pack_pyalloc_grid_cost_lb_y_getValue(seqRow);
  }
  if ("net_cost_l" == field) {
    return pack_pyalloc_grid_net_cost_l_getValue(seqRow);
  }
  if ("id2" == field) {
    return pack_pyalloc_grid_id2_getValue(seqRow);
  }
}

function pack_pyalloc_grid_setValue(field, newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("yarn_order" == field) {
    pack_pyalloc_grid_yarn_order_setValue(newValue, seqRow);
  }
  if ("p_o_number" == field) {
    pack_pyalloc_grid_p_o_number_setValue(newValue, seqRow);
  }
  if ("lbs_ordere" == field) {
    pack_pyalloc_grid_lbs_ordere_setValue(newValue, seqRow);
  }
  if ("twarp" == field) {
    pack_pyalloc_grid_twarp_setValue(newValue, seqRow);
  }
  if ("warp_perc" == field) {
    pack_pyalloc_grid_warp_perc_setValue(newValue, seqRow);
  }
  if ("lbs_warped" == field) {
    pack_pyalloc_grid_lbs_warped_setValue(newValue, seqRow);
  }
  if ("cost_lb_y" == field) {
    pack_pyalloc_grid_cost_lb_y_setValue(newValue, seqRow);
  }
  if ("net_cost_l" == field) {
    pack_pyalloc_grid_net_cost_l_setValue(newValue, seqRow);
  }
  if ("id2" == field) {
    pack_pyalloc_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)
        {
            SC_init_jquery();
            tb_init('a.thickbox, area.thickbox, input.thickbox');
        }
        scAjaxProcOff();
      }
    });
}
