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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

function beam_inventory_grid_getValue(field, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("ac" == field) {
    return beam_inventory_grid_ac_getValue(seqRow);
  }
  if ("p_o_number" == field) {
    return beam_inventory_grid_p_o_number_getValue(seqRow);
  }
  if ("location" == field) {
    return beam_inventory_grid_location_getValue(seqRow);
  }
  if ("date" == field) {
    return beam_inventory_grid_date_getValue(seqRow);
  }
  if ("den" == field) {
    return beam_inventory_grid_den_getValue(seqRow);
  }
  if ("fil" == field) {
    return beam_inventory_grid_fil_getValue(seqRow);
  }
  if ("luster" == field) {
    return beam_inventory_grid_luster_getValue(seqRow);
  }
  if ("producer" == field) {
    return beam_inventory_grid_producer_getValue(seqRow);
  }
  if ("merge" == field) {
    return beam_inventory_grid_merge_getValue(seqRow);
  }
  if ("beam_code" == field) {
    return beam_inventory_grid_beam_code_getValue(seqRow);
  }
  if ("size" == field) {
    return beam_inventory_grid_size_getValue(seqRow);
  }
  if ("b_s" == field) {
    return beam_inventory_grid_b_s_getValue(seqRow);
  }
  if ("lbs_orderd" == field) {
    return beam_inventory_grid_lbs_orderd_getValue(seqRow);
  }
  if ("lbs_recd" == field) {
    return beam_inventory_grid_lbs_recd_getValue(seqRow);
  }
  if ("lbs_open" == field) {
    return beam_inventory_grid_lbs_open_getValue(seqRow);
  }
  if ("lbs_knit" == field) {
    return beam_inventory_grid_lbs_knit_getValue(seqRow);
  }
  if ("inventory" == field) {
    return beam_inventory_grid_inventory_getValue(seqRow);
  }
  if ("lbs_sold" == field) {
    return beam_inventory_grid_lbs_sold_getValue(seqRow);
  }
  if ("waste" == field) {
    return beam_inventory_grid_waste_getValue(seqRow);
  }
  if ("lbs_allocd" == field) {
    return beam_inventory_grid_lbs_allocd_getValue(seqRow);
  }
  if ("lbs_avail" == field) {
    return beam_inventory_grid_lbs_avail_getValue(seqRow);
  }
  if ("warp_loss" == field) {
    return beam_inventory_grid_warp_loss_getValue(seqRow);
  }
  if ("to" == field) {
    return beam_inventory_grid_to_getValue(seqRow);
  }
  if ("cost_lb_t" == field) {
    return beam_inventory_grid_cost_lb_t_getValue(seqRow);
  }
  if ("ship_to" == field) {
    return beam_inventory_grid_ship_to_getValue(seqRow);
  }
  if ("desc" == field) {
    return beam_inventory_grid_desc_getValue(seqRow);
  }
  if ("price_lb_w" == field) {
    return beam_inventory_grid_price_lb_w_getValue(seqRow);
  }
  if ("cost_lb_w" == field) {
    return beam_inventory_grid_cost_lb_w_getValue(seqRow);
  }
  if ("cost_lb_y" == field) {
    return beam_inventory_grid_cost_lb_y_getValue(seqRow);
  }
  if ("status" == field) {
    return beam_inventory_grid_status_getValue(seqRow);
  }
  if ("tv" == field) {
    return beam_inventory_grid_tv_getValue(seqRow);
  }
  if ("fiber" == field) {
    return beam_inventory_grid_fiber_getValue(seqRow);
  }
}

function beam_inventory_grid_setValue(field, newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("ac" == field) {
    beam_inventory_grid_ac_setValue(newValue, seqRow);
  }
  if ("p_o_number" == field) {
    beam_inventory_grid_p_o_number_setValue(newValue, seqRow);
  }
  if ("location" == field) {
    beam_inventory_grid_location_setValue(newValue, seqRow);
  }
  if ("date" == field) {
    beam_inventory_grid_date_setValue(newValue, seqRow);
  }
  if ("den" == field) {
    beam_inventory_grid_den_setValue(newValue, seqRow);
  }
  if ("fil" == field) {
    beam_inventory_grid_fil_setValue(newValue, seqRow);
  }
  if ("luster" == field) {
    beam_inventory_grid_luster_setValue(newValue, seqRow);
  }
  if ("producer" == field) {
    beam_inventory_grid_producer_setValue(newValue, seqRow);
  }
  if ("merge" == field) {
    beam_inventory_grid_merge_setValue(newValue, seqRow);
  }
  if ("beam_code" == field) {
    beam_inventory_grid_beam_code_setValue(newValue, seqRow);
  }
  if ("size" == field) {
    beam_inventory_grid_size_setValue(newValue, seqRow);
  }
  if ("b_s" == field) {
    beam_inventory_grid_b_s_setValue(newValue, seqRow);
  }
  if ("lbs_orderd" == field) {
    beam_inventory_grid_lbs_orderd_setValue(newValue, seqRow);
  }
  if ("lbs_recd" == field) {
    beam_inventory_grid_lbs_recd_setValue(newValue, seqRow);
  }
  if ("lbs_open" == field) {
    beam_inventory_grid_lbs_open_setValue(newValue, seqRow);
  }
  if ("lbs_knit" == field) {
    beam_inventory_grid_lbs_knit_setValue(newValue, seqRow);
  }
  if ("inventory" == field) {
    beam_inventory_grid_inventory_setValue(newValue, seqRow);
  }
  if ("lbs_sold" == field) {
    beam_inventory_grid_lbs_sold_setValue(newValue, seqRow);
  }
  if ("waste" == field) {
    beam_inventory_grid_waste_setValue(newValue, seqRow);
  }
  if ("lbs_allocd" == field) {
    beam_inventory_grid_lbs_allocd_setValue(newValue, seqRow);
  }
  if ("lbs_avail" == field) {
    beam_inventory_grid_lbs_avail_setValue(newValue, seqRow);
  }
  if ("warp_loss" == field) {
    beam_inventory_grid_warp_loss_setValue(newValue, seqRow);
  }
  if ("to" == field) {
    beam_inventory_grid_to_setValue(newValue, seqRow);
  }
  if ("cost_lb_t" == field) {
    beam_inventory_grid_cost_lb_t_setValue(newValue, seqRow);
  }
  if ("ship_to" == field) {
    beam_inventory_grid_ship_to_setValue(newValue, seqRow);
  }
  if ("desc" == field) {
    beam_inventory_grid_desc_setValue(newValue, seqRow);
  }
  if ("price_lb_w" == field) {
    beam_inventory_grid_price_lb_w_setValue(newValue, seqRow);
  }
  if ("cost_lb_w" == field) {
    beam_inventory_grid_cost_lb_w_setValue(newValue, seqRow);
  }
  if ("cost_lb_y" == field) {
    beam_inventory_grid_cost_lb_y_setValue(newValue, seqRow);
  }
  if ("status" == field) {
    beam_inventory_grid_status_setValue(newValue, seqRow);
  }
  if ("tv" == field) {
    beam_inventory_grid_tv_setValue(newValue, seqRow);
  }
  if ("fiber" == field) {
    beam_inventory_grid_fiber_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();
      }
    });
}
