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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

function fv_orders_orders_grid_getValue(field, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("ifor" == field) {
    return fv_orders_orders_grid_ifor_getValue(seqRow);
  }
  if ("ourpo" == field) {
    return fv_orders_orders_grid_ourpo_getValue(seqRow);
  }
  if ("date" == field) {
    return fv_orders_orders_grid_date_getValue(seqRow);
  }
  if ("scode" == field) {
    return fv_orders_orders_grid_scode_getValue(seqRow);
  }
  if ("bcode" == field) {
    return fv_orders_orders_grid_bcode_getValue(seqRow);
  }
  if ("new_style" == field) {
    return fv_orders_orders_grid_new_style_getValue(seqRow);
  }
  if ("color" == field) {
    return fv_orders_orders_grid_color_getValue(seqRow);
  }
  if ("desc1" == field) {
    return fv_orders_orders_grid_desc1_getValue(seqRow);
  }
  if ("desc2" == field) {
    return fv_orders_orders_grid_desc2_getValue(seqRow);
  }
  if ("width" == field) {
    return fv_orders_orders_grid_width_getValue(seqRow);
  }
  if ("knit_price" == field) {
    return fv_orders_orders_grid_knit_price_getValue(seqRow);
  }
  if ("lbs_ordere" == field) {
    return fv_orders_orders_grid_lbs_ordere_getValue(seqRow);
  }
  if ("order_amt" == field) {
    return fv_orders_orders_grid_order_amt_getValue(seqRow);
  }
  if ("blbs" == field) {
    return fv_orders_orders_grid_blbs_getValue(seqRow);
  }
  if ("lbs_open" == field) {
    return fv_orders_orders_grid_lbs_open_getValue(seqRow);
  }
  if ("open_amt" == field) {
    return fv_orders_orders_grid_open_amt_getValue(seqRow);
  }
  if ("ship_via" == field) {
    return fv_orders_orders_grid_ship_via_getValue(seqRow);
  }
  if ("salesman" == field) {
    return fv_orders_orders_grid_salesman_getValue(seqRow);
  }
  if ("pdelivery" == field) {
    return fv_orders_orders_grid_pdelivery_getValue(seqRow);
  }
  if ("p_o_number" == field) {
    return fv_orders_orders_grid_p_o_number_getValue(seqRow);
  }
  if ("terms" == field) {
    return fv_orders_orders_grid_terms_getValue(seqRow);
  }
  if ("delivery" == field) {
    return fv_orders_orders_grid_delivery_getValue(seqRow);
  }
  if ("status" == field) {
    return fv_orders_orders_grid_status_getValue(seqRow);
  }
  if ("roll_size" == field) {
    return fv_orders_orders_grid_roll_size_getValue(seqRow);
  }
  if ("spec" == field) {
    return fv_orders_orders_grid_spec_getValue(seqRow);
  }
  if ("redate" == field) {
    return fv_orders_orders_grid_redate_getValue(seqRow);
  }
}

function fv_orders_orders_grid_setValue(field, newValue, seqRow) {
  seqRow = scSeqNormalize(seqRow);
  if ("ifor" == field) {
    fv_orders_orders_grid_ifor_setValue(newValue, seqRow);
  }
  if ("ourpo" == field) {
    fv_orders_orders_grid_ourpo_setValue(newValue, seqRow);
  }
  if ("date" == field) {
    fv_orders_orders_grid_date_setValue(newValue, seqRow);
  }
  if ("scode" == field) {
    fv_orders_orders_grid_scode_setValue(newValue, seqRow);
  }
  if ("bcode" == field) {
    fv_orders_orders_grid_bcode_setValue(newValue, seqRow);
  }
  if ("new_style" == field) {
    fv_orders_orders_grid_new_style_setValue(newValue, seqRow);
  }
  if ("color" == field) {
    fv_orders_orders_grid_color_setValue(newValue, seqRow);
  }
  if ("desc1" == field) {
    fv_orders_orders_grid_desc1_setValue(newValue, seqRow);
  }
  if ("desc2" == field) {
    fv_orders_orders_grid_desc2_setValue(newValue, seqRow);
  }
  if ("width" == field) {
    fv_orders_orders_grid_width_setValue(newValue, seqRow);
  }
  if ("knit_price" == field) {
    fv_orders_orders_grid_knit_price_setValue(newValue, seqRow);
  }
  if ("lbs_ordere" == field) {
    fv_orders_orders_grid_lbs_ordere_setValue(newValue, seqRow);
  }
  if ("order_amt" == field) {
    fv_orders_orders_grid_order_amt_setValue(newValue, seqRow);
  }
  if ("blbs" == field) {
    fv_orders_orders_grid_blbs_setValue(newValue, seqRow);
  }
  if ("lbs_open" == field) {
    fv_orders_orders_grid_lbs_open_setValue(newValue, seqRow);
  }
  if ("open_amt" == field) {
    fv_orders_orders_grid_open_amt_setValue(newValue, seqRow);
  }
  if ("ship_via" == field) {
    fv_orders_orders_grid_ship_via_setValue(newValue, seqRow);
  }
  if ("salesman" == field) {
    fv_orders_orders_grid_salesman_setValue(newValue, seqRow);
  }
  if ("pdelivery" == field) {
    fv_orders_orders_grid_pdelivery_setValue(newValue, seqRow);
  }
  if ("p_o_number" == field) {
    fv_orders_orders_grid_p_o_number_setValue(newValue, seqRow);
  }
  if ("terms" == field) {
    fv_orders_orders_grid_terms_setValue(newValue, seqRow);
  }
  if ("delivery" == field) {
    fv_orders_orders_grid_delivery_setValue(newValue, seqRow);
  }
  if ("status" == field) {
    fv_orders_orders_grid_status_setValue(newValue, seqRow);
  }
  if ("roll_size" == field) {
    fv_orders_orders_grid_roll_size_setValue(newValue, seqRow);
  }
  if ("spec" == field) {
    fv_orders_orders_grid_spec_setValue(newValue, seqRow);
  }
  if ("redate" == field) {
    fv_orders_orders_grid_redate_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();
      }
    });
}
