
 <form name="form_ajax_redir_1" method="post" style="display: none">
  <input type="hidden" name="nmgp_parms">
  <input type="hidden" name="nmgp_outra_jan">
  <input type="hidden" name="script_case_session" value="<?php echo session_id() ?>">
 </form>
 <form name="form_ajax_redir_2" method="post" style="display: none">
  <input type="hidden" name="nmgp_parms">
  <input type="hidden" name="nmgp_url_saida">
  <input type="hidden" name="script_case_init">
  <input type="hidden" name="script_case_session" value="<?php echo session_id() ?>">
 </form>

 <SCRIPT>
<?php
sajax_show_javascript();
?>

  function scCenterElement(oElem)
  {
    var $oElem    = $(oElem),
        $oWindow  = $(this),
        iElemTop  = Math.round(($oWindow.height() - $oElem.height()) / 2),
        iElemLeft = Math.round(($oWindow.width()  - $oElem.width())  / 2);

    $oElem.offset({top: iElemTop, left: iElemLeft});
  } // scCenterElement

  function scAjaxHideAutocomp(sFrameId)
  {
    if (document.getElementById("id_ac_frame_" + sFrameId))
    {
      document.getElementById("id_ac_frame_" + sFrameId).style.display = "none";
    }
  } // scAjaxHideAutocomp

  function scAjaxShowAutocomp(sFrameId)
  {
    if (document.getElementById("id_ac_frame_" + sFrameId))
    {
      document.getElementById("id_ac_frame_" + sFrameId).style.display = "";
      document.getElementById("id_ac_" + sFrameId).focus();
    }
  } // scAjaxShowAutocomp

  function scAjaxHideDebug()
  {
    if (document.getElementById("id_debug_window"))
    {
      document.getElementById("id_debug_window").style.display = "none";
      document.getElementById("id_debug_text").innerHTML = "";
    }
  } // scAjaxHideDebug

  function scAjaxShowDebug(oTemp)
  {
    if (!document.getElementById("id_debug_window"))
    {
      return;
    }
    if (oTemp && oTemp != null)
    {
        oResp = oTemp;
    }
    if (oResp["htmOutput"] && "" != oResp["htmOutput"])
    {
      document.getElementById("id_debug_window").style.display = "";
      document.getElementById("id_debug_text").innerHTML = scAjaxFormatDebug(oResp["htmOutput"]) + document.getElementById("id_debug_text").innerHTML;
      scCenterElement(document.getElementById("id_debug_window"));
    }
  } // scAjaxShowDebug

  function scAjaxFormatDebug(sDebugMsg)
  {
    return "<table class=\"scFormMessageTable\" style=\"margin: 1px; width: 100%\"><tr><td class=\"scFormMessageMessage\">" + scAjaxSpecCharParser(sDebugMsg) + "</td></tr></table>";
  } // scAjaxFormatDebug

  function scAjaxHideErrorDisplay(sErrorId, bForce)
  {
    if (document.getElementById("id_error_display_" + sErrorId + "_frame"))
    {
      document.getElementById("id_error_display_" + sErrorId + "_frame").style.display = "none";
      document.getElementById("id_error_display_" + sErrorId + "_text").innerHTML = "";
      if (null == bForce)
      {
          bForce = true;
      }
      if (bForce)
      {
          var $oField = $('#id_sc_field_' + sErrorId);
          if (0 < $oField.length)
          {
              $oField.removeClass(sc_css_status);
          }
      }
    }
    if (document.getElementById("id_error_display_fixed"))
    {
      document.getElementById("id_error_display_fixed").style.display = "none";
    }
  } // scAjaxHideErrorDisplay

  function scAjaxShowErrorDisplay(sErrorId, sErrorMsg)
  {
    if (oResp && oResp['redirExitInfo'])
    {
      sErrorMsg += "<br /><input type=\"button\" onClick=\"window.location='" + oResp['redirExitInfo']['action'] + "'\" value=\"Ok\">";
    }
    sErrorMsg = scAjaxErrorSql(sErrorMsg);
    if (document.getElementById("id_error_display_" + sErrorId + "_frame"))
    {
      document.getElementById("id_error_display_" + sErrorId + "_frame").style.display = "";
      document.getElementById("id_error_display_" + sErrorId + "_text").innerHTML = sErrorMsg;
      if ("table" == sErrorId)
      {
        scCenterElement(document.getElementById("id_error_display_" + sErrorId + "_frame"));
      }
      var $oField = $('#id_sc_field_' + sErrorId);
      if (0 < $oField.length)
      {
        $oField.addClass(sc_css_status);
      }
    }
    if (ajax_error_list && ajax_error_list[sErrorId] && ajax_error_list[sErrorId]["timeout"] && 0 < ajax_error_list[sErrorId]["timeout"])
    {
      setTimeout("scAjaxHideErrorDisplay('" + sErrorId + "', false)", ajax_error_list[sErrorId]["timeout"] * 1000);
    }
    /*else if ("table" == sErrorId)
    {
      document.getElementById("id_error_display_" + sErrorId + "_frame").style.left = posDispLeft + "px";
      document.getElementById("id_error_display_" + sErrorId + "_frame").style.top = posDispTop + "px";
    }*/
  } // scAjaxShowErrorDisplay

  var iErrorSqlId = 1;

  function scAjaxErrorSql(sErrorMsg)
  {
    var iTmpPos = sErrorMsg.indexOf("{SC_DB_ERROR_INI}"),
        sTmpId;
    while (-1 < iTmpPos)
    {
      sTmpId    = "sc_id_error_sql_" + iErrorSqlId;
      sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "<br /><span style=\"text-decoration: underline\" onClick=\"$('#" + sTmpId + "').show(); scCenterElement(document.getElementById('" + sTmpId + "'))\">" + sErrorMsg.substr(iTmpPos + 17);
      iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_MID}");
      sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "</span><table class=\"scFormErrorTable\" id=\"" + sTmpId + "\" style=\"display: none; position: absolute\"><tr><td>" + sErrorMsg.substr(iTmpPos + 17);
      iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_CLS}");
      sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "<br /><br /><span onClick=\"$('#" + sTmpId + "').hide()\">" + sErrorMsg.substr(iTmpPos + 17);
      iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_END}");
      sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "</span></td></tr></table>" + sErrorMsg.substr(iTmpPos + 17);
      iTmpPos   = sErrorMsg.indexOf("{SC_DB_ERROR_INI}");
      iErrorSqlId++;
    }
    return sErrorMsg;
  } // scAjaxErrorSql

  function scAjaxHideMessage()
  {
    if (document.getElementById("id_message_display_frame"))
    {
      document.getElementById("id_message_display_frame").style.display = "none";
      document.getElementById("id_message_display_text").innerHTML = "";
    }
  } // scAjaxHideMessage

  function scAjaxShowMessage()
  {
    if (!oResp["msgDisplay"] || !oResp["msgDisplay"]["msgText"])
    {
      return;
    }
    _scAjaxShowMessage(scMsgDefTitle, oResp["msgDisplay"]["msgText"], false, sc_ajaxMsgTime, false, "Ok", 0, 0, 0, 0, "", "", "", false, true);
  } // scAjaxShowMessage

  var scMsgDefClose = "";

  function _scAjaxShowMessage(sTitle, sMessage, bModal, iTimeout, bButton, sButton, iTop, iLeft, iWidth, iHeight, sRedir, sTarget, sParam, bClose, bBodyIcon) {
    if ("" == sMessage) {
      if (bModal) {
        scMsgDefClick = "close_modal";
      }
      else {
        scMsgDefClick = "close";
      }
      _scAjaxMessageBtnClick();
      document.getElementById("id_message_display_title").innerHTML = scMsgDefTitle;
      document.getElementById("id_message_display_text").innerHTML = "";
      document.getElementById("id_message_display_buttone").value = scMsgDefButton;
      document.getElementById("id_message_display_buttond").style.display = "none";
    }
    else {
      document.getElementById("id_message_display_title").innerHTML = scAjaxSpecCharParser(sTitle);
      document.getElementById("id_message_display_text").innerHTML = scAjaxSpecCharParser(sMessage);
      document.getElementById("id_message_display_buttone").value = sButton;
      document.getElementById("id_message_display_buttond").style.display = bButton ? "" : "none";
      document.getElementById("id_message_display_buttond").style.display = bButton ? "" : "none";
      document.getElementById("id_message_display_title_line").style.display = (bClose || "" != sTitle) ? "" : "none";
      document.getElementById("id_message_display_close_icon").style.display = bClose ? "" : "none";
      if (document.getElementById("id_message_display_body_icon")) {
        document.getElementById("id_message_display_body_icon").style.display = bBodyIcon ? "" : "none";
      }
      $("#id_message_display_content").css('width', (0 < iWidth ? iWidth + 'px' : ''));
      $("#id_message_display_content").css('height', (0 < iHeight ? iHeight + 'px' : ''));
      if (bModal) {
        iWidth = iWidth || 250;
        iHeight = iHeight || 200;
        scMsgDefClose = "close_modal";
        tb_show('', '#TB_inline?height=' + (iHeight + 6) + '&width=' + (iWidth + 4) + '&inlineId=id_message_display_frame&modal=true', '');
        if (bButton) {
          if ("" != sRedir && "" != sTarget) {
            scMsgDefClick = "redir2_modal";
            document.form_ajax_redir_2.action = sRedir;
            document.form_ajax_redir_2.target = sTarget;
            document.form_ajax_redir_2.nmgp_parms.value = sParam;
            document.form_ajax_redir_2.script_case_init.value = scMsgDefScInit;
          }
          else if ("" != sRedir && "" == sTarget) {
            scMsgDefClick = "redir1";
            document.form_ajax_redir_1.action = sRedir;
            document.form_ajax_redir_1.nmgp_parms.value = sParam;
          }
          else {
            scMsgDefClick = "close_modal";
          }
        }
        else if (null != iTimeout && 0 < iTimeout) {
          scMsgDefClick = "close_modal";
          setTimeout("_scAjaxMessageBtnClick()", iTimeout * 1000);
        }
      }
      else
      {
        scMsgDefClose = "close";
        $("#id_message_display_frame").css('top', (0 < iTop ? iTop + 'px' : ''));
        $("#id_message_display_frame").css('left', (0 < iLeft ? iLeft + 'px' : ''));
        document.getElementById("id_message_display_frame").style.display = "";
        if (0 == iTop && 0 == iLeft) {
          scCenterElement(document.getElementById("id_message_display_frame"));
        }
        if (bButton) {
          if ("" != sRedir && "" != sTarget) {
            scMsgDefClick = "redir2";
            document.form_ajax_redir_2.action = sRedir;
            document.form_ajax_redir_2.target = sTarget;
            document.form_ajax_redir_2.nmgp_parms.value = sParam;
            document.form_ajax_redir_2.script_case_init.value = scMsgDefScInit;
          }
          else if ("" != sRedir && "" == sTarget) {
            scMsgDefClick = "redir1";
            document.form_ajax_redir_1.action = sRedir;
            document.form_ajax_redir_1.nmgp_parms.value = sParam;
          }
          else {
            scMsgDefClick = "close";
          }
        }
        else if (null != iTimeout && 0 < iTimeout) {
          scMsgDefClick = "close";
          setTimeout("_scAjaxMessageBtnClick()", iTimeout * 1000);
        }
      }
    }
  } // _scAjaxShowMessage

  function _scAjaxMessageBtnClose() {
    switch (scMsgDefClose) {
      case "close":
        document.getElementById("id_message_display_frame").style.display = "none";
        break;
      case "close_modal":
        tb_remove();
        break;
    }
  } // _scAjaxMessageBtnClick

  function _scAjaxMessageBtnClick() {
    switch (scMsgDefClick) {
      case "close":
        document.getElementById("id_message_display_frame").style.display = "none";
        break;
      case "close_modal":
        tb_remove();
        break;
      case "redir1":
        document.form_ajax_redir_1.submit();
        break;
      case "redir2":
        document.form_ajax_redir_2.submit();
        document.getElementById("id_message_display_frame").style.display = "none";
        break;
      case "redir2_modal":
        document.form_ajax_redir_2.submit();
        tb_remove();
        break;
    }
  } // _scAjaxMessageBtnClick

  function scAjaxHasError()
  {
    if (!oResp["result"])
    {
      return false;
    }
    return "ERROR" == oResp["result"];
  } // scAjaxHasError

  function scAjaxIsOk()
  {
    if (!oResp["result"])
    {
      return false;
    }
    return "OK" == oResp["result"] || "SET" == oResp["result"];
  } // scAjaxIsOk

  function scAjaxIsSet()
  {
    if (!oResp["result"])
    {
      return false;
    }
    return "SET" == oResp["result"];
  } // scAjaxIsSet

  function scAjaxCalendarReload()
  {
    if (oResp["calendarReload"] && "OK" == oResp["calendarReload"])
    {
      self.parent.calendar_reload();
      self.parent.tb_remove();
    }
  } // scCalendarReload

  function scAjaxUpdateErrors(sType)
  {
    ajax_error_geral = "";
    oFieldErrors     = {};
    if (oResp["errList"])
    {
      for (iFieldErrors = 0; iFieldErrors < oResp["errList"].length; iFieldErrors++)
      {
        sTestField = oResp["errList"][iFieldErrors]["fldName"];
        if ("geral_dye_dyeorder_form" == sTestField)
        {
          if (ajax_error_geral != '') { ajax_error_geral += '<br>';}
          ajax_error_geral += scAjaxSpecCharParser(oResp["errList"][iFieldErrors]["msgText"]);
        }
        else
        {
          if (scFocusFirstErrorField && '' == scFocusFirstErrorName)
          {
            scFocusFirstErrorName = sTestField;
          }
          if (oResp["errList"][iFieldErrors]["numLinha"])
          {
            sTestField += oResp["errList"][iFieldErrors]["numLinha"];
          }
          if (!oFieldErrors[sTestField])
          {
            oFieldErrors[sTestField] = new Array();
          }
          oFieldErrors[sTestField][oFieldErrors[sTestField].length] = scAjaxSpecCharParser(oResp["errList"][iFieldErrors]["msgText"]);
        }
      }
    }
    for (iUpdateErrors = 0; iUpdateErrors < ajax_field_list.length; iUpdateErrors++)
    {
      sTestField = ajax_field_list[iUpdateErrors];
      if (oFieldErrors[sTestField])
      {
        ajax_error_list[sTestField][sType] = oFieldErrors[sTestField];
      }
    }
  } // scAjaxUpdateErrors

  function scAjaxUpdateFieldErrors(sField, sType)
  {
    aFieldErrors = new Array();
    if (oResp["errList"])
    {
      iErrorPos  = 0;
      for (iFieldErrors = 0; iFieldErrors < oResp["errList"].length; iFieldErrors++)
      {
        sTestField = oResp["errList"][iFieldErrors]["fldName"];
        if (oResp["errList"][iFieldErrors]["numLinha"])
        {
          sTestField += oResp["errList"][iFieldErrors]["numLinha"];
        }
        if (sField == sTestField)
        {
          aFieldErrors[iErrorPos] = scAjaxSpecCharParser(oResp["errList"][iFieldErrors]["msgText"]);
          iErrorPos++;
        }
      }
    }
    ajax_error_list[sField][sType] = aFieldErrors;
  } // scAjaxUpdateFieldErrors

  function scAjaxListErrors(bLabel)
  {
    bFirst        = false;
    sAppErrorText = "";
    if ("" != ajax_error_geral)
    {
      bFirst         = true;
      sAppErrorText += ajax_error_geral;
    }
    for (iFieldList = 0; iFieldList < ajax_field_list.length; iFieldList++)
    {
      sFieldError = scAjaxListFieldErrors(ajax_field_list[iFieldList], bLabel);
      if ("" != sFieldError)
      {
        if (bFirst)
        {
          bFirst         = false
          sAppErrorText += "<hr size=\"1\" width=\"80%\" />";
        }
        sAppErrorText += sFieldError;
      }
    }
    return sAppErrorText;
  } // scAjaxListErrors

  function scAjaxListFieldErrors(sField, bLabel)
  {
    sErrorText = "";
    for (iErrorType = 0; iErrorType < ajax_error_type.length; iErrorType++)
    {
      if (ajax_error_list[sField])
      {
        for (iListErrors = 0; iListErrors < ajax_error_list[sField][ajax_error_type[iErrorType]].length; iListErrors++)
        {
          if (bLabel)
          {
            sErrorText += ajax_error_list[sField]["label"] + ": ";
          }
          sErrorText += ajax_error_list[sField][ajax_error_type[iErrorType]][iListErrors] + "<br />";
        }
      }
    }
    return sErrorText;
  } // scAjaxListFieldErrors

  function scAjaxSetFields()
  {
    if (!oResp["fldList"])
    {
      return true;
    }
    for (iSetFields = 0; iSetFields < oResp["fldList"].length; iSetFields++)
    {
      var sFieldName = oResp["fldList"][iSetFields]["fldName"];
      var sFieldType = oResp["fldList"][iSetFields]["fldType"];
      if ("selectdd" == sFieldType)
      {
        var bSelectDD = true;
        sFieldType = "select";
      }
      else
      {
        var bSelectDD = false;
      }
      if (oResp["fldList"][iSetFields]["valList"])
      {
        var oFieldValues = oResp["fldList"][iSetFields]["valList"];
        if (0 == oFieldValues.length)
        {
          oFieldValues = null;
        }
      }
      else
      {
        var oFieldValues = null;
      }
      if (oResp["fldList"][iSetFields]["optList"])
      {
        var oFieldOptions = oResp["fldList"][iSetFields]["optList"];
      }
      else
      {
        var oFieldOptions = null;
      }
/*
      if ("_autocomp" == sFieldName.substr(sFieldName.length - 9) &&
          iSetFields > 0 &&
          sFieldName.substr(0, sFieldName.length - 9) == oResp["fldList"][iSetFields - 1]["fldName"] &&
          document.getElementById("div_ac_lab_" + sFieldName.substr(0, sFieldName.length - 9)) &&
          oFieldValues[0]['value'])
      {
          document.getElementById("div_ac_lab_" + sFieldName.substr(0, sFieldName.length - 9)).innerHTML = oFieldValues[0]['value'];
      }
*/
      if ("_autocomp" == sFieldName.substr(sFieldName.length - 9) &&
          iSetFields > 0 &&
          sFieldName.substr(0, sFieldName.length - 9) == oResp["fldList"][iSetFields - 1]["fldName"] &&
          document.getElementById("div_ac_lab_" + sFieldName.substr(0, sFieldName.length - 9)))
      {
          sLabel_auto_Comp = (oFieldValues[0]['value']) ? oFieldValues[0]['value'] : "";
          document.getElementById("div_ac_lab_" + sFieldName.substr(0, sFieldName.length - 9)).innerHTML = sLabel_auto_Comp;
      }


      if (oResp["fldList"][iSetFields]["colNum"])
      {
        var iColNum = oResp["fldList"][iSetFields]["colNum"];
      }
      else
      {
        var iColNum = 1;
      }
      if (oResp["fldList"][iSetFields]["row"])
      {
        var iRow = oResp["fldList"][iSetFields]["row"];
      }
      else
      {
        var iRow = 1;
      }
      if (oResp["fldList"][iSetFields]["htmComp"])
      {
        var sHtmComp = oResp["fldList"][iSetFields]["htmComp"];
        sHtmComp     = sHtmComp.replace(/__AD__/gi, '"');
        sHtmComp     = sHtmComp.replace(/__AS__/gi, "'");
      }
      else
      {
        var sHtmComp = null;
      }
      if (oResp["fldList"][iSetFields]["imgFile"])
      {
        var sImgFile = oResp["fldList"][iSetFields]["imgFile"];
      }
      else
      {
        var sImgFile = "";
      }
      if (oResp["fldList"][iSetFields]["imgOrig"])
      {
        var sImgOrig = oResp["fldList"][iSetFields]["imgOrig"];
      }
      else
      {
        var sImgOrig = "";
      }
      if (oResp["fldList"][iSetFields]["keepImg"])
      {
        var sKeepImg = oResp["fldList"][iSetFields]["keepImg"];
      }
      else
      {
        var sKeepImg = "N";
      }
      if (oResp["fldList"][iSetFields]["imgLink"])
      {
        var sImgLink = oResp["fldList"][iSetFields]["imgLink"];
      }
      else
      {
        var sImgLink = null;
      }
      if (oResp["fldList"][iSetFields]["docLink"])
      {
        var sDocLink = oResp["fldList"][iSetFields]["docLink"];
      }
      else
      {
        var sDocLink = "";
      }
      if (oResp["fldList"][iSetFields]["docIcon"])
      {
        var sDocIcon = oResp["fldList"][iSetFields]["docIcon"];
      }
      else
      {
        var sDocIcon = "";
      }
      if (oResp["fldList"][iSetFields]["optComp"])
      {
        var sOptComp = oResp["fldList"][iSetFields]["optComp"];
      }
      else
      {
        var sOptComp = "";
      }
      if (oResp["fldList"][iSetFields]["optClass"])
      {
        var sOptClass = oResp["fldList"][iSetFields]["optClass"];
      }
      else
      {
        var sOptClass = "";
      }
      if (oResp["fldList"][iSetFields]["optMulti"])
      {
        var sOptMulti = oResp["fldList"][iSetFields]["optMulti"];
      }
      else
      {
        var sOptMulti = "";
      }
      if (oResp["fldList"][iSetFields]["imgHtml"])
      {
        var sImgHtml = oResp["fldList"][iSetFields]["imgHtml"];
      }
      else
      {
        var sImgHtml = "";
      }
      if (oResp["fldList"][iSetFields]["mulHtml"])
      {
        var sMULHtml = oResp["fldList"][iSetFields]["mulHtml"];
      }
      else
      {
        var sMULHtml = "";
      }
      if (oResp["fldList"][iSetFields]["updInnerHtml"])
      {
        var sInnerHtml = scAjaxSpecCharParser(oResp["fldList"][iSetFields]["updInnerHtml"]);
      }
      else
      {
        var sInnerHtml = null;
      }
      if (oResp["fldList"][iSetFields]["lookupCons"])
      {
        var sLookupCons = scAjaxSpecCharParser(oResp["fldList"][iSetFields]["lookupCons"]);
      }
      else
      {
        var sLookupCons = "";
      }
      if (oResp["clearUpload"])
      {
        var sClearUpload = scAjaxSpecCharParser(oResp["clearUpload"]);
      }
      else
      {
        var sClearUpload = "N";
      }
      if ("checkbox" == sFieldType)
      {
        scAjaxSetFieldCheckbox(sFieldName, oFieldValues, oFieldOptions, iColNum, sHtmComp, sInnerHtml, sOptComp, sOptClass, sOptMulti);
      }
      else if ("duplosel" == sFieldType)
      {
        scAjaxSetFieldDuplosel(sFieldName, oFieldValues, oFieldOptions);
      }
      else if ("imagem" == sFieldType)
      {
        scAjaxSetFieldImage(sFieldName, oFieldValues, sImgFile, sImgOrig, sImgLink, sKeepImg);
      }
      else if ("documento" == sFieldType)
      {
        scAjaxSetFieldDocument(sFieldName, oFieldValues, sDocLink, sDocIcon, sClearUpload);
      }
      else if ("label" == sFieldType)
      {
        scAjaxSetFieldLabel(sFieldName, oFieldValues, oFieldOptions, sLookupCons);
      }
      else if ("radio" == sFieldType)
      {
        scAjaxSetFieldRadio(sFieldName, oFieldValues, oFieldOptions, iColNum, sHtmComp, sOptComp);
      }
      else if ("select" == sFieldType)
      {
        scAjaxSetFieldSelect(sFieldName, oFieldValues, oFieldOptions, bSelectDD, iRow);
      }
      else if ("text" == sFieldType)
      {
        scAjaxSetFieldText(sFieldName, oFieldValues, sLookupCons);
      }
      else if ("editor_html" == sFieldType)
      {
        scAjaxSetFieldEditorHtml(sFieldName, oFieldValues);
      }
      else if ("imagehtml" == sFieldType)
      {
        scAjaxSetFieldImageHtml(sFieldName, oFieldValues, sImgHtml);
      }
      else if ("innerhtml" == sFieldType)
      {
        scAjaxSetFieldInnerHtml(sFieldName, oFieldValues);
      }
      else if ("multi_upload" == sFieldType)
      {
        scAjaxSetFieldMultiUpload(sFieldName, sMULHtml);
      }
      scAjaxUpdateHeaderFooter(sFieldName, oFieldValues);
    }
  } // scAjaxSetFields

  function scAjaxUpdateHeaderFooter(sFieldName, oFieldValues)
  {
    if (self.updateHeaderFooter)
    {
      if (null == oFieldValues)
      {
        sNewValue = '';
      }
      else if (oFieldValues[0]["label"])
      {
        sNewValue = oFieldValues[0]["label"];
      }
      else
      {
        sNewValue = oFieldValues[0]["value"];
      }
      updateHeaderFooter(sFieldName, scAjaxSpecCharParser(sNewValue));
    }
  } // scAjaxUpdateHeaderFooter

  function scAjaxSetFieldText(sFieldName, oFieldValues, sLookupCons)
  {
    if (document.F1.elements[sFieldName])
    {
//      document.F1.elements[sFieldName].value = scAjaxSpecCharParser(oFieldValues[0]['value']);
        Temp_text = scAjaxProtectBreakLine(oFieldValues[0]['value']);
        Temp_text = scAjaxSpecCharParser(Temp_text);
        document.F1.elements[sFieldName].value = scAjaxReturnBreakLine(Temp_text);
    }
    if (document.getElementById("id_lookup_" + sFieldName))
    {
      document.getElementById("id_lookup_" + sFieldName).innerHTML = sLookupCons;
    }
    if (oFieldValues[0]['label'])
    {
      scAjaxSetReadonlyArrayValue(sFieldName, oFieldValues);
    }
    else
    {
      oFieldValues[0]['value'] = scAjaxBreakLine(oFieldValues[0]['value']);
      scAjaxSetReadonlyValue(sFieldName, scAjaxSpecCharParser(oFieldValues[0]['value']));
    }
  } // scAjaxSetFieldText

  function scAjaxSetFieldSelect(sFieldName, oFieldValues, oFieldOptions, bSelectDD, iRow)
  {
    sFieldNameHtml = sFieldName;
    if (!document.F1.elements[sFieldName] && !document.F1.elements[sFieldName + "[]"])
    {
      return;
    }
    if (bSelectDD)
    {
        $("#id_sc_field_" + sFieldName).dropdownchecklist("destroy");
    }
    if (!document.F1.elements[sFieldName] && document.F1.elements[sFieldName + "[]"])
    {
      sFieldNameHtml += "[]";
    }
    if ("hidden" == document.F1.elements[sFieldNameHtml].type)
    {
      scAjaxSetFieldText(sFieldNameHtml, oFieldValues);
      return;
    }
    if (null != oFieldOptions)
    {
      if ("<select" != oFieldOptions.substr(0, 7))
      {
        var $oField = $("#id_sc_field_" + sFieldName);
        if (0 < $oField.length)
        {
          $oField.html(oFieldOptions);
        }
        else
        {
          document.getElementById("idAjaxSelect_" + sFieldName).innerHTML = oFieldOptions;
        }
      }
      else
      {
        document.getElementById("idAjaxSelect_" + sFieldName).innerHTML = oFieldOptions;
      }
    }
    var aValues = new Array();
    if (null != oFieldValues)
    {
      for (iFieldSelect = 0; iFieldSelect < oFieldValues.length; iFieldSelect++)
      {
        aValues[iFieldSelect] = scAjaxSpecCharParser(oFieldValues[iFieldSelect]["value"]);
      }
    }
    var oFormField = document.F1.elements[sFieldNameHtml];
    for (iFieldSelect = 0; iFieldSelect < oFormField.length; iFieldSelect++)
    {
      if (scAjaxInArray(oFormField.options[iFieldSelect].value, aValues))
      {
        oFormField.options[iFieldSelect].selected = true;
      }
      else
      {
        oFormField.options[iFieldSelect].selected = false;
      }
    }
    scAjaxSetReadonlyArrayValue(sFieldName, oFieldValues, "<br />");
    if (bSelectDD)
    {
        scJQDDCheckBoxAdd(iRow);
    }
  } // scAjaxSetFieldSelect

  function scAjaxSetFieldDuplosel(sFieldName, oFieldValues, oFieldOptions)
  {
    var sFieldNameOrig = sFieldName + "_orig";
    var sFieldNameDest = sFieldName + "_dest";
    var oFormFieldOrig = document.F1.elements[sFieldNameOrig];
    var oFormFieldDest = document.F1.elements[sFieldNameDest];
    if (null != oFieldOptions)
    {
      scAjaxClearSelect(sFieldNameOrig);
      for (iFieldSelect = 0; iFieldSelect < oFieldOptions.length; iFieldSelect++)
      {
        oFormFieldOrig.options[iFieldSelect] = new Option(scAjaxSpecCharParser(oFieldOptions[iFieldSelect]["label"]), scAjaxSpecCharParser(oFieldOptions[iFieldSelect]["value"]));
      }
    }
    while (oFormFieldDest.length > 0)
    {
      oFormFieldDest.options[0] = null;
    }
    var aValues = new Array();
    if (null != oFieldValues)
    {
      for (iFieldSelect = 0; iFieldSelect < oFieldValues.length; iFieldSelect++)
      {
        sNewOptionLabel = oFieldValues[iFieldSelect]["label"] ? scAjaxSpecCharParser(oFieldValues[iFieldSelect]["label"]) : scAjaxSpecCharParser(oFieldValues[iFieldSelect]["value"]);
        sNewOptionValue = scAjaxSpecCharParser(oFieldValues[iFieldSelect]["value"]);
        if (sNewOptionValue.substr(0, 8) == "@NMorder")
        {
           sNewOptionValue                      = sNewOptionValue.substr(8);
           oFormFieldDest.options[iFieldSelect] = new Option(scAjaxSpecCharParser(sNewOptionLabel), sNewOptionValue);
           sNewOptionValue                      = sNewOptionValue.substr(1);
           aValues[iFieldSelect]                = sNewOptionValue;
        }
        else
        {
           aValues[iFieldSelect]                = sNewOptionValue;
           oFormFieldDest.options[iFieldSelect] = new Option(scAjaxSpecCharParser(sNewOptionLabel), sNewOptionValue);
        }
      }
    }
    for (iFieldSelect = 0; iFieldSelect < oFormFieldOrig.length; iFieldSelect++)
    {
      oFormFieldOrig.options[iFieldSelect].selected = false;
      if (scAjaxInArray(oFormFieldOrig.options[iFieldSelect].value, aValues))
      {
        oFormFieldOrig.options[iFieldSelect].disabled    = true;
        oFormFieldOrig.options[iFieldSelect].style.color = "#A0A0A0";
      }
      else
      {
        oFormFieldOrig.options[iFieldSelect].disabled = false;
      }
    }
    scAjaxSetReadonlyArrayValue(sFieldName, oFieldValues, "<br />");
  } // scAjaxSetFieldDuplosel

  function scAjaxSetFieldCheckbox(sFieldName, oFieldValues, oFieldOptions, iColNum, sHtmComp, sInnerHtml, sOptComp, sOptClass, sOptMulti)
  {
    if (document.getElementById("idAjaxCheckbox_" + sFieldName) && null != sInnerHtml)
    {
      document.getElementById("idAjaxCheckbox_" + sFieldName).innerHTML = sInnerHtml;
      return;
    }
    if (document.F1.elements[sFieldName] && "hidden" == document.F1.elements[sFieldName].type)
    {
      scAjaxSetFieldText(sFieldName, oFieldValues);
      return;
    }
    if (null != oFieldOptions && "" != oFieldOptions)
    {
      scAjaxClearCheckbox(sFieldName);
      scAjaxRecreateOptions("Checkbox", "checkbox", sFieldName, oFieldValues, oFieldOptions, iColNum, sHtmComp, sOptComp, sOptClass, sOptMulti);
    }
    else
    {
      scAjaxSetCheckboxOptions(sFieldName, oFieldValues);
    }
    scAjaxSetReadonlyArrayValue(sFieldName, oFieldValues, "<br />");
  } // scAjaxSetFieldCheckbox

  function scAjaxSetFieldRadio(sFieldName, oFieldValues, oFieldOptions, iColNum, sHtmComp, sOptComp)
  {
    if (document.F1.elements[sFieldName] && "hidden" == document.F1.elements[sFieldName].type)
    {
      scAjaxSetFieldText(sFieldName, oFieldValues);
      return;
    }
    if (null != oFieldOptions && "" != oFieldOptions)
    {
      scAjaxClearRadio(sFieldName);
      scAjaxRecreateOptions("Radio", "radio", sFieldName, oFieldValues, oFieldOptions, iColNum, sHtmComp, sOptComp, "", "");
    }
    else
    {
      scAjaxSetRadioOptions(sFieldName, oFieldValues);
    }
    scAjaxSetReadonlyArrayValue(sFieldName, oFieldValues, "<br />");
  } // scAjaxSetFieldRadio

  function scAjaxSetFieldLabel(sFieldName, oFieldValues, oFieldOptions, sLookupCons)
  {
    sFieldValue = oFieldValues[0]["value"];
    sFieldLabel = oFieldValues[0]["value"];
    sFieldLabel = scAjaxBreakLine(sFieldLabel);
    if (null != oFieldOptions)
    {
      for (iRecreate = 0; iRecreate < oFieldOptions.length; iRecreate++)
      {
        sOptText  = scAjaxSpecCharParser(oFieldOptions[iRecreate]["value"]);
        sOptValue = scAjaxSpecCharParser(oFieldOptions[iRecreate]["label"]);
        if (sFieldValue == sOptText)
        {
          sFieldLabel = sOptValue;
        }
      }
    }
    if (document.getElementById("id_ajax_label_" + sFieldName))
    {
      document.getElementById("id_ajax_label_" + sFieldName).innerHTML = scAjaxSpecCharParser(sFieldLabel);
    }
    if (document.F1.elements[sFieldName])
    {
//      document.F1.elements[sFieldName].value = scAjaxSpecCharParser(sFieldValue);
        Temp_text = scAjaxProtectBreakLine(sFieldValue);
        Temp_text = scAjaxSpecCharParser(Temp_text);
        document.F1.elements[sFieldName].value = scAjaxReturnBreakLine(Temp_text);

    }
    if (document.getElementById("id_lookup_" + sFieldName))
    {
      document.getElementById("id_lookup_" + sFieldName).innerHTML = sLookupCons;
    }
    scAjaxSetReadonlyValue(sFieldName, scAjaxSpecCharParser(sFieldLabel));
  } // scAjaxSetFieldLabel

  function scAjaxSetFieldImage(sFieldName, oFieldValues, sImgFile, sImgOrig, sImgLink, sKeepImg)
  {
    if (!document.F1.elements[sFieldName] && !document.F1.elements[sFieldName + "[]"])
    {
      return;
    }
    if ("N" == sKeepImg && document.getElementById("id_ajax_img_"  + sFieldName))
    {
      document.getElementById("id_ajax_img_"  + sFieldName).src           = scAjaxSpecCharParser(sImgFile);
      document.getElementById("id_ajax_img_"  + sFieldName).style.display = ("" == sImgFile) ? "none" : "";
    }
    if (document.getElementById("id_ajax_link_" + sFieldName) && null != sImgLink)
    {
      document.getElementById("id_ajax_link_" + sFieldName).innerHTML = oFieldValues[0]["value"];
      document.getElementById("id_ajax_link_" + sFieldName).href      = scAjaxSpecCharParser(sImgLink);
    }
    if (document.getElementById("chk_ajax_img_" + sFieldName))
    {
      document.getElementById("chk_ajax_img_" + sFieldName).style.display = ("" == oFieldValues[0]["value"]) ? "none" : "";
    }
    if ("" == oFieldValues[0]["value"] && document.F1.elements[sFieldName + "_limpa"])
    {
      document.F1.elements[sFieldName + "_limpa"].checked = false;
    }
    if ("N" == sKeepImg && document.getElementById("txt_ajax_img_" + sFieldName))
    {
      document.getElementById("txt_ajax_img_" + sFieldName).innerHTML     = oFieldValues[0]["value"];
      document.getElementById("txt_ajax_img_" + sFieldName).style.display = ("" == oFieldValues[0]["value"]) ? "none" : "";
    }
    if ("" != sImgOrig)
    {
      eval("if (var_ajax_img_" + sFieldName + ") var_ajax_img_" + sFieldName + " = '" + sImgOrig + "';");
      if (document.F1.elements["temp_out1_" + sFieldName])
      {
        document.F1.elements["temp_out_" + sFieldName].value = sImgFile;
        document.F1.elements["temp_out1_" + sFieldName].value = sImgOrig;
      }
      else if (document.F1.elements["temp_out_" + sFieldName])
      {
        document.F1.elements["temp_out_" + sFieldName].value = sImgOrig;
      }
    }
    if ("" != oFieldValues[0]["value"])
    {
      if (document.F1.elements[sFieldName + "_salva"]) document.F1.elements[sFieldName + "_salva"].value = oFieldValues[0]["value"];
    }
    else if (oResp && oResp["ajaxRequest"] && "navigate_form" == oResp["ajaxRequest"])
    {
      if (document.F1.elements[sFieldName + "_salva"]) document.F1.elements[sFieldName + "_salva"].value = "";
    }
    scAjaxSetReadonlyValue(sFieldName, scAjaxSpecCharParser(oFieldValues[0]["value"]));
  } // scAjaxSetFieldImage

  function scAjaxSetFieldDocument(sFieldName, oFieldValues, sDocLink, sDocIcon, sClearUpload)
  {
    if (!document.F1.elements[sFieldName] && !document.F1.elements[sFieldName + "[]"])
    {
      return;
    }
    document.getElementById("id_ajax_doc_"  + sFieldName).innerHTML = scAjaxSpecCharParser(sDocLink);
    if (document.getElementById("id_ajax_doc_icon_"  + sFieldName))
    {
      document.getElementById("id_ajax_doc_icon_"  + sFieldName).src = scAjaxSpecCharParser(sDocIcon);
    }
    if ("" == oFieldValues[0]["value"])
    {
      document.getElementById("chk_ajax_img_" + sFieldName).style.display = "none";
      document.getElementById("id_ajax_doc_" + sFieldName).style.display = "none";
    }
    else
    {
      document.getElementById("chk_ajax_img_" + sFieldName).style.display = "";
      document.getElementById("id_ajax_doc_" + sFieldName).style.display = "";
    }
    if ("" == oFieldValues[0]["value"] && document.F1.elements[sFieldName + "_limpa"])
    {
      document.F1.elements[sFieldName + "_limpa"].checked = false;
    }
    if ("S" == sClearUpload && document.F1.elements[sFieldName + "_ul_name"])
    {
      document.F1.elements[sFieldName + "_ul_name"].value = "";
    }
    scAjaxSetReadonlyValue(sFieldName, scAjaxSpecCharParser(oFieldValues[0]["value"]));
  } // scAjaxSetFieldDocument

  function scAjaxSetFieldInnerHtml(sFieldName, oFieldValues)
  {
    if (document.getElementById(sFieldName))
    {
      document.getElementById(sFieldName).innerHTML = scAjaxSpecCharParser(oFieldValues[0]["value"]);
    }
  } // scAjaxSetFieldInnerHtml

  function scAjaxSetFieldMultiUpload(sFieldName, sMULHtml)
  {
    if (!document.F1.elements[sFieldName] && !document.F1.elements[sFieldName + "[]"])
    {
      return;
    }
    $("#id_sc_loaded_" + sFieldName).html(scAjaxSpecCharParser(sMULHtml));
  } // scAjaxSetFieldMultiUpload

  function scAjaxSetFieldEditorHtml(sFieldName, oFieldValues)
  {
    if (!document.F1.elements[sFieldName])
    {
      return;
    }
    var oFormField = tinyMCE.getInstanceById(sFieldName);
    oFormField.setContent(scAjaxSpecCharParser(oFieldValues[0]["value"]));
    scAjaxSetReadonlyValue(sFieldName, scAjaxSpecCharParser(oFieldValues[0]["value"]));
  } // scAjaxSetFieldEditorHtml

  function scAjaxSetFieldImageHtml(sFieldName, oFieldValues, sImgHtml)
  {
    if (document.getElementById("id_imghtml_" + sFieldName))
    {
      document.getElementById("id_imghtml_" + sFieldName).innerHTML = scAjaxSpecCharParser(sImgHtml);
    }
  } // scAjaxSetFieldEditorHtml

  function scAjaxSetCheckboxOptions(sFieldName, oFieldValues)
  {
    if (!document.F1.elements[sFieldName] && !document.F1.elements[sFieldName + "[]"] && !document.F1.elements[sFieldName + "[0]"])
    {
      return;
    }
    var aValues    = new Array();
    if (null != oFieldValues)
    {
      for (iFieldSelect = 0; iFieldSelect < oFieldValues.length; iFieldSelect++)
      {
        aValues[iFieldSelect] = scAjaxSpecCharParser(oFieldValues[iFieldSelect]["value"]);
      }
    }
    if (document.F1.elements[sFieldName + "[]"])
    {
      var oFormField = document.F1.elements[sFieldName + "[]"];
      if (oFormField.length)
      {
        for (iFieldCheckbox = 0; iFieldCheckbox < oFormField.length; iFieldCheckbox++)
        {
          if (scAjaxInArray(oFormField[iFieldCheckbox].value, aValues))
          {
            oFormField[iFieldCheckbox].checked = true;
          }
          else
          {
            oFormField[iFieldCheckbox].checked = false;
          }
        }
      }
      else
      {
        if (scAjaxInArray(oFormField.value, aValues))
        {
          oFormField.checked = true;
        }
        else
        {
          oFormField.checked = false;
        }
      }
    }
    else if (document.F1.elements[sFieldName + "[0]"])
    {
      for (iFieldCheckbox = 0; iFieldCheckbox < document.F1.elements.length; iFieldCheckbox++)
      {
        oFormElement = document.F1.elements[iFieldCheckbox];
        if (sFieldName + "[" == oFormElement.name.substr(0, sFieldName.length + 1) && scAjaxInArray(oFormElement.value, aValues))
        {
          oFormElement.checked = true;
        }
        else if (sFieldName + "[" == oFormElement.name.substr(0, sFieldName.length + 1))
        {
          oFormElement.checked = false;
        }
      }
    }
    else
    {
      oFormElement = document.F1.elements[sFieldName];
      if (scAjaxInArray(oFormElement.value, aValues))
      {
        oFormElement.checked = true;
      }
      else
      {
        oFormElement.checked = false;
      }
    }
  } // scAjaxSetCheckboxOptions

  function scAjaxSetRadioOptions(sFieldName, oFieldValues)
  {
    if (!document.F1.elements[sFieldName])
    {
      return;
    }
    var oFormField = document.F1.elements[sFieldName];
    var aValues    = new Array();
    if (null != oFieldValues)
    {
      for (iFieldSelect = 0; iFieldSelect < oFieldValues.length; iFieldSelect++)
      {
        aValues[iFieldSelect] = scAjaxSpecCharParser(oFieldValues[iFieldSelect]["value"]);
      }
    }
    for (iFieldRadio = 0; iFieldRadio < oFormField.length; iFieldRadio++)
    {
      if (scAjaxInArray(oFormField[iFieldRadio].value, aValues))
      {
        oFormField[iFieldRadio].checked = true;
      }
    }
  } // scAjaxSetRadioOptions

  function scAjaxSetReadonlyValue(sFieldName, sFieldValue)
  {
    if (document.getElementById("id_read_on_" + sFieldName))
    {
      document.getElementById("id_read_on_" + sFieldName).innerHTML = sFieldValue;
    }
  } // scAjaxSetReadonlyValue

  function scAjaxSetReadonlyArrayValue(sFieldName, oFieldValues, sDelim)
  {
    if (null == oFieldValues)
    {
      return;
    }
    if (null == sDelim)
    {
      sDelim = " ";
    }
    sReadLabel = "";
    for (iReadArray = 0; iReadArray < oFieldValues.length; iReadArray++)
    {
      if (oFieldValues[iReadArray]["label"])
      {
        if ("" != sReadLabel)
        {
          sReadLabel += sDelim;
        }
        sReadLabel += oFieldValues[iReadArray]["label"];
      }
      else if (oFieldValues[iReadArray]["value"])
      {
        if ("" != sReadLabel)
        {
          sReadLabel += sDelim;
        }
        sReadLabel += oFieldValues[iReadArray]["value"];
      }
    }
    scAjaxSetReadonlyValue(sFieldName, scAjaxSpecCharParser(sReadLabel));
  } // scAjaxSetReadonlyArrayValue

  function scAjaxGetFieldValue(sFieldGet)
  {
    sValue = "";
    if (!oResp["fldList"])
    {
      return sValue;
    }
    for (iFieldValue = 0; iFieldValue < oResp["fldList"].length; iFieldValue++)
    {
      var sFieldName  = oResp["fldList"][iFieldValue]["fldName"];
      if (oResp["fldList"][iFieldValue]["valList"])
      {
        var oFieldValues = oResp["fldList"][iFieldValue]["valList"];
        if (0 == oFieldValues.length)
        {
          oFieldValues = null;
        }
      }
      else
      {
        var oFieldValues = null;
      }
      if (sFieldGet == sFieldName && null != oFieldValues)
      {
        if (1 == oFieldValues.length)
        {
          sValue = scAjaxSpecCharParser(oFieldValues[0]["value"]);
        }
        else
        {
          sValue = new Array();
          for (jFieldValue = 0; jFieldValue < oFieldValues.length; jFieldValue++)
          {
            sValue[jFieldValue] = scAjaxSpecCharParser(oFieldValues[jFieldValue]["value"]);
          }
        }
      }
    }
    return sValue;
  } // scAjaxGetFieldValue

  function scAjaxGetKeyValue(sFieldGet)
  {
    sValue = "";
    if (!oResp["fldList"])
    {
      return sValue;
    }
    for (iKeyValue = 0; iKeyValue < oResp["fldList"].length; iKeyValue++)
    {
      var sFieldName = oResp["fldList"][iKeyValue]["fldName"];
      if (sFieldGet == sFieldName)
      {
        if (oResp["fldList"][iKeyValue]["keyVal"])
        {
          return scAjaxSpecCharParser(oResp["fldList"][iKeyValue]["keyVal"]);
        }
        else
        {
          return scAjaxGetFieldValue(sFieldGet);
        }
      }
    }
    return sValue;
  } // scAjaxGetKeyValue

  function scAjaxGetLineNumber()
  {
    sLineNumber = "";
    if (oResp["errList"])
    {
      for (iLineNumber = 0; iLineNumber < oResp["errList"].length; iLineNumber++)
      {
        if (oResp["errList"][iLineNumber]["numLinha"])
        {
          sLineNumber = oResp["errList"][iLineNumber]["numLinha"];
        }
      }
      return sLineNumber;
    }
    if (oResp["fldList"])
    {
      return oResp["fldList"][0]["numLinha"];
    }
    if (oResp["msgDisplay"])
    {
      return oResp["msgDisplay"]["numLinha"];
    }
    return sLineNumber;
  } // scAjaxGetLineNumber

  function scAjaxFieldExists(sFieldGet)
  {
    bExists = false;
    if (!oResp["fldList"])
    {
      return bExists;
    }
    for (iFieldValue = 0; iFieldValue < oResp["fldList"].length; iFieldValue++)
    {
      var sFieldName  = oResp["fldList"][iFieldValue]["fldName"];
      if (oResp["fldList"][iFieldValue]["valList"])
      {
        var oFieldValues = oResp["fldList"][iFieldValue]["valList"];
        if (0 == oFieldValues.length)
        {
          oFieldValues = null;
        }
      }
      else
      {
        var oFieldValues = null;
      }
      if (sFieldGet == sFieldName && null != oFieldValues)
      {
        bExists = true;
      }
    }
    return bExists;
  } // scAjaxFieldExists

  function scAjaxGetFieldText(sFieldName)
  {
    $oHidden = $("input[name=" + sFieldName + "]");
    if ($oHidden.length)
    {
      for (var i = 0; i < $oHidden.length; i++)
      {
        if ("hidden" == $oHidden[i].type && $oHidden[i].form && $oHidden[i].form.name && "F1" == $oHidden[i].form.name)
        {
          return $oHidden[i].value.replace(/[+]/g, "__NM_PLUS__");
        }
      }
    }
    $oField = $("#id_sc_field_" + sFieldName);
    if ($oField.length && "select" != $oField[0].type.substr(0, 6))
    {
      return $oField.val().replace(/[+]/g, "__NM_PLUS__");
    }
    else if (document.F1.elements[sFieldName])
    {
      return document.F1.elements[sFieldName].value.replace(/[+]/g, "__NM_PLUS__");
    }
    else
    {
      return '';
    }
  } // scAjaxGetFieldText

  function scAjaxGetFieldHidden(sFieldName)
  {
    for( i= 0; i < document.F1.elements.length; i++)
    {
       if (document.F1.elements[i].name == sFieldName)
       {
          return document.F1.elements[i].value.replace(/[+]/g, "__NM_PLUS__");
       }
    }
//    return document.F1.elements[sFieldName].value.replace(/[+]/g, "__NM_PLUS__");
  } // scAjaxGetFieldHidden

  function scAjaxGetFieldSelect(sFieldName)
  {
    sFieldNameHtml = sFieldName;
    if (!document.F1.elements[sFieldName] && !document.F1.elements[sFieldName + "[]"])
    {
      return "";
    }
    if (!document.F1.elements[sFieldName] && document.F1.elements[sFieldName + "[]"])
    {
      sFieldNameHtml += "[]";
    }
    if ("hidden" == document.F1.elements[sFieldNameHtml].type)
    {
      return scAjaxGetFieldHidden(sFieldNameHtml);
    }
    var oFormField = document.F1.elements[sFieldNameHtml];
    var iSelected  = oFormField.selectedIndex;
    if (-1 < iSelected)
    {
      return oFormField.options[iSelected].value.replace(/[+]/g, "__NM_PLUS__");
    }
    else
    {
      return "";
    }
  } // scAjaxGetFieldSelect

  function scAjaxGetFieldSelectMult(sFieldName, sFieldDelim)
  {
    sFieldNameHtml = sFieldName;
    if (!document.F1.elements[sFieldName] && document.F1.elements[sFieldName + "[]"])
    {
      sFieldNameHtml += "[]";
    }
    if ("hidden" == document.F1.elements[sFieldNameHtml].type)
    {
      return scAjaxGetFieldHidden(sFieldNameHtml);
    }
    var oFormField = document.F1.elements[sFieldNameHtml];
    var sFieldVals = "";
    for (iFieldSelect = 0; iFieldSelect < oFormField.length; iFieldSelect++)
    {
      if (oFormField[iFieldSelect].selected)
      {
        if ("" != sFieldVals)
        {
          sFieldVals += sFieldDelim;
        }
        sFieldVals += oFormField[iFieldSelect].value.replace(/[+]/g, "__NM_PLUS__");
      }
    }
    return sFieldVals;
  } // scAjaxGetFieldSelectMult

  function scAjaxGetFieldCheckbox(sFieldName, sDelim)
  {
    var aValues = new Array();
    var sValue  = "";
    if (!document.F1.elements[sFieldName] && !document.F1.elements[sFieldName + "[]"] && !document.F1.elements[sFieldName + "[0]"])
    {
      return sValue;
    }
    if (document.F1.elements[sFieldName + "[]"] && "hidden" == document.F1.elements[sFieldName + "[]"].type)
    {
      return scAjaxGetFieldHidden(sFieldName + "[]");
    }
    if (document.F1.elements[sFieldName] && "hidden" == document.F1.elements[sFieldName].type)
    {
      return scAjaxGetFieldHidden(sFieldName);
    }
    if (document.F1.elements[sFieldName + "[]"])
    {
      var oFormField = document.F1.elements[sFieldName + "[]"];
      if (oFormField.length)
      {
        for (iFieldCheck = 0; iFieldCheck < oFormField.length; iFieldCheck++)
        {
          if (oFormField[iFieldCheck].checked)
          {
            aValues[aValues.length] = oFormField[iFieldCheck].value;
          }
        }
      }
      else
      {
        if (oFormField.checked)
        {
          aValues[aValues.length] = oFormField.value;
        }
      }
    }
    else
    {
      for (iFieldCheck = 0; iFieldCheck < document.F1.elements.length; iFieldCheck++)
      {
        oFormElement = document.F1.elements[iFieldCheck];
        if (sFieldName + "[" == oFormElement.name.substr(0, sFieldName.length + 1) && oFormElement.checked)
        {
          aValues[aValues.length] = oFormElement.value;
        }
        else if (sFieldName == oFormElement.name && oFormElement.checked)
        {
          aValues[aValues.length] = oFormElement.value;
        }
      }
    }
    for (iFieldCheck = 0; iFieldCheck < aValues.length; iFieldCheck++)
    {
      sValue += aValues[iFieldCheck].replace(/[+]/g, "__NM_PLUS__");
      if (iFieldCheck + 1 != aValues.length)
      {
        sValue += sDelim;
      }
    }
    return sValue;
  } // scAjaxGetFieldCheckbox

  function scAjaxGetFieldRadio(sFieldName)
  {
    if ("hidden" == document.F1.elements[sFieldName].type)
    {
      return scAjaxGetFieldHidden(sFieldName);
    }
    var sValue = "";
    if (!document.F1.elements[sFieldName])
    {
      return sValue;
    }
    var oFormField = document.F1.elements[sFieldName];
    if (!oFormField.length)
    {
        var sc_cmp_radio = eval("document.F1." + sFieldName);
        if (sc_cmp_radio.checked)
        {
           sValue = sc_cmp_radio.value.replace(/[+]/g, "__NM_PLUS__");
        }
    }
    else
    {
      for (iFieldRadio = 0; iFieldRadio < oFormField.length; iFieldRadio++)
      {
        if (oFormField[iFieldRadio].checked)
        {
          sValue = oFormField[iFieldRadio].value.replace(/[+]/g, "__NM_PLUS__");
        }
      }
    }
    return sValue;
  } // scAjaxGetFieldRadio

  function scAjaxGetFieldEditorHtml(sFieldName)
  {
    if ("hidden" == document.F1.elements[sFieldName].type)
    {
      return scAjaxGetFieldHidden(sFieldName);
    }
    var sValue = "";
    if (!document.F1.elements[sFieldName])
    {
      return sValue;
    }
    var oFormField = tinyMCE.getInstanceById(sFieldName);
    return scAjaxSpecCharParser(oFormField.getContent().replace(/[+]/g, "__NM_PLUS__"));
  } // scAjaxGetFieldEditorHtml

  function scAjaxDoNothing(e)
  {
  } // scAjaxDoNothing

  function scAjaxInArray(mVal, aList)
  {
    for (iInArray = 0; iInArray < aList.length; iInArray++)
    {
      if (aList[iInArray] == mVal)
      {
        return true;
      }
    }
    return false;
  } // scAjaxInArray

  function scAjaxSpecCharParser(sParseString)
  {
    var ta = document.createElement("textarea");
    ta.innerHTML = sParseString.replace(/</g, "&lt;").replace(/>/g, "&gt;");
    return ta.value;
    var div = document.createElement('div');
    div.innerHTML = sParseString;
    return div.childNodes[0] ? div.childNodes[0].nodeValue : '';
  } // scAjaxSpecCharParser

  function scAjaxRecreateOptions(sFieldType, sHtmlType, sFieldName, oFieldValues, oFieldOptions, iColNum, sHtmComp, sOptComp, sOptClass, sOptMulti)
  {
    var sSuffix  = ("checkbox" == sHtmlType) ? "[]" : "";
    var sDivName = "idAjax" + sFieldType + "_" + sFieldName;
    var sDivText = "";
    var iCntLine = 0;
    var aValues  = new Array();
    var sClass;
    if (null != oFieldValues)
    {
      for (iRecreate = 0; iRecreate < oFieldValues.length; iRecreate++)
      {
        aValues[iRecreate] = scAjaxSpecCharParser(oFieldValues[iRecreate]["value"]);
      }
    }
    sDivText += "<table border=0>";
    for (iRecreate = 0; iRecreate < oFieldOptions.length; iRecreate++)
    {
        sOptText  = scAjaxSpecCharParser(oFieldOptions[iRecreate]["label"]);
        sOptValue = scAjaxSpecCharParser(oFieldOptions[iRecreate]["value"]);
        if (0 == iCntLine)
        {
            sDivText += "<tr>";
        }
        iCntLine++;
        if ("" != sOptClass)
        {
            sClass = " class=\"" + sOptClass;
            if ("" != sOptMulti)
            {
                sClass += " " + sOptClass + sOptMulti;
            }
            sClass += "\"";
        }
        if (sHtmComp == null)
        {
            sHtmComp = "";
        }
        sChecked  = (scAjaxInArray(sOptValue, aValues)) ? " checked" : "";
        sDivText += "<td class=\"scFormDataFontOdd\">";
        sDivText += "<input type=\"" + sHtmlType + "\" name=\"" + sFieldName + sSuffix + "\" value=\"" + sOptValue + "\"" + sChecked + " " + sHtmComp + " " + sOptComp + sClass + ">";
        sDivText += sOptText;
        sDivText += "</td>";
        if (iColNum == iCntLine)
        {
            sDivText += "</tr>";
            iCntLine  = 0;
        }
    }
    sDivText += "</table>";
    document.getElementById(sDivName).innerHTML = sDivText;
  } // scAjaxRecreateOptions

  function scAjaxProcOn(bForce)
  {
    if (null == bForce)
    {
      bForce = false;
    }
    if (document.getElementById("id_div_process"))
    {
      if ($ && $.blockUI && !bForce)
      {
        $.blockUI({
          message: $("#id_div_process_block"),
          overlayCSS: { backgroundColor: sc_ajaxBg },
          css: {
            borderColor: sc_ajaxBordC,
            borderStyle: sc_ajaxBordS,
            borderWidth: sc_ajaxBordW
          }
        });
      }
      else
      {
        document.getElementById("id_div_process").style.display = "";
        document.getElementById("id_fatal_error").style.display = "none";
      }
    }
  } // scAjaxProcOn

  function scAjaxProcOff(bForce)
  {
    if (null == bForce)
    {
      bForce = false;
    }
    if (document.getElementById("id_div_process"))
    {
      if ($ && $.unblockUI && !bForce)
      {
        $.unblockUI();
      }
      else
      {
        document.getElementById("id_div_process").style.display = "none";
      }
    }
  } // scAjaxProcOff

  function scAjaxSetMaster()
  {
    if (!oResp["masterValue"])
    {
      return;
    }
    if (!parent || !parent.scAjaxDetailValue)
    {
      return;
    }
    for (iMaster = 0; iMaster < oResp["masterValue"].length; iMaster++)
    {
      parent.scAjaxDetailValue(oResp["masterValue"][iMaster]["index"], oResp["masterValue"][iMaster]["value"]);
    }
  } // scAjaxSetMaster

  function scAjaxSetFocus()
  {
    if (!oResp["setFocus"] && '' == scFocusFirstErrorName)
    {
      return;
    }
    sFieldName = oResp["setFocus"];
    if (document.F1.elements[sFieldName])
    {
        scFocusField(sFieldName);
    }
    scAjaxFocusError();
  } // scAjaxSetFocus

  function scAjaxFocusError()
  {
    if ('' != scFocusFirstErrorName)
    {
      scFocusField(scFocusFirstErrorName);
      scFocusFirstErrorName = '';
    }
  } // scAjaxFocusError

  function scAjaxSetNavStatus(sBarPos)
  {
    if (!oResp["navStatus"])
    {
      return;
    }
    sNavRet = "S";
    sNavAva = "S";
    if (oResp["navStatus"]["ret"])
    {
      sNavRet = oResp["navStatus"]["ret"];
    }
    if (oResp["navStatus"]["ava"])
    {
      sNavAva = oResp["navStatus"]["ava"];
    }
    if ("S" != sNavRet && "N" != sNavRet)
    {
      sNavRet = "S";
    }
    if ("S" != sNavAva && "N" != sNavAva)
    {
      sNavAva = "S";
    }
    Nav_permite_ret = sNavRet;
    Nav_permite_ava = sNavAva;
    nav_atualiza(Nav_permite_ret, Nav_permite_ava, sBarPos);
  } // scAjaxSetNavStatus

  function scAjaxSetSummary()
  {
    if (!oResp["navSummary"])
    {
      return;
    }
    sreg_ini = oResp["navSummary"].reg_ini;
    sreg_qtd = oResp["navSummary"].reg_qtd;
    sreg_tot = oResp["navSummary"].reg_tot;
    summary_atualiza(sreg_ini, sreg_qtd, sreg_tot);
  } // scAjaxSetSummary

  function scAjaxSetNavpage()
  {
    navpage_atualiza(oResp["navPage"]);
  } // scAjaxSetNavpage


  function scAjaxRedir(oTemp)
  {
    if (oTemp && oTemp != null)
    {
        oResp = oTemp;
    }
    if (!oResp["redirInfo"])
    {
      return;
    }
    sMetodo = oResp["redirInfo"]["metodo"];
    sAction = oResp["redirInfo"]["action"];
    if ("location" == sMetodo)
    {
      if ("parent.parent" == oResp["redirInfo"]["target"])
      {
        parent.parent.location = sAction;
      }
      else if ("parent" == oResp["redirInfo"]["target"])
      {
        parent.location = sAction;
      }
      else if ("_blank" == oResp["redirInfo"]["target"])
      {
        window.open(sAction, "_blank");
      }
      else
      {
        document.location = sAction;
      }
    }
    else if ("html" == sMetodo)
    {
        document.write(scAjaxSpecCharParser(oResp["redirInfo"]["action"]));
    }
    else
    {
      if (oResp["redirInfo"]["target"] == "modal")
      {
          tb_show('', sAction + '?script_case_init=' +  oResp["redirInfo"]["script_case_init"] + '&script_case_session=<?php echo session_id() ?>&nmgp_parms=' + oResp["redirInfo"]["nmgp_parms"] + '&nmgp_outra_jan=true&nmgp_url_saida=modal&NMSC_modal=ok&TB_iframe=true&modal=true&height=' +  oResp["redirInfo"]["h_modal"] + '&width=' + oResp["redirInfo"]["w_modal"], '');
          return;
      }
      sFormRedir = (oResp["redirInfo"]["nmgp_outra_jan"]) ? "form_ajax_redir_1" : "form_ajax_redir_2";
      document.forms[sFormRedir].action           = sAction;
      document.forms[sFormRedir].target           = oResp["redirInfo"]["target"];
      document.forms[sFormRedir].nmgp_parms.value = oResp["redirInfo"]["nmgp_parms"];
      if ("form_ajax_redir_1" == sFormRedir)
      {
        document.forms[sFormRedir].nmgp_outra_jan.value = oResp["redirInfo"]["nmgp_outra_jan"];
      }
      else
      {
        document.forms[sFormRedir].nmgp_url_saida.value   = oResp["redirInfo"]["nmgp_url_saida"];
        document.forms[sFormRedir].script_case_init.value = oResp["redirInfo"]["script_case_init"];
      }
      document.forms[sFormRedir].submit();
    }
  } // scAjaxRedir

  function scAjaxSetDisplay(bReset)
  {
    if (null == bReset)
    {
      bReset = false;
    }
    var aDispData = new Array();
    var aDispCont = {};
    if (bReset)
    {
      for (iDisplay = 0; iDisplay < ajax_block_list.length; iDisplay++)
      {
        aDispCont[ajax_block_list[iDisplay]] = aDispData.length;
        aDispData[aDispData.length] = new Array(ajax_block_id[ajax_block_list[iDisplay]], "on");
      }
      for (iDisplay = 0; iDisplay < ajax_field_list.length; iDisplay++)
      {
        if (ajax_field_id[ajax_field_list[iDisplay]])
        {
          aFieldIds = ajax_field_id[ajax_field_list[iDisplay]];
          for (iDisplay2 = 0; iDisplay2 < aFieldIds.length; iDisplay2++)
          {
            aDispCont[aFieldIds[iDisplay2]] = aDispData.length;
            aDispData[aDispData.length] = new Array(aFieldIds[iDisplay2], "on");
          }
        }
      }
    }
    if (oResp["blockDisplay"])
    {
      for (iDisplay = 0; iDisplay < oResp["blockDisplay"].length; iDisplay++)
      {
        if (bReset)
        {
          aDispData[ aDispCont[ oResp["blockDisplay"][iDisplay][0] ] ][1] = oResp["blockDisplay"][iDisplay][1];
        }
        else
        {
          aDispData[aDispData.length] = new Array(ajax_block_id[ oResp["blockDisplay"][iDisplay][0] ], oResp["blockDisplay"][iDisplay][1]);
        }
      }
    }
    if (oResp["fieldDisplay"])
    {
      for (iDisplay = 0; iDisplay < oResp["fieldDisplay"].length; iDisplay++)
      {
        for (iDisplay2 = 1; iDisplay2 < ajax_field_mult[ oResp["fieldDisplay"][iDisplay][0] ].length; iDisplay2++)
        {
          aFieldIds = ajax_field_id[ ajax_field_mult[ oResp["fieldDisplay"][iDisplay][0] ][iDisplay2] ];
          for (iDisplay3 = 0; iDisplay3 < aFieldIds.length; iDisplay3++)
          {
            if (bReset)
            {
              aDispData[ aDispCont[ aFieldIds[iDisplay3] ] ][1] = oResp["fieldDisplay"][iDisplay][1];
            }
            else
            {
              aDispData[aDispData.length] = new Array(aFieldIds[iDisplay3], oResp["fieldDisplay"][iDisplay][1]);
            }
          }
        }
      }
    }
    if (oResp["buttonDisplay"])
    {
      for (iDisplay = 0; iDisplay < oResp["buttonDisplay"].length; iDisplay++)
      {
        var sBtnName2 = "";
        switch (oResp["buttonDisplay"][iDisplay][0])
        {
          case "first": var sBtnName = "sc_b_ini"; break;
          case "back": var sBtnName = "sc_b_ret"; break;
          case "forward": var sBtnName = "sc_b_avc"; break;
          case "last": var sBtnName = "sc_b_fim"; break;
          case "insert": var sBtnName = "sc_b_ins"; break;
          case "update": var sBtnName = "sc_b_upd"; break;
          case "delete": var sBtnName = "sc_b_del"; break;
          default: var sBtnName = "sc_b_" + oResp["buttonDisplay"][iDisplay][0]; sBtnName2 = "sc_" + oResp["buttonDisplay"][iDisplay][0]; break;
        }
        aDispData[aDispData.length] = new Array(sBtnName, oResp["buttonDisplay"][iDisplay][1]);
        aDispData[aDispData.length] = new Array(sBtnName + "_t", oResp["buttonDisplay"][iDisplay][1]);
        aDispData[aDispData.length] = new Array(sBtnName + "_b", oResp["buttonDisplay"][iDisplay][1]);
        if ("" != sBtnName2)
        {
          aDispData[aDispData.length] = new Array(sBtnName2, oResp["buttonDisplay"][iDisplay][1]);
          aDispData[aDispData.length] = new Array(sBtnName2 + "_top", oResp["buttonDisplay"][iDisplay][1]);
          aDispData[aDispData.length] = new Array(sBtnName2 + "_bot", oResp["buttonDisplay"][iDisplay][1]);
        }
      }
    }
    for (iDisplay = 0; iDisplay < aDispData.length; iDisplay++)
    {
      scAjaxElementDisplay(aDispData[iDisplay][0], aDispData[iDisplay][1]);
    }
  } // scAjaxSetDisplay

  function scAjaxElementDisplay(sElement, sAction)
  {
    sStyle = ("off" == sAction) ? "none" : "";
    if (ajax_block_tab && ajax_block_tab[sElement] && "" != ajax_block_tab[sElement])
    {
      scAjaxElementDisplay(ajax_block_tab[sElement], sAction);
    }
    if (document.getElementById(sElement))
    {
      document.getElementById(sElement).style.display = sStyle;
      if (document.getElementById(sElement + "_dumb"))
      {
        document.getElementById(sElement + "_dumb").style.display = ("off" == sAction) ? "" : "none";
      }
    }
  } // scAjaxElementDisplay

  function scAjaxSetLabel(bReset)
  {
    if (null == bReset)
    {
      bReset = false;
    }
    if (bReset)
    {
      for (iLabel = 0; iLabel < ajax_field_list.length; iLabel++)
      {
        if (ajax_field_list[iLabel] && ajax_error_list[ajax_field_list[iLabel]])
        {
          scAjaxFieldLabel(ajax_field_list[iLabel], ajax_error_list[ajax_field_list[iLabel]]["label"]);
        }
      }
    }
    if (oResp["fieldLabel"])
    {
      for (iLabel = 0; iLabel < oResp["fieldLabel"].length; iLabel++)
      {
        scAjaxFieldLabel(oResp["fieldLabel"][iLabel][0], scAjaxSpecCharParser(oResp["fieldLabel"][iLabel][1]));
      }
    }
  } // scAjaxSetLabel

  function scAjaxFieldLabel(sField, sLabel)
  {
    if (document.getElementById("id_label_" + sField) && document.getElementById("id_label_" + sField).innerHTML != sLabel)
    {
      document.getElementById("id_label_" + sField).innerHTML = sLabel;
    }
  } // scAjaxFieldLabel

  function scAjaxSetReadonly(bReset)
  {
    if (null == bReset)
    {
      bReset = false;
    }
    if (bReset)
    {
      for (iRead = 0; iRead < ajax_field_list.length; iRead++)
      {
        scAjaxFieldRead(ajax_field_list[iRead], ajax_read_only[ajax_field_list[iRead]]);
      }
      for (iRead = 0; iRead < ajax_field_Dt_Hr.length; iRead++)
      {
        scAjaxFieldRead(ajax_field_Dt_Hr[iRead], ajax_read_only[ajax_field_Dt_Hr[iRead]]);
      }
    }
    if (oResp["readOnly"])
    {
      for (iRead = 0; iRead < oResp["readOnly"].length; iRead++)
      {
        if (ajax_read_only[ oResp["readOnly"][iRead][0] ])
        {
          scAjaxFieldRead(oResp["readOnly"][iRead][0], oResp["readOnly"][iRead][1]);
        }
        else if (oResp["rsSize"])
        {
          for (var i = 0; i <= oResp["rsSize"]; i++)
          {
            if (ajax_read_only[ oResp["readOnly"][iRead][0] + i ])
            {
              scAjaxFieldRead(oResp["readOnly"][iRead][0] + i, oResp["readOnly"][iRead][1]);
            }
          }
        }
      }
    }
  } // scAjaxSetReadonly

  function scAjaxFieldRead(sField, sStatus)
  {
    if ("on" == sStatus)
    {
      var sDisplayOff = "none";
      var sDisplayOn  = "";
    }
    else
    {
      var sDisplayOff = "";
      var sDisplayOn  = "none";
    }
    if (document.getElementById("id_read_off_" + sField))
    {
      document.getElementById("id_read_off_" + sField).style.display = sDisplayOff;
    }
    if (document.getElementById("id_read_on_" + sField))
    {
      document.getElementById("id_read_on_" + sField).style.display = sDisplayOn;
    }
  } // scAjaxFieldRead

  function scAjaxSetBtnVars()
  {
    if (oResp["btnVars"])
    {
      for (iBtn = 0; iBtn < oResp["btnVars"].length; iBtn++)
      {
        eval(oResp["btnVars"][iBtn][0] + " = '" + oResp["btnVars"][iBtn][1] + "';");
      }
    }
  } // scAjaxSetBtnVars

  function scAjaxClearText(sFormField)
  {
    document.F1.elements[sFormField].value = "";
  } // scAjaxClearText

  function scAjaxClearLabel(sFormField)
  {
    document.getElementById("id_ajax_label_" + sFormField).innerHTML = "";
  } // scAjaxClearLabel

  function scAjaxClearSelect(sFormField)
  {
    document.F1.elements[sFormField].length = 0;
  } // scAjaxClearSelect

  function scAjaxClearCheckbox(sFormField)
  {
    document.getElementById("idAjaxCheckbox_" + sFormField).innerHTML = "";
  } // scAjaxClearCheckbox

  function scAjaxClearRadio(sFormField)
  {
    document.getElementById("idAjaxRadio_" + sFormField).innerHTML = "";
  } // scAjaxClearRadio

  function scAjaxClearEditorHtml(sFormField)
  {
    var oFormField = tinyMCE.getInstanceById(sFormField);
    oFormField.setContent("");
  } // scAjaxClearEditorHtml

  function scAjaxJavascript()
  {
    if (oResp["ajaxJavascript"])
    {
      var sJsFunc = "";
      for (var i = 0; i < oResp["ajaxJavascript"].length; i++)
      {
        sJsFunc = scAjaxSpecCharParser(oResp["ajaxJavascript"][i][0]);
        if ("" != sJsFunc)
        {
          var aParam = new Array();
          if (oResp["ajaxJavascript"][i][1] && 0 < oResp["ajaxJavascript"][i][1].length)
          {
            for (var j = 0; j < oResp["ajaxJavascript"][i][1].length; j++)
            {
              aParam.push("'" + oResp["ajaxJavascript"][i][1][j] + "'");
            }
          }
          eval("if (" + sJsFunc + ") { " + sJsFunc + "(" + aParam.join(", ") + ") }");
        }
      }
    }
  } // scAjaxJavascript

  function scAjaxAlert()
  {
    if (oResp["ajaxAlert"] && oResp["ajaxAlert"]["message"] && "" != oResp["ajaxAlert"]["message"])
    {
      alert(oResp["ajaxAlert"]["message"]);
    }
  } // scAjaxAlert

  function scAjaxMessage(oTemp)
  {
    if (oTemp && oTemp != null)
    {
        oResp = oTemp;
    }
    if (oResp["ajaxMessage"] && oResp["ajaxMessage"]["message"] && "" != oResp["ajaxMessage"]["message"])
    {
      var sTitle    = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["title"])        ? oResp["ajaxMessage"]["title"]               : scMsgDefTitle,
          bModal    = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["modal"])        ? ("Y" == oResp["ajaxMessage"]["modal"])      : false,
          iTimeout  = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["timeout"])      ? parseInt(oResp["ajaxMessage"]["timeout"])   : 0,
          bButton   = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["button"])       ? ("Y" == oResp["ajaxMessage"]["button"])     : false,
          sButton   = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["button_label"]) ? oResp["ajaxMessage"]["button_label"]        : "Ok",
          iTop      = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["top"])          ? parseInt(oResp["ajaxMessage"]["top"])       : 0,
          iLeft     = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["left"])         ? parseInt(oResp["ajaxMessage"]["left"])      : 0,
          iWidth    = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["width"])        ? parseInt(oResp["ajaxMessage"]["width"])     : 0,
          iHeight   = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["height"])       ? parseInt(oResp["ajaxMessage"]["height"])    : 0,
          bClose    = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["show_close"])   ? ("Y" == oResp["ajaxMessage"]["show_close"]) : true,
          bBodyIcon = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["body_icon"])    ? ("Y" == oResp["ajaxMessage"]["body_icon"])  : true,
          sRedir    = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["redir"])        ? oResp["ajaxMessage"]["redir"]               : "",
          sTarget   = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["redir_target"]) ? oResp["ajaxMessage"]["redir_target"]        : "",
          sParam    = (oResp["ajaxMessage"] && oResp["ajaxMessage"]["redir_par"])    ? oResp["ajaxMessage"]["redir_par"]           : "";
      _scAjaxShowMessage(sTitle, oResp["ajaxMessage"]["message"], bModal, iTimeout, bButton, sButton, iTop, iLeft, iWidth, iHeight, sRedir, sTarget, sParam, bClose, bBodyIcon);
    }
  } // scAjaxAlert

  function scAjaxResponse(sResp)
  {
    eval("var oResp = " + sResp);
    return oResp;
  } // scAjaxResponse

  function scAjaxBreakLine(input)
  {
      if (null == input)
      {
          return "";
      }
      input += "";
      while (input.lastIndexOf(String.fromCharCode(10)) > -1)
      {
         input = input.replace(String.fromCharCode(10), '<br>');
      }
      return input;
  } // scAjaxBreakLine

  function scAjaxProtectBreakLine(input)
  {
      if (null == input)
      {
          return "";
      }
      var input1 = input + "";
      while (input1.lastIndexOf(String.fromCharCode(10)) > -1)
      {
         input1 = input1.replace(String.fromCharCode(10), '#@NM#@');
      }
      return input1;
  } // scAjaxProtectBreakLine

  function scAjaxReturnBreakLine(input)
  {
      if (null == input)
      {
          return "";
      }
      while (input.lastIndexOf('#@NM#@') > -1)
      {
         input = input.replace('#@NM#@', String.fromCharCode(10));
      }
      return input;
  } // scAjaxReturnBreakLine


  // ---------- Validate stddf
  function do_ajax_dye_dyeorder_form_validate_stddf()
  {
    var nomeCampo_stddf = "stddf";
    var var_stddf = scAjaxGetFieldSelect(nomeCampo_stddf);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_stddf(var_stddf, var_script_case_init, do_ajax_dye_dyeorder_form_validate_stddf_cb);
  } // do_ajax_dye_dyeorder_form_validate_stddf

  function do_ajax_dye_dyeorder_form_validate_stddf_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "stddf";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_stddf_cb

  // ---------- Validate p_o_number
  function do_ajax_dye_dyeorder_form_validate_p_o_number()
  {
    var nomeCampo_p_o_number = "p_o_number";
    var var_p_o_number = scAjaxGetFieldHidden(nomeCampo_p_o_number);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_p_o_number(var_p_o_number, var_script_case_init, do_ajax_dye_dyeorder_form_validate_p_o_number_cb);
  } // do_ajax_dye_dyeorder_form_validate_p_o_number

  function do_ajax_dye_dyeorder_form_validate_p_o_number_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "p_o_number";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_p_o_number_cb

  // ---------- Validate date
  function do_ajax_dye_dyeorder_form_validate_date()
  {
    var nomeCampo_date = "date";
    var var_date = scAjaxGetFieldText(nomeCampo_date);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_date(var_date, var_script_case_init, do_ajax_dye_dyeorder_form_validate_date_cb);
  } // do_ajax_dye_dyeorder_form_validate_date

  function do_ajax_dye_dyeorder_form_validate_date_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "date";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_date_cb

  // ---------- Validate status
  function do_ajax_dye_dyeorder_form_validate_status()
  {
    var nomeCampo_status = "status";
    var var_status = scAjaxGetFieldSelect(nomeCampo_status);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_status(var_status, var_script_case_init, do_ajax_dye_dyeorder_form_validate_status_cb);
  } // do_ajax_dye_dyeorder_form_validate_status

  function do_ajax_dye_dyeorder_form_validate_status_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "status";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_status_cb

  // ---------- Validate dyer2
  function do_ajax_dye_dyeorder_form_validate_dyer2()
  {
    var nomeCampo_dyer2 = "dyer2";
    var var_dyer2 = scAjaxGetFieldSelect(nomeCampo_dyer2);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_dyer2(var_dyer2, var_script_case_init, do_ajax_dye_dyeorder_form_validate_dyer2_cb);
  } // do_ajax_dye_dyeorder_form_validate_dyer2

  function do_ajax_dye_dyeorder_form_validate_dyer2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "dyer2";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_dyer2_cb

  // ---------- Validate knitter2
  function do_ajax_dye_dyeorder_form_validate_knitter2()
  {
    var nomeCampo_knitter2 = "knitter2";
    var var_knitter2 = scAjaxGetFieldSelect(nomeCampo_knitter2);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_knitter2(var_knitter2, var_script_case_init, do_ajax_dye_dyeorder_form_validate_knitter2_cb);
  } // do_ajax_dye_dyeorder_form_validate_knitter2

  function do_ajax_dye_dyeorder_form_validate_knitter2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "knitter2";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_knitter2_cb

  // ---------- Validate gs2
  function do_ajax_dye_dyeorder_form_validate_gs2()
  {
    var nomeCampo_gs2 = "gs2";
    var var_gs2 = scAjaxGetFieldSelect(nomeCampo_gs2);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_gs2(var_gs2, var_script_case_init, do_ajax_dye_dyeorder_form_validate_gs2_cb);
  } // do_ajax_dye_dyeorder_form_validate_gs2

  function do_ajax_dye_dyeorder_form_validate_gs2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gs2";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_gs2_cb

  // ---------- Validate dyer
  function do_ajax_dye_dyeorder_form_validate_dyer()
  {
    var nomeCampo_dyer = "dyer";
    var var_dyer = scAjaxGetFieldText(nomeCampo_dyer);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_dyer(var_dyer, var_script_case_init, do_ajax_dye_dyeorder_form_validate_dyer_cb);
  } // do_ajax_dye_dyeorder_form_validate_dyer

  function do_ajax_dye_dyeorder_form_validate_dyer_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "dyer";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_dyer_cb

  // ---------- Validate knitter
  function do_ajax_dye_dyeorder_form_validate_knitter()
  {
    var nomeCampo_knitter = "knitter";
    var var_knitter = scAjaxGetFieldText(nomeCampo_knitter);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_knitter(var_knitter, var_script_case_init, do_ajax_dye_dyeorder_form_validate_knitter_cb);
  } // do_ajax_dye_dyeorder_form_validate_knitter

  function do_ajax_dye_dyeorder_form_validate_knitter_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "knitter";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_knitter_cb

  // ---------- Validate gs
  function do_ajax_dye_dyeorder_form_validate_gs()
  {
    var nomeCampo_gs = "gs";
    var var_gs = scAjaxGetFieldText(nomeCampo_gs);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_gs(var_gs, var_script_case_init, do_ajax_dye_dyeorder_form_validate_gs_cb);
  } // do_ajax_dye_dyeorder_form_validate_gs

  function do_ajax_dye_dyeorder_form_validate_gs_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gs";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_gs_cb

  // ---------- Validate ggd
  function do_ajax_dye_dyeorder_form_validate_ggd()
  {
    var nomeCampo_ggd = "ggd";
    var var_ggd = scAjaxGetFieldText(nomeCampo_ggd);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_ggd(var_ggd, var_script_case_init, do_ajax_dye_dyeorder_form_validate_ggd_cb);
  } // do_ajax_dye_dyeorder_form_validate_ggd

  function do_ajax_dye_dyeorder_form_validate_ggd_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "ggd";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_ggd_cb

  // ---------- Validate fs
  function do_ajax_dye_dyeorder_form_validate_fs()
  {
    var nomeCampo_fs = "fs";
    var var_fs = scAjaxGetFieldText(nomeCampo_fs);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_fs(var_fs, var_script_case_init, do_ajax_dye_dyeorder_form_validate_fs_cb);
  } // do_ajax_dye_dyeorder_form_validate_fs

  function do_ajax_dye_dyeorder_form_validate_fs_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "fs";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_fs_cb

  // ---------- Validate greige_wi
  function do_ajax_dye_dyeorder_form_validate_greige_wi()
  {
    var nomeCampo_greige_wi = "greige_wi";
    var var_greige_wi = scAjaxGetFieldText(nomeCampo_greige_wi);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_greige_wi(var_greige_wi, var_script_case_init, do_ajax_dye_dyeorder_form_validate_greige_wi_cb);
  } // do_ajax_dye_dyeorder_form_validate_greige_wi

  function do_ajax_dye_dyeorder_form_validate_greige_wi_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "greige_wi";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_greige_wi_cb

  // ---------- Validate put_up
  function do_ajax_dye_dyeorder_form_validate_put_up()
  {
    var nomeCampo_put_up = "put_up";
    var var_put_up = scAjaxGetFieldText(nomeCampo_put_up);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_put_up(var_put_up, var_script_case_init, do_ajax_dye_dyeorder_form_validate_put_up_cb);
  } // do_ajax_dye_dyeorder_form_validate_put_up

  function do_ajax_dye_dyeorder_form_validate_put_up_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "put_up";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_put_up_cb

  // ---------- Validate price_lb_d
  function do_ajax_dye_dyeorder_form_validate_price_lb_d()
  {
    var nomeCampo_price_lb_d = "price_lb_d";
    var var_price_lb_d = scAjaxGetFieldText(nomeCampo_price_lb_d);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_price_lb_d(var_price_lb_d, var_script_case_init, do_ajax_dye_dyeorder_form_validate_price_lb_d_cb);
  } // do_ajax_dye_dyeorder_form_validate_price_lb_d

  function do_ajax_dye_dyeorder_form_validate_price_lb_d_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "price_lb_d";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_price_lb_d_cb

  // ---------- Validate ydsalloc
  function do_ajax_dye_dyeorder_form_validate_ydsalloc()
  {
    var nomeCampo_ydsalloc = "ydsalloc";
    var var_ydsalloc = scAjaxGetFieldText(nomeCampo_ydsalloc);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_ydsalloc(var_ydsalloc, var_script_case_init, do_ajax_dye_dyeorder_form_validate_ydsalloc_cb);
  } // do_ajax_dye_dyeorder_form_validate_ydsalloc

  function do_ajax_dye_dyeorder_form_validate_ydsalloc_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "ydsalloc";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_ydsalloc_cb

  // ---------- Validate lbsalloc
  function do_ajax_dye_dyeorder_form_validate_lbsalloc()
  {
    var nomeCampo_lbsalloc = "lbsalloc";
    var var_lbsalloc = scAjaxGetFieldText(nomeCampo_lbsalloc);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_lbsalloc(var_lbsalloc, var_script_case_init, do_ajax_dye_dyeorder_form_validate_lbsalloc_cb);
  } // do_ajax_dye_dyeorder_form_validate_lbsalloc

  function do_ajax_dye_dyeorder_form_validate_lbsalloc_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "lbsalloc";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_lbsalloc_cb

  // ---------- Validate desc1
  function do_ajax_dye_dyeorder_form_validate_desc1()
  {
    var nomeCampo_desc1 = "desc1";
    var var_desc1 = scAjaxGetFieldText(nomeCampo_desc1);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_desc1(var_desc1, var_script_case_init, do_ajax_dye_dyeorder_form_validate_desc1_cb);
  } // do_ajax_dye_dyeorder_form_validate_desc1

  function do_ajax_dye_dyeorder_form_validate_desc1_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "desc1";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_desc1_cb

  // ---------- Validate desc2
  function do_ajax_dye_dyeorder_form_validate_desc2()
  {
    var nomeCampo_desc2 = "desc2";
    var var_desc2 = scAjaxGetFieldText(nomeCampo_desc2);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_desc2(var_desc2, var_script_case_init, do_ajax_dye_dyeorder_form_validate_desc2_cb);
  } // do_ajax_dye_dyeorder_form_validate_desc2

  function do_ajax_dye_dyeorder_form_validate_desc2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "desc2";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_desc2_cb

  // ---------- Validate color
  function do_ajax_dye_dyeorder_form_validate_color()
  {
    var nomeCampo_color = "color";
    var var_color = scAjaxGetFieldText(nomeCampo_color);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_color(var_color, var_script_case_init, do_ajax_dye_dyeorder_form_validate_color_cb);
  } // do_ajax_dye_dyeorder_form_validate_color

  function do_ajax_dye_dyeorder_form_validate_color_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "color";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_color_cb

  // ---------- Validate color_numb
  function do_ajax_dye_dyeorder_form_validate_color_numb()
  {
    var nomeCampo_color_numb = "color_numb";
    var var_color_numb = scAjaxGetFieldText(nomeCampo_color_numb);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_color_numb(var_color_numb, var_script_case_init, do_ajax_dye_dyeorder_form_validate_color_numb_cb);
  } // do_ajax_dye_dyeorder_form_validate_color_numb

  function do_ajax_dye_dyeorder_form_validate_color_numb_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "color_numb";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_color_numb_cb

  // ---------- Validate finish
  function do_ajax_dye_dyeorder_form_validate_finish()
  {
    var nomeCampo_finish = "finish";
    var var_finish = scAjaxGetFieldText(nomeCampo_finish);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_finish(var_finish, var_script_case_init, do_ajax_dye_dyeorder_form_validate_finish_cb);
  } // do_ajax_dye_dyeorder_form_validate_finish

  function do_ajax_dye_dyeorder_form_validate_finish_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "finish";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_finish_cb

  // ---------- Validate finish_no
  function do_ajax_dye_dyeorder_form_validate_finish_no()
  {
    var nomeCampo_finish_no = "finish_no";
    var var_finish_no = scAjaxGetFieldText(nomeCampo_finish_no);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_finish_no(var_finish_no, var_script_case_init, do_ajax_dye_dyeorder_form_validate_finish_no_cb);
  } // do_ajax_dye_dyeorder_form_validate_finish_no

  function do_ajax_dye_dyeorder_form_validate_finish_no_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "finish_no";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_finish_no_cb

  // ---------- Validate finno
  function do_ajax_dye_dyeorder_form_validate_finno()
  {
    var nomeCampo_finno = "finno";
    var var_finno = scAjaxGetFieldSelect(nomeCampo_finno);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_finno(var_finno, var_script_case_init, do_ajax_dye_dyeorder_form_validate_finno_cb);
  } // do_ajax_dye_dyeorder_form_validate_finno

  function do_ajax_dye_dyeorder_form_validate_finno_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "finno";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_finno_cb

  // ---------- Validate fin_no
  function do_ajax_dye_dyeorder_form_validate_fin_no()
  {
    var nomeCampo_fin_no = "fin_no";
    var var_fin_no = scAjaxGetFieldText(nomeCampo_fin_no);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_fin_no(var_fin_no, var_script_case_init, do_ajax_dye_dyeorder_form_validate_fin_no_cb);
  } // do_ajax_dye_dyeorder_form_validate_fin_no

  function do_ajax_dye_dyeorder_form_validate_fin_no_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "fin_no";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_fin_no_cb

  // ---------- Validate frame
  function do_ajax_dye_dyeorder_form_validate_frame()
  {
    var nomeCampo_frame = "frame";
    var var_frame = scAjaxGetFieldText(nomeCampo_frame);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_frame(var_frame, var_script_case_init, do_ajax_dye_dyeorder_form_validate_frame_cb);
  } // do_ajax_dye_dyeorder_form_validate_frame

  function do_ajax_dye_dyeorder_form_validate_frame_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "frame";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_frame_cb

  // ---------- Validate panels
  function do_ajax_dye_dyeorder_form_validate_panels()
  {
    var nomeCampo_panels = "panels";
    var var_panels = scAjaxGetFieldText(nomeCampo_panels);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_panels(var_panels, var_script_case_init, do_ajax_dye_dyeorder_form_validate_panels_cb);
  } // do_ajax_dye_dyeorder_form_validate_panels

  function do_ajax_dye_dyeorder_form_validate_panels_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "panels";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_panels_cb

  // ---------- Validate fwidth
  function do_ajax_dye_dyeorder_form_validate_fwidth()
  {
    var nomeCampo_fwidth = "fwidth";
    var var_fwidth = scAjaxGetFieldText(nomeCampo_fwidth);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_fwidth(var_fwidth, var_script_case_init, do_ajax_dye_dyeorder_form_validate_fwidth_cb);
  } // do_ajax_dye_dyeorder_form_validate_fwidth

  function do_ajax_dye_dyeorder_form_validate_fwidth_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "fwidth";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_fwidth_cb

  // ---------- Validate cpi
  function do_ajax_dye_dyeorder_form_validate_cpi()
  {
    var nomeCampo_cpi = "cpi";
    var var_cpi = scAjaxGetFieldText(nomeCampo_cpi);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_cpi(var_cpi, var_script_case_init, do_ajax_dye_dyeorder_form_validate_cpi_cb);
  } // do_ajax_dye_dyeorder_form_validate_cpi

  function do_ajax_dye_dyeorder_form_validate_cpi_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "cpi";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_cpi_cb

  // ---------- Validate wpi
  function do_ajax_dye_dyeorder_form_validate_wpi()
  {
    var nomeCampo_wpi = "wpi";
    var var_wpi = scAjaxGetFieldText(nomeCampo_wpi);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_wpi(var_wpi, var_script_case_init, do_ajax_dye_dyeorder_form_validate_wpi_cb);
  } // do_ajax_dye_dyeorder_form_validate_wpi

  function do_ajax_dye_dyeorder_form_validate_wpi_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "wpi";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_wpi_cb

  // ---------- Validate req_fin_wt
  function do_ajax_dye_dyeorder_form_validate_req_fin_wt()
  {
    var nomeCampo_req_fin_wt = "req_fin_wt";
    var var_req_fin_wt = scAjaxGetFieldText(nomeCampo_req_fin_wt);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_req_fin_wt(var_req_fin_wt, var_script_case_init, do_ajax_dye_dyeorder_form_validate_req_fin_wt_cb);
  } // do_ajax_dye_dyeorder_form_validate_req_fin_wt

  function do_ajax_dye_dyeorder_form_validate_req_fin_wt_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "req_fin_wt";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_req_fin_wt_cb

  // ---------- Validate req_gr_yld
  function do_ajax_dye_dyeorder_form_validate_req_gr_yld()
  {
    var nomeCampo_req_gr_yld = "req_gr_yld";
    var var_req_gr_yld = scAjaxGetFieldText(nomeCampo_req_gr_yld);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_req_gr_yld(var_req_gr_yld, var_script_case_init, do_ajax_dye_dyeorder_form_validate_req_gr_yld_cb);
  } // do_ajax_dye_dyeorder_form_validate_req_gr_yld

  function do_ajax_dye_dyeorder_form_validate_req_gr_yld_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "req_gr_yld";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_req_gr_yld_cb

  // ---------- Validate spec1
  function do_ajax_dye_dyeorder_form_validate_spec1()
  {
    var nomeCampo_spec1 = "spec1";
    var var_spec1 = scAjaxGetFieldText(nomeCampo_spec1);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_spec1(var_spec1, var_script_case_init, do_ajax_dye_dyeorder_form_validate_spec1_cb);
  } // do_ajax_dye_dyeorder_form_validate_spec1

  function do_ajax_dye_dyeorder_form_validate_spec1_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "spec1";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_spec1_cb

  // ---------- Validate spec2
  function do_ajax_dye_dyeorder_form_validate_spec2()
  {
    var nomeCampo_spec2 = "spec2";
    var var_spec2 = scAjaxGetFieldText(nomeCampo_spec2);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_spec2(var_spec2, var_script_case_init, do_ajax_dye_dyeorder_form_validate_spec2_cb);
  } // do_ajax_dye_dyeorder_form_validate_spec2

  function do_ajax_dye_dyeorder_form_validate_spec2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "spec2";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_spec2_cb

  // ---------- Validate spec3
  function do_ajax_dye_dyeorder_form_validate_spec3()
  {
    var nomeCampo_spec3 = "spec3";
    var var_spec3 = scAjaxGetFieldText(nomeCampo_spec3);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_spec3(var_spec3, var_script_case_init, do_ajax_dye_dyeorder_form_validate_spec3_cb);
  } // do_ajax_dye_dyeorder_form_validate_spec3

  function do_ajax_dye_dyeorder_form_validate_spec3_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "spec3";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_spec3_cb

  // ---------- Validate cost_lb_d
  function do_ajax_dye_dyeorder_form_validate_cost_lb_d()
  {
    var nomeCampo_cost_lb_d = "cost_lb_d";
    var var_cost_lb_d = scAjaxGetFieldText(nomeCampo_cost_lb_d);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_cost_lb_d(var_cost_lb_d, var_script_case_init, do_ajax_dye_dyeorder_form_validate_cost_lb_d_cb);
  } // do_ajax_dye_dyeorder_form_validate_cost_lb_d

  function do_ajax_dye_dyeorder_form_validate_cost_lb_d_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "cost_lb_d";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_cost_lb_d_cb

  // ---------- Validate dye_cost
  function do_ajax_dye_dyeorder_form_validate_dye_cost()
  {
    var nomeCampo_dye_cost = "dye_cost";
    var var_dye_cost = scAjaxGetFieldText(nomeCampo_dye_cost);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_dye_cost(var_dye_cost, var_script_case_init, do_ajax_dye_dyeorder_form_validate_dye_cost_cb);
  } // do_ajax_dye_dyeorder_form_validate_dye_cost

  function do_ajax_dye_dyeorder_form_validate_dye_cost_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "dye_cost";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_dye_cost_cb

  // ---------- Validate gr_lbs_o
  function do_ajax_dye_dyeorder_form_validate_gr_lbs_o()
  {
    var nomeCampo_gr_lbs_o = "gr_lbs_o";
    var var_gr_lbs_o = scAjaxGetFieldText(nomeCampo_gr_lbs_o);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_gr_lbs_o(var_gr_lbs_o, var_script_case_init, do_ajax_dye_dyeorder_form_validate_gr_lbs_o_cb);
  } // do_ajax_dye_dyeorder_form_validate_gr_lbs_o

  function do_ajax_dye_dyeorder_form_validate_gr_lbs_o_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gr_lbs_o";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_gr_lbs_o_cb

  // ---------- Validate gr_lbs_d
  function do_ajax_dye_dyeorder_form_validate_gr_lbs_d()
  {
    var nomeCampo_gr_lbs_d = "gr_lbs_d";
    var var_gr_lbs_d = scAjaxGetFieldText(nomeCampo_gr_lbs_d);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_gr_lbs_d(var_gr_lbs_d, var_script_case_init, do_ajax_dye_dyeorder_form_validate_gr_lbs_d_cb);
  } // do_ajax_dye_dyeorder_form_validate_gr_lbs_d

  function do_ajax_dye_dyeorder_form_validate_gr_lbs_d_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gr_lbs_d";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_gr_lbs_d_cb

  // ---------- Validate gr_lbs_op
  function do_ajax_dye_dyeorder_form_validate_gr_lbs_op()
  {
    var nomeCampo_gr_lbs_op = "gr_lbs_op";
    var var_gr_lbs_op = scAjaxGetFieldText(nomeCampo_gr_lbs_op);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_gr_lbs_op(var_gr_lbs_op, var_script_case_init, do_ajax_dye_dyeorder_form_validate_gr_lbs_op_cb);
  } // do_ajax_dye_dyeorder_form_validate_gr_lbs_op

  function do_ajax_dye_dyeorder_form_validate_gr_lbs_op_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gr_lbs_op";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_gr_lbs_op_cb

  // ---------- Validate fin_lbs
  function do_ajax_dye_dyeorder_form_validate_fin_lbs()
  {
    var nomeCampo_fin_lbs = "fin_lbs";
    var var_fin_lbs = scAjaxGetFieldText(nomeCampo_fin_lbs);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_fin_lbs(var_fin_lbs, var_script_case_init, do_ajax_dye_dyeorder_form_validate_fin_lbs_cb);
  } // do_ajax_dye_dyeorder_form_validate_fin_lbs

  function do_ajax_dye_dyeorder_form_validate_fin_lbs_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "fin_lbs";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_fin_lbs_cb

  // ---------- Validate work_loss
  function do_ajax_dye_dyeorder_form_validate_work_loss()
  {
    var nomeCampo_work_loss = "work_loss";
    var var_work_loss = scAjaxGetFieldText(nomeCampo_work_loss);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_work_loss(var_work_loss, var_script_case_init, do_ajax_dye_dyeorder_form_validate_work_loss_cb);
  } // do_ajax_dye_dyeorder_form_validate_work_loss

  function do_ajax_dye_dyeorder_form_validate_work_loss_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "work_loss";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_work_loss_cb

  // ---------- Validate cost_lb_g
  function do_ajax_dye_dyeorder_form_validate_cost_lb_g()
  {
    var nomeCampo_cost_lb_g = "cost_lb_g";
    var var_cost_lb_g = scAjaxGetFieldText(nomeCampo_cost_lb_g);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_cost_lb_g(var_cost_lb_g, var_script_case_init, do_ajax_dye_dyeorder_form_validate_cost_lb_g_cb);
  } // do_ajax_dye_dyeorder_form_validate_cost_lb_g

  function do_ajax_dye_dyeorder_form_validate_cost_lb_g_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "cost_lb_g";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_cost_lb_g_cb

  // ---------- Validate est_yards
  function do_ajax_dye_dyeorder_form_validate_est_yards()
  {
    var nomeCampo_est_yards = "est_yards";
    var var_est_yards = scAjaxGetFieldText(nomeCampo_est_yards);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_est_yards(var_est_yards, var_script_case_init, do_ajax_dye_dyeorder_form_validate_est_yards_cb);
  } // do_ajax_dye_dyeorder_form_validate_est_yards

  function do_ajax_dye_dyeorder_form_validate_est_yards_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "est_yards";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_est_yards_cb

  // ---------- Validate yards_recd
  function do_ajax_dye_dyeorder_form_validate_yards_recd()
  {
    var nomeCampo_yards_recd = "yards_recd";
    var var_yards_recd = scAjaxGetFieldText(nomeCampo_yards_recd);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_yards_recd(var_yards_recd, var_script_case_init, do_ajax_dye_dyeorder_form_validate_yards_recd_cb);
  } // do_ajax_dye_dyeorder_form_validate_yards_recd

  function do_ajax_dye_dyeorder_form_validate_yards_recd_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "yards_recd";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_yards_recd_cb

  // ---------- Validate cost_lb_t
  function do_ajax_dye_dyeorder_form_validate_cost_lb_t()
  {
    var nomeCampo_cost_lb_t = "cost_lb_t";
    var var_cost_lb_t = scAjaxGetFieldText(nomeCampo_cost_lb_t);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_cost_lb_t(var_cost_lb_t, var_script_case_init, do_ajax_dye_dyeorder_form_validate_cost_lb_t_cb);
  } // do_ajax_dye_dyeorder_form_validate_cost_lb_t

  function do_ajax_dye_dyeorder_form_validate_cost_lb_t_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "cost_lb_t";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_cost_lb_t_cb

  // ---------- Validate gr_yield
  function do_ajax_dye_dyeorder_form_validate_gr_yield()
  {
    var nomeCampo_gr_yield = "gr_yield";
    var var_gr_yield = scAjaxGetFieldText(nomeCampo_gr_yield);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_gr_yield(var_gr_yield, var_script_case_init, do_ajax_dye_dyeorder_form_validate_gr_yield_cb);
  } // do_ajax_dye_dyeorder_form_validate_gr_yield

  function do_ajax_dye_dyeorder_form_validate_gr_yield_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gr_yield";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_gr_yield_cb

  // ---------- Validate cost_yd_t
  function do_ajax_dye_dyeorder_form_validate_cost_yd_t()
  {
    var nomeCampo_cost_yd_t = "cost_yd_t";
    var var_cost_yd_t = scAjaxGetFieldText(nomeCampo_cost_yd_t);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_cost_yd_t(var_cost_yd_t, var_script_case_init, do_ajax_dye_dyeorder_form_validate_cost_yd_t_cb);
  } // do_ajax_dye_dyeorder_form_validate_cost_yd_t

  function do_ajax_dye_dyeorder_form_validate_cost_yd_t_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "cost_yd_t";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_cost_yd_t_cb

  // ---------- Validate gr_value
  function do_ajax_dye_dyeorder_form_validate_gr_value()
  {
    var nomeCampo_gr_value = "gr_value";
    var var_gr_value = scAjaxGetFieldText(nomeCampo_gr_value);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_gr_value(var_gr_value, var_script_case_init, do_ajax_dye_dyeorder_form_validate_gr_value_cb);
  } // do_ajax_dye_dyeorder_form_validate_gr_value

  function do_ajax_dye_dyeorder_form_validate_gr_value_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gr_value";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_gr_value_cb

  // ---------- Validate sld
  function do_ajax_dye_dyeorder_form_validate_sld()
  {
    var nomeCampo_sld = "sld";
    var var_sld = scAjaxGetFieldText(nomeCampo_sld);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_sld(var_sld, var_script_case_init, do_ajax_dye_dyeorder_form_validate_sld_cb);
  } // do_ajax_dye_dyeorder_form_validate_sld

  function do_ajax_dye_dyeorder_form_validate_sld_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "sld";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_sld_cb

  // ---------- Validate she
  function do_ajax_dye_dyeorder_form_validate_she()
  {
    var nomeCampo_she = "she";
    var var_she = scAjaxGetFieldText(nomeCampo_she);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_she(var_she, var_script_case_init, do_ajax_dye_dyeorder_form_validate_she_cb);
  } // do_ajax_dye_dyeorder_form_validate_she

  function do_ajax_dye_dyeorder_form_validate_she_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "she";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_she_cb

  // ---------- Validate ld1
  function do_ajax_dye_dyeorder_form_validate_ld1()
  {
    var nomeCampo_ld1 = "ld1";
    var var_ld1 = scAjaxGetFieldText(nomeCampo_ld1);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_ld1(var_ld1, var_script_case_init, do_ajax_dye_dyeorder_form_validate_ld1_cb);
  } // do_ajax_dye_dyeorder_form_validate_ld1

  function do_ajax_dye_dyeorder_form_validate_ld1_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "ld1";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_ld1_cb

  // ---------- Validate he1
  function do_ajax_dye_dyeorder_form_validate_he1()
  {
    var nomeCampo_he1 = "he1";
    var var_he1 = scAjaxGetFieldText(nomeCampo_he1);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_he1(var_he1, var_script_case_init, do_ajax_dye_dyeorder_form_validate_he1_cb);
  } // do_ajax_dye_dyeorder_form_validate_he1

  function do_ajax_dye_dyeorder_form_validate_he1_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "he1";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_he1_cb

  // ---------- Validate ld2
  function do_ajax_dye_dyeorder_form_validate_ld2()
  {
    var nomeCampo_ld2 = "ld2";
    var var_ld2 = scAjaxGetFieldText(nomeCampo_ld2);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_ld2(var_ld2, var_script_case_init, do_ajax_dye_dyeorder_form_validate_ld2_cb);
  } // do_ajax_dye_dyeorder_form_validate_ld2

  function do_ajax_dye_dyeorder_form_validate_ld2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "ld2";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_ld2_cb

  // ---------- Validate he2
  function do_ajax_dye_dyeorder_form_validate_he2()
  {
    var nomeCampo_he2 = "he2";
    var var_he2 = scAjaxGetFieldText(nomeCampo_he2);
    var var_script_case_init = document.F1.script_case_init.value;
    x_ajax_dye_dyeorder_form_validate_he2(var_he2, var_script_case_init, do_ajax_dye_dyeorder_form_validate_he2_cb);
  } // do_ajax_dye_dyeorder_form_validate_he2

  function do_ajax_dye_dyeorder_form_validate_he2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    sFieldValid = "he2";
    scAjaxUpdateFieldErrors(sFieldValid, "valid");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      var sImgStatus = sc_img_status_ok;
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      var sImgStatus = sc_img_status_err;
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    var $oImg = $('#id_sc_status_' + sFieldValid);
    if (0 < $oImg.length)
    {
      $oImg.attr('src', sImgStatus).css('display', '');
    }
    scAjaxShowDebug();
    scAjaxSetMaster();
    scAjaxSetFocus();
  } // do_ajax_dye_dyeorder_form_validate_he2_cb

  // ---------- Event onchange dyer2
  function do_ajax_dye_dyeorder_form_event_dyer2_onchange()
  {
    var var_dyer = scAjaxGetFieldText("dyer");
    var var_dyer2 = scAjaxGetFieldSelect("dyer2");
    var var_script_case_init = document.F2.script_case_init.value;
    scAjaxProcOn(true);
    x_ajax_dye_dyeorder_form_event_dyer2_onchange(var_dyer, var_dyer2, var_script_case_init, do_ajax_dye_dyeorder_form_event_dyer2_onchange_cb);
  } // do_ajax_dye_dyeorder_form_event_dyer2_onchange

  function do_ajax_dye_dyeorder_form_event_dyer2_onchange_cb(sResp)
  {
    scAjaxProcOff(true);
    oResp = scAjaxResponse(sResp);
    sFieldValid = "dyer2";
    scAjaxUpdateFieldErrors(sFieldValid, "onchange");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    if (!scAjaxHasError())
    {
      scAjaxSetFields();
    }
    scAjaxShowDebug();
    scAjaxSetDisplay();
    scAjaxSetLabel();
    scAjaxSetReadonly();
    scAjaxSetMaster();
    scAjaxAlert();
    scAjaxMessage();
    scAjaxJavascript();
    scAjaxSetFocus();
    scAjaxRedir();
  } // do_ajax_dye_dyeorder_form_event_dyer2_onchange_cb

  // ---------- Event onchange finno
  function do_ajax_dye_dyeorder_form_event_finno_onchange()
  {
    var var_finno = scAjaxGetFieldSelect("finno");
    var var_finish_no = scAjaxGetFieldText("finish_no");
    var var_finish = scAjaxGetFieldText("finish");
    var var_script_case_init = document.F2.script_case_init.value;
    scAjaxProcOn(true);
    x_ajax_dye_dyeorder_form_event_finno_onchange(var_finno, var_finish_no, var_finish, var_script_case_init, do_ajax_dye_dyeorder_form_event_finno_onchange_cb);
  } // do_ajax_dye_dyeorder_form_event_finno_onchange

  function do_ajax_dye_dyeorder_form_event_finno_onchange_cb(sResp)
  {
    scAjaxProcOff(true);
    oResp = scAjaxResponse(sResp);
    sFieldValid = "finno";
    scAjaxUpdateFieldErrors(sFieldValid, "onchange");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    if (!scAjaxHasError())
    {
      scAjaxSetFields();
    }
    scAjaxShowDebug();
    scAjaxSetDisplay();
    scAjaxSetLabel();
    scAjaxSetReadonly();
    scAjaxSetMaster();
    scAjaxAlert();
    scAjaxMessage();
    scAjaxJavascript();
    scAjaxSetFocus();
    scAjaxRedir();
  } // do_ajax_dye_dyeorder_form_event_finno_onchange_cb

  // ---------- Event onchange knitter2
  function do_ajax_dye_dyeorder_form_event_knitter2_onchange()
  {
    var var_knitter = scAjaxGetFieldText("knitter");
    var var_knitter2 = scAjaxGetFieldSelect("knitter2");
    var var_script_case_init = document.F2.script_case_init.value;
    scAjaxProcOn(true);
    x_ajax_dye_dyeorder_form_event_knitter2_onchange(var_knitter, var_knitter2, var_script_case_init, do_ajax_dye_dyeorder_form_event_knitter2_onchange_cb);
  } // do_ajax_dye_dyeorder_form_event_knitter2_onchange

  function do_ajax_dye_dyeorder_form_event_knitter2_onchange_cb(sResp)
  {
    scAjaxProcOff(true);
    oResp = scAjaxResponse(sResp);
    sFieldValid = "knitter2";
    scAjaxUpdateFieldErrors(sFieldValid, "onchange");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    if (!scAjaxHasError())
    {
      scAjaxSetFields();
    }
    scAjaxShowDebug();
    scAjaxSetDisplay();
    scAjaxSetLabel();
    scAjaxSetReadonly();
    scAjaxSetMaster();
    scAjaxAlert();
    scAjaxMessage();
    scAjaxJavascript();
    scAjaxSetFocus();
    scAjaxRedir();
  } // do_ajax_dye_dyeorder_form_event_knitter2_onchange_cb

  // ---------- Event onchange stddf
  function do_ajax_dye_dyeorder_form_event_stddf_onchange()
  {
    var var_stddf = scAjaxGetFieldSelect("stddf");
    var var_frame = scAjaxGetFieldText("frame");
    var var_fwidth = scAjaxGetFieldText("fwidth");
    var var_panels = scAjaxGetFieldText("panels");
    var var_cpi = scAjaxGetFieldText("cpi");
    var var_wpi = scAjaxGetFieldText("wpi");
    var var_req_gr_yld = scAjaxGetFieldText("req_gr_yld");
    var var_req_fin_wt = scAjaxGetFieldText("req_fin_wt");
    var var_finish = scAjaxGetFieldText("finish");
    var var_finish_no = scAjaxGetFieldText("finish_no");
    var var_put_up = scAjaxGetFieldText("put_up");
    var var_spec1 = scAjaxGetFieldText("spec1");
    var var_spec2 = scAjaxGetFieldText("spec2");
    var var_spec3 = scAjaxGetFieldText("spec3");
    var var_script_case_init = document.F2.script_case_init.value;
    scAjaxProcOn(true);
    x_ajax_dye_dyeorder_form_event_stddf_onchange(var_stddf, var_frame, var_fwidth, var_panels, var_cpi, var_wpi, var_req_gr_yld, var_req_fin_wt, var_finish, var_finish_no, var_put_up, var_spec1, var_spec2, var_spec3, var_script_case_init, do_ajax_dye_dyeorder_form_event_stddf_onchange_cb);
  } // do_ajax_dye_dyeorder_form_event_stddf_onchange

  function do_ajax_dye_dyeorder_form_event_stddf_onchange_cb(sResp)
  {
    scAjaxProcOff(true);
    oResp = scAjaxResponse(sResp);
    sFieldValid = "stddf";
    scAjaxUpdateFieldErrors(sFieldValid, "onchange");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    if (!scAjaxHasError())
    {
      scAjaxSetFields();
    }
    scAjaxShowDebug();
    scAjaxSetDisplay();
    scAjaxSetLabel();
    scAjaxSetReadonly();
    scAjaxSetMaster();
    scAjaxAlert();
    scAjaxMessage();
    scAjaxJavascript();
    scAjaxSetFocus();
    scAjaxRedir();
  } // do_ajax_dye_dyeorder_form_event_stddf_onchange_cb

  // ---------- Event onchange gs2
  function do_ajax_dye_dyeorder_form_event_gs2_onchange()
  {
    var var_gs2 = scAjaxGetFieldSelect("gs2");
    var var_greige_wi = scAjaxGetFieldText("greige_wi");
    var var_gs = scAjaxGetFieldText("gs");
    var var_script_case_init = document.F2.script_case_init.value;
    scAjaxProcOn(true);
    x_ajax_dye_dyeorder_form_event_gs2_onchange(var_gs2, var_greige_wi, var_gs, var_script_case_init, do_ajax_dye_dyeorder_form_event_gs2_onchange_cb);
  } // do_ajax_dye_dyeorder_form_event_gs2_onchange

  function do_ajax_dye_dyeorder_form_event_gs2_onchange_cb(sResp)
  {
    scAjaxProcOff(true);
    oResp = scAjaxResponse(sResp);
    sFieldValid = "gs2";
    scAjaxUpdateFieldErrors(sFieldValid, "onchange");
    sFieldErrors = scAjaxListFieldErrors(sFieldValid, false);
    if ("" == sFieldErrors)
    {
      scAjaxHideErrorDisplay(sFieldValid);
    }
    else
    {
      scAjaxShowErrorDisplay(sFieldValid, sFieldErrors);
    }
    if (!scAjaxHasError())
    {
      scAjaxSetFields();
    }
    scAjaxShowDebug();
    scAjaxSetDisplay();
    scAjaxSetLabel();
    scAjaxSetReadonly();
    scAjaxSetMaster();
    scAjaxAlert();
    scAjaxMessage();
    scAjaxJavascript();
    scAjaxSetFocus();
    scAjaxRedir();
  } // do_ajax_dye_dyeorder_form_event_gs2_onchange_cb
  // ---------- Form
  function do_ajax_dye_dyeorder_form_submit_form()
  {
    scAjaxHideMessage();
    var var_stddf = scAjaxGetFieldSelect("stddf");
    var var_p_o_number = scAjaxGetFieldHidden("p_o_number");
    var var_date = scAjaxGetFieldText("date");
    var var_status = scAjaxGetFieldSelect("status");
    var var_dyer2 = scAjaxGetFieldSelect("dyer2");
    var var_knitter2 = scAjaxGetFieldSelect("knitter2");
    var var_gs2 = scAjaxGetFieldSelect("gs2");
    var var_dyer = scAjaxGetFieldText("dyer");
    var var_knitter = scAjaxGetFieldText("knitter");
    var var_gs = scAjaxGetFieldText("gs");
    var var_ggd = scAjaxGetFieldText("ggd");
    var var_fs = scAjaxGetFieldText("fs");
    var var_greige_wi = scAjaxGetFieldText("greige_wi");
    var var_put_up = scAjaxGetFieldText("put_up");
    var var_price_lb_d = scAjaxGetFieldText("price_lb_d");
    var var_ydsalloc = scAjaxGetFieldText("ydsalloc");
    var var_lbsalloc = scAjaxGetFieldText("lbsalloc");
    var var_desc1 = scAjaxGetFieldText("desc1");
    var var_desc2 = scAjaxGetFieldText("desc2");
    var var_color = scAjaxGetFieldText("color");
    var var_color_numb = scAjaxGetFieldText("color_numb");
    var var_finish = scAjaxGetFieldText("finish");
    var var_finish_no = scAjaxGetFieldText("finish_no");
    var var_finno = scAjaxGetFieldSelect("finno");
    var var_fin_no = scAjaxGetFieldText("fin_no");
    var var_frame = scAjaxGetFieldText("frame");
    var var_panels = scAjaxGetFieldText("panels");
    var var_fwidth = scAjaxGetFieldText("fwidth");
    var var_cpi = scAjaxGetFieldText("cpi");
    var var_wpi = scAjaxGetFieldText("wpi");
    var var_req_fin_wt = scAjaxGetFieldText("req_fin_wt");
    var var_req_gr_yld = scAjaxGetFieldText("req_gr_yld");
    var var_spec1 = scAjaxGetFieldText("spec1");
    var var_spec2 = scAjaxGetFieldText("spec2");
    var var_spec3 = scAjaxGetFieldText("spec3");
    var var_cost_lb_d = scAjaxGetFieldText("cost_lb_d");
    var var_dye_cost = scAjaxGetFieldText("dye_cost");
    var var_gr_lbs_o = scAjaxGetFieldText("gr_lbs_o");
    var var_gr_lbs_d = scAjaxGetFieldText("gr_lbs_d");
    var var_gr_lbs_op = scAjaxGetFieldText("gr_lbs_op");
    var var_fin_lbs = scAjaxGetFieldText("fin_lbs");
    var var_work_loss = scAjaxGetFieldText("work_loss");
    var var_cost_lb_g = scAjaxGetFieldText("cost_lb_g");
    var var_est_yards = scAjaxGetFieldText("est_yards");
    var var_yards_recd = scAjaxGetFieldText("yards_recd");
    var var_cost_lb_t = scAjaxGetFieldText("cost_lb_t");
    var var_gr_yield = scAjaxGetFieldText("gr_yield");
    var var_cost_yd_t = scAjaxGetFieldText("cost_yd_t");
    var var_gr_value = scAjaxGetFieldText("gr_value");
    var var_sld = scAjaxGetFieldText("sld");
    var var_she = scAjaxGetFieldText("she");
    var var_ld1 = scAjaxGetFieldText("ld1");
    var var_he1 = scAjaxGetFieldText("he1");
    var var_ld2 = scAjaxGetFieldText("ld2");
    var var_he2 = scAjaxGetFieldText("he2");
    var var_nm_form_submit = document.F1.nm_form_submit.value;
    var var_nmgp_url_saida = document.F1.nmgp_url_saida.value;
    var var_nmgp_opcao = document.F1.nmgp_opcao.value;
    var var_nmgp_ancora = document.F1.nmgp_ancora.value;
    var var_nmgp_num_form = document.F1.nmgp_num_form.value;
    var var_nmgp_parms = document.F1.nmgp_parms.value;
    var var_script_case_init = document.F1.script_case_init.value;
    scAjaxProcOn();
    x_ajax_dye_dyeorder_form_submit_form(var_stddf, var_p_o_number, var_date, var_status, var_dyer2, var_knitter2, var_gs2, var_dyer, var_knitter, var_gs, var_ggd, var_fs, var_greige_wi, var_put_up, var_price_lb_d, var_ydsalloc, var_lbsalloc, var_desc1, var_desc2, var_color, var_color_numb, var_finish, var_finish_no, var_finno, var_fin_no, var_frame, var_panels, var_fwidth, var_cpi, var_wpi, var_req_fin_wt, var_req_gr_yld, var_spec1, var_spec2, var_spec3, var_cost_lb_d, var_dye_cost, var_gr_lbs_o, var_gr_lbs_d, var_gr_lbs_op, var_fin_lbs, var_work_loss, var_cost_lb_g, var_est_yards, var_yards_recd, var_cost_lb_t, var_gr_yield, var_cost_yd_t, var_gr_value, var_sld, var_she, var_ld1, var_he1, var_ld2, var_he2, var_nm_form_submit, var_nmgp_url_saida, var_nmgp_opcao, var_nmgp_ancora, var_nmgp_num_form, var_nmgp_parms, var_script_case_init, do_ajax_dye_dyeorder_form_submit_form_cb);
  } // do_ajax_dye_dyeorder_form_submit_form

  function do_ajax_dye_dyeorder_form_submit_form_cb(sResp)
  {
    scAjaxProcOff();
    oResp = scAjaxResponse(sResp);
    scAjaxCalendarReload();
    scAjaxUpdateErrors("valid");
    sAppErrors = scAjaxListErrors(true);
    if ("" == sAppErrors)
    {
      $('.sc-js-ui-statusimg').css('display', 'none');
      scAjaxHideErrorDisplay("table");
    }
    else
    {
      scAjaxShowErrorDisplay("table", sAppErrors);
    }
    if (scAjaxIsOk())
    {
      scAjaxShowMessage();
      scAjaxHideErrorDisplay("table");
      scAjaxHideErrorDisplay("stddf");
      scAjaxHideErrorDisplay("p_o_number");
      scAjaxHideErrorDisplay("date");
      scAjaxHideErrorDisplay("status");
      scAjaxHideErrorDisplay("dyer2");
      scAjaxHideErrorDisplay("knitter2");
      scAjaxHideErrorDisplay("gs2");
      scAjaxHideErrorDisplay("dyer");
      scAjaxHideErrorDisplay("knitter");
      scAjaxHideErrorDisplay("gs");
      scAjaxHideErrorDisplay("ggd");
      scAjaxHideErrorDisplay("fs");
      scAjaxHideErrorDisplay("greige_wi");
      scAjaxHideErrorDisplay("put_up");
      scAjaxHideErrorDisplay("price_lb_d");
      scAjaxHideErrorDisplay("ydsalloc");
      scAjaxHideErrorDisplay("lbsalloc");
      scAjaxHideErrorDisplay("desc1");
      scAjaxHideErrorDisplay("desc2");
      scAjaxHideErrorDisplay("color");
      scAjaxHideErrorDisplay("color_numb");
      scAjaxHideErrorDisplay("finish");
      scAjaxHideErrorDisplay("finish_no");
      scAjaxHideErrorDisplay("finno");
      scAjaxHideErrorDisplay("fin_no");
      scAjaxHideErrorDisplay("frame");
      scAjaxHideErrorDisplay("panels");
      scAjaxHideErrorDisplay("fwidth");
      scAjaxHideErrorDisplay("cpi");
      scAjaxHideErrorDisplay("wpi");
      scAjaxHideErrorDisplay("req_fin_wt");
      scAjaxHideErrorDisplay("req_gr_yld");
      scAjaxHideErrorDisplay("spec1");
      scAjaxHideErrorDisplay("spec2");
      scAjaxHideErrorDisplay("spec3");
      scAjaxHideErrorDisplay("cost_lb_d");
      scAjaxHideErrorDisplay("dye_cost");
      scAjaxHideErrorDisplay("gr_lbs_o");
      scAjaxHideErrorDisplay("gr_lbs_d");
      scAjaxHideErrorDisplay("gr_lbs_op");
      scAjaxHideErrorDisplay("fin_lbs");
      scAjaxHideErrorDisplay("work_loss");
      scAjaxHideErrorDisplay("cost_lb_g");
      scAjaxHideErrorDisplay("est_yards");
      scAjaxHideErrorDisplay("yards_recd");
      scAjaxHideErrorDisplay("cost_lb_t");
      scAjaxHideErrorDisplay("gr_yield");
      scAjaxHideErrorDisplay("cost_yd_t");
      scAjaxHideErrorDisplay("gr_value");
      scAjaxHideErrorDisplay("sld");
      scAjaxHideErrorDisplay("she");
      scAjaxHideErrorDisplay("ld1");
      scAjaxHideErrorDisplay("he1");
      scAjaxHideErrorDisplay("ld2");
      scAjaxHideErrorDisplay("he2");
      scLigEditLookupCall();
    }
    Nm_Proc_Atualiz = false;
    if (!scAjaxHasError())
    {
      scAjaxSetFields();
      if (scInlineFormSend())
      {
        self.parent.tb_remove();
        return;
      }
    }
    scAjaxShowDebug();
    scAjaxSetDisplay();
    scAjaxSetLabel();
    scAjaxSetReadonly();
    scAjaxSetMaster();
    scAjaxAlert();
    scAjaxMessage();
    scAjaxJavascript();
    scAjaxSetFocus();
    scAjaxRedir();
    if (hasJsFormOnload)
    {
      sc_form_onload();
    }
  } // do_ajax_dye_dyeorder_form_submit_form_cb

  var scStatusDetail = {};

  function do_ajax_dye_dyeorder_form_navigate_form()
  {
    if (scRefreshTable())
    {
      return;
    }
    scAjaxHideMessage();
    scAjaxHideErrorDisplay("table");
    scAjaxHideErrorDisplay("stddf");
    scAjaxHideErrorDisplay("p_o_number");
    scAjaxHideErrorDisplay("date");
    scAjaxHideErrorDisplay("status");
    scAjaxHideErrorDisplay("dyer2");
    scAjaxHideErrorDisplay("knitter2");
    scAjaxHideErrorDisplay("gs2");
    scAjaxHideErrorDisplay("dyer");
    scAjaxHideErrorDisplay("knitter");
    scAjaxHideErrorDisplay("gs");
    scAjaxHideErrorDisplay("ggd");
    scAjaxHideErrorDisplay("fs");
    scAjaxHideErrorDisplay("greige_wi");
    scAjaxHideErrorDisplay("put_up");
    scAjaxHideErrorDisplay("price_lb_d");
    scAjaxHideErrorDisplay("ydsalloc");
    scAjaxHideErrorDisplay("lbsalloc");
    scAjaxHideErrorDisplay("desc1");
    scAjaxHideErrorDisplay("desc2");
    scAjaxHideErrorDisplay("color");
    scAjaxHideErrorDisplay("color_numb");
    scAjaxHideErrorDisplay("finish");
    scAjaxHideErrorDisplay("finish_no");
    scAjaxHideErrorDisplay("finno");
    scAjaxHideErrorDisplay("fin_no");
    scAjaxHideErrorDisplay("frame");
    scAjaxHideErrorDisplay("panels");
    scAjaxHideErrorDisplay("fwidth");
    scAjaxHideErrorDisplay("cpi");
    scAjaxHideErrorDisplay("wpi");
    scAjaxHideErrorDisplay("req_fin_wt");
    scAjaxHideErrorDisplay("req_gr_yld");
    scAjaxHideErrorDisplay("spec1");
    scAjaxHideErrorDisplay("spec2");
    scAjaxHideErrorDisplay("spec3");
    scAjaxHideErrorDisplay("cost_lb_d");
    scAjaxHideErrorDisplay("dye_cost");
    scAjaxHideErrorDisplay("gr_lbs_o");
    scAjaxHideErrorDisplay("gr_lbs_d");
    scAjaxHideErrorDisplay("gr_lbs_op");
    scAjaxHideErrorDisplay("fin_lbs");
    scAjaxHideErrorDisplay("work_loss");
    scAjaxHideErrorDisplay("cost_lb_g");
    scAjaxHideErrorDisplay("est_yards");
    scAjaxHideErrorDisplay("yards_recd");
    scAjaxHideErrorDisplay("cost_lb_t");
    scAjaxHideErrorDisplay("gr_yield");
    scAjaxHideErrorDisplay("cost_yd_t");
    scAjaxHideErrorDisplay("gr_value");
    scAjaxHideErrorDisplay("sld");
    scAjaxHideErrorDisplay("she");
    scAjaxHideErrorDisplay("ld1");
    scAjaxHideErrorDisplay("he1");
    scAjaxHideErrorDisplay("ld2");
    scAjaxHideErrorDisplay("he2");
    var var_id2 = document.F2.id2.value;
    var var_nm_form_submit = document.F2.nm_form_submit.value;
    var var_nmgp_opcao = document.F2.nmgp_opcao.value;
    var var_nmgp_ordem = document.F2.nmgp_ordem.value;
    var var_nmgp_fast_search = document.F2.nmgp_fast_search.value;
    var var_nmgp_cond_fast_search = document.F2.nmgp_cond_fast_search.value;
    var var_nmgp_arg_fast_search = document.F2.nmgp_arg_fast_search.value;
    var var_script_case_init = document.F2.script_case_init.value;
    scAjaxProcOn();
    x_ajax_dye_dyeorder_form_navigate_form(var_id2, var_nm_form_submit, var_nmgp_opcao, var_nmgp_ordem, var_nmgp_fast_search,  var_nmgp_cond_fast_search,  var_nmgp_arg_fast_search, var_script_case_init, do_ajax_dye_dyeorder_form_navigate_form_cb);
  } // do_ajax_dye_dyeorder_form_navigate_form

  function do_ajax_dye_dyeorder_form_navigate_form_cb(sResp)
  {
    scAjaxProcOff();
    oResp = scAjaxResponse(sResp);
    if ("ERROR" == oResp.result)
    {
        scAjaxShowErrorDisplay("table", oResp.errList[0].msgText);
        scAjaxProcOff();
        return;
    }
    else if (oResp["navSummary"].reg_tot == 0)
    {
        _scAjaxShowMessage("", "<?php echo $this->Ini->Nm_lang['lang_errm_empt'] ?>", false, 0, true, "Ok", 0, 0, 0, 0, "", "", "", false, true);
    }
    sc_mupload_ok = true;
    scAjaxSetFields();
    document.F2.id2.value = scAjaxGetKeyValue("id2");
    scAjaxSetSummary();
    scAjaxSetNavpage();
    scAjaxShowDebug();
    scAjaxSetDisplay(true);
    scAjaxSetLabel(true);
    scAjaxSetReadonly(true);
    scAjaxSetMaster();
    scAjaxSetNavStatus("t");
    scAjaxSetNavStatus("b");
    scAjaxSetBtnVars();
    $('.sc-js-ui-statusimg').css('display', 'none');
    scAjaxAlert();
    scAjaxMessage();
    scAjaxJavascript();
    scQSInit = true;
    scQSInitVal = $("#SC_fast_search_t").val();
    scQuickSearchKeyUp('t', null);
    $('#SC_fast_search_t').blur();
    scQuickSearchInit(true, '');
    scQSInit = false;
    scAjaxSetFocus();
<?php
if ($this->Embutida_form)
{
?>
    do_ajax_dye_dyeorder_form_restore_buttons();
<?php
}
?>
    if (hasJsFormOnload)
    {
      sc_form_onload();
    }
  } // do_ajax_dye_dyeorder_form_navigate_form_cb

  function do_ajax_dye_dyeorder_form_lkpedt_refresh_stddf()
  {
    var var_script_case_init = document.F1.script_case_init.value;
    var nmgp_refresh_fields = "stddf";
    x_ajax_dye_dyeorder_form_lkpedt_refresh_stddf(nmgp_refresh_fields, var_script_case_init, do_ajax_dye_dyeorder_form_lkpedt_refresh_stddf_cb);
  } // do_ajax_dye_dyeorder_form_lkpedt_refresh_stddf

  function do_ajax_dye_dyeorder_form_lkpedt_refresh_stddf_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    scAjaxSetFields();
  } // do_ajax_dye_dyeorder_form_lkpedt_refresh_stddf_cb

  function do_ajax_dye_dyeorder_form_lkpedt_refresh_dyer2()
  {
    var var_script_case_init = document.F1.script_case_init.value;
    var nmgp_refresh_fields = "dyer2";
    x_ajax_dye_dyeorder_form_lkpedt_refresh_dyer2(nmgp_refresh_fields, var_script_case_init, do_ajax_dye_dyeorder_form_lkpedt_refresh_dyer2_cb);
  } // do_ajax_dye_dyeorder_form_lkpedt_refresh_dyer2

  function do_ajax_dye_dyeorder_form_lkpedt_refresh_dyer2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    scAjaxSetFields();
  } // do_ajax_dye_dyeorder_form_lkpedt_refresh_dyer2_cb

  function do_ajax_dye_dyeorder_form_lkpedt_refresh_knitter2()
  {
    var var_script_case_init = document.F1.script_case_init.value;
    var nmgp_refresh_fields = "knitter2";
    x_ajax_dye_dyeorder_form_lkpedt_refresh_knitter2(nmgp_refresh_fields, var_script_case_init, do_ajax_dye_dyeorder_form_lkpedt_refresh_knitter2_cb);
  } // do_ajax_dye_dyeorder_form_lkpedt_refresh_knitter2

  function do_ajax_dye_dyeorder_form_lkpedt_refresh_knitter2_cb(sResp)
  {
    oResp = scAjaxResponse(sResp);
    scAjaxSetFields();
  } // do_ajax_dye_dyeorder_form_lkpedt_refresh_knitter2_cb

  function scAjaxDetailProc()
  {
    return true;
  } // scAjaxDetailProc


  var ajax_error_geral = "";

  var ajax_error_type = new Array("valid", "onblur", "onchange", "onclick", "onfocus");

  var ajax_field_list = new Array();
  var ajax_field_Dt_Hr = new Array();
  ajax_field_list[0] = "stddf";
  ajax_field_list[1] = "p_o_number";
  ajax_field_list[2] = "date";
  ajax_field_list[3] = "status";
  ajax_field_list[4] = "dyer2";
  ajax_field_list[5] = "knitter2";
  ajax_field_list[6] = "gs2";
  ajax_field_list[7] = "dyer";
  ajax_field_list[8] = "knitter";
  ajax_field_list[9] = "gs";
  ajax_field_list[10] = "ggd";
  ajax_field_list[11] = "fs";
  ajax_field_list[12] = "greige_wi";
  ajax_field_list[13] = "put_up";
  ajax_field_list[14] = "price_lb_d";
  ajax_field_list[15] = "ydsalloc";
  ajax_field_list[16] = "lbsalloc";
  ajax_field_list[17] = "desc1";
  ajax_field_list[18] = "desc2";
  ajax_field_list[19] = "color";
  ajax_field_list[20] = "color_numb";
  ajax_field_list[21] = "finish";
  ajax_field_list[22] = "finish_no";
  ajax_field_list[23] = "finno";
  ajax_field_list[24] = "fin_no";
  ajax_field_list[25] = "frame";
  ajax_field_list[26] = "panels";
  ajax_field_list[27] = "fwidth";
  ajax_field_list[28] = "cpi";
  ajax_field_list[29] = "wpi";
  ajax_field_list[30] = "req_fin_wt";
  ajax_field_list[31] = "req_gr_yld";
  ajax_field_list[32] = "spec1";
  ajax_field_list[33] = "spec2";
  ajax_field_list[34] = "spec3";
  ajax_field_list[35] = "cost_lb_d";
  ajax_field_list[36] = "dye_cost";
  ajax_field_list[37] = "gr_lbs_o";
  ajax_field_list[38] = "gr_lbs_d";
  ajax_field_list[39] = "gr_lbs_op";
  ajax_field_list[40] = "fin_lbs";
  ajax_field_list[41] = "work_loss";
  ajax_field_list[42] = "cost_lb_g";
  ajax_field_list[43] = "est_yards";
  ajax_field_list[44] = "yards_recd";
  ajax_field_list[45] = "cost_lb_t";
  ajax_field_list[46] = "gr_yield";
  ajax_field_list[47] = "cost_yd_t";
  ajax_field_list[48] = "gr_value";
  ajax_field_list[49] = "sld";
  ajax_field_list[50] = "she";
  ajax_field_list[51] = "ld1";
  ajax_field_list[52] = "he1";
  ajax_field_list[53] = "ld2";
  ajax_field_list[54] = "he2";

  var ajax_block_list = new Array();
  ajax_block_list[0] = "0";
  ajax_block_list[1] = "1";
  ajax_block_list[2] = "2";
  ajax_block_list[3] = "3";
  ajax_block_list[4] = "4";
  ajax_block_list[5] = "5";
  ajax_block_list[6] = "6";
  ajax_block_list[7] = "7";
  ajax_block_list[8] = "8";

  var ajax_error_list = {
    "stddf": {"label": "", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "p_o_number": {"label": "P O NUMBER", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "date": {"label": "DATE", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "status": {"label": "STATUS", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "dyer2": {"label": "SELECT DYER", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "knitter2": {"label": "SELECT KNITTER", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "gs2": {"label": "SELECT GREIGE STYLE", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "dyer": {"label": "DYER", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "knitter": {"label": "KNITTER", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "gs": {"label": "GS", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "ggd": {"label": "GGD", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "fs": {"label": "FS", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "greige_wi": {"label": "GREIGE WI", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "put_up": {"label": "PUT UP", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "price_lb_d": {"label": "PRICE LB D", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "ydsalloc": {"label": "YARDS ALLOCATED", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "lbsalloc": {"label": "LBS ALLOCATED", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "desc1": {"label": "DESC1", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "desc2": {"label": "DESC2", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "color": {"label": "COLOR", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "color_numb": {"label": "COLOR NUMB", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "finish": {"label": "FINISH", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "finish_no": {"label": "FINISH NO", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "finno": {"label": "", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "fin_no": {"label": "FIN NO", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "frame": {"label": "FRAME", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "panels": {"label": "PANELS", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "fwidth": {"label": "FWIDTH", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "cpi": {"label": "CPI", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "wpi": {"label": "WPI", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "req_fin_wt": {"label": "REQ FIN WT", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "req_gr_yld": {"label": "REQ GR YLD", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "spec1": {"label": "SPEC1", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "spec2": {"label": "SPEC2", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "spec3": {"label": "SPEC3", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "cost_lb_d": {"label": "COST LB D", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "dye_cost": {"label": "DYE COST", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "gr_lbs_o": {"label": "GR LBS O", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "gr_lbs_d": {"label": "GR LBS D", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "gr_lbs_op": {"label": "GR LBS OP", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "fin_lbs": {"label": "FIN LBS", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "work_loss": {"label": "WORK LOSS", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "cost_lb_g": {"label": "COST LB G", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "est_yards": {"label": "EST YARDS", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "yards_recd": {"label": "YARDS RECD", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "cost_lb_t": {"label": "COST LB T", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "gr_yield": {"label": "GR YIELD", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "cost_yd_t": {"label": "COST YD T", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "gr_value": {"label": "GR VALUE", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "sld": {"label": "SLD", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "she": {"label": "SHE", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "ld1": {"label": "LD1", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "he1": {"label": "HE1", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "ld2": {"label": "LD2", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5},
    "he2": {"label": "HE2", "valid": new Array(), "onblur": new Array(), "onchange": new Array(), "onclick": new Array(), "onfocus": new Array(), "timeout": 5}
  };
  var ajax_error_timeout = 5;

  var ajax_block_id = {
    "0": "hidden_bloco_0",
    "1": "hidden_bloco_1",
    "2": "hidden_bloco_2",
    "3": "hidden_bloco_3",
    "4": "hidden_bloco_4",
    "5": "hidden_bloco_5",
    "6": "hidden_bloco_6",
    "7": "hidden_bloco_7",
    "8": "hidden_bloco_8"
  };

  var ajax_block_tab = {
    "hidden_bloco_0": "",
    "hidden_bloco_1": "",
    "hidden_bloco_2": "",
    "hidden_bloco_3": "",
    "hidden_bloco_4": "",
    "hidden_bloco_5": "",
    "hidden_bloco_6": "",
    "hidden_bloco_7": "",
    "hidden_bloco_8": ""
  };

  var ajax_field_mult = {
    "stddf": new Array(),
    "p_o_number": new Array(),
    "date": new Array(),
    "status": new Array(),
    "dyer2": new Array(),
    "knitter2": new Array(),
    "gs2": new Array(),
    "dyer": new Array(),
    "knitter": new Array(),
    "gs": new Array(),
    "ggd": new Array(),
    "fs": new Array(),
    "greige_wi": new Array(),
    "put_up": new Array(),
    "price_lb_d": new Array(),
    "ydsalloc": new Array(),
    "lbsalloc": new Array(),
    "desc1": new Array(),
    "desc2": new Array(),
    "color": new Array(),
    "color_numb": new Array(),
    "finish": new Array(),
    "finish_no": new Array(),
    "finno": new Array(),
    "fin_no": new Array(),
    "frame": new Array(),
    "panels": new Array(),
    "fwidth": new Array(),
    "cpi": new Array(),
    "wpi": new Array(),
    "req_fin_wt": new Array(),
    "req_gr_yld": new Array(),
    "spec1": new Array(),
    "spec2": new Array(),
    "spec3": new Array(),
    "cost_lb_d": new Array(),
    "dye_cost": new Array(),
    "gr_lbs_o": new Array(),
    "gr_lbs_d": new Array(),
    "gr_lbs_op": new Array(),
    "fin_lbs": new Array(),
    "work_loss": new Array(),
    "cost_lb_g": new Array(),
    "est_yards": new Array(),
    "yards_recd": new Array(),
    "cost_lb_t": new Array(),
    "gr_yield": new Array(),
    "cost_yd_t": new Array(),
    "gr_value": new Array(),
    "sld": new Array(),
    "she": new Array(),
    "ld1": new Array(),
    "he1": new Array(),
    "ld2": new Array(),
    "he2": new Array()
  };
  ajax_field_mult["stddf"][1] = "stddf";
  ajax_field_mult["p_o_number"][1] = "p_o_number";
  ajax_field_mult["date"][1] = "date";
  ajax_field_mult["status"][1] = "status";
  ajax_field_mult["dyer2"][1] = "dyer2";
  ajax_field_mult["knitter2"][1] = "knitter2";
  ajax_field_mult["gs2"][1] = "gs2";
  ajax_field_mult["dyer"][1] = "dyer";
  ajax_field_mult["knitter"][1] = "knitter";
  ajax_field_mult["gs"][1] = "gs";
  ajax_field_mult["ggd"][1] = "ggd";
  ajax_field_mult["fs"][1] = "fs";
  ajax_field_mult["greige_wi"][1] = "greige_wi";
  ajax_field_mult["put_up"][1] = "put_up";
  ajax_field_mult["price_lb_d"][1] = "price_lb_d";
  ajax_field_mult["ydsalloc"][1] = "ydsalloc";
  ajax_field_mult["lbsalloc"][1] = "lbsalloc";
  ajax_field_mult["desc1"][1] = "desc1";
  ajax_field_mult["desc2"][1] = "desc2";
  ajax_field_mult["color"][1] = "color";
  ajax_field_mult["color_numb"][1] = "color_numb";
  ajax_field_mult["finish"][1] = "finish";
  ajax_field_mult["finish_no"][1] = "finish_no";
  ajax_field_mult["finno"][1] = "finno";
  ajax_field_mult["fin_no"][1] = "fin_no";
  ajax_field_mult["frame"][1] = "frame";
  ajax_field_mult["panels"][1] = "panels";
  ajax_field_mult["fwidth"][1] = "fwidth";
  ajax_field_mult["cpi"][1] = "cpi";
  ajax_field_mult["wpi"][1] = "wpi";
  ajax_field_mult["req_fin_wt"][1] = "req_fin_wt";
  ajax_field_mult["req_gr_yld"][1] = "req_gr_yld";
  ajax_field_mult["spec1"][1] = "spec1";
  ajax_field_mult["spec2"][1] = "spec2";
  ajax_field_mult["spec3"][1] = "spec3";
  ajax_field_mult["cost_lb_d"][1] = "cost_lb_d";
  ajax_field_mult["dye_cost"][1] = "dye_cost";
  ajax_field_mult["gr_lbs_o"][1] = "gr_lbs_o";
  ajax_field_mult["gr_lbs_d"][1] = "gr_lbs_d";
  ajax_field_mult["gr_lbs_op"][1] = "gr_lbs_op";
  ajax_field_mult["fin_lbs"][1] = "fin_lbs";
  ajax_field_mult["work_loss"][1] = "work_loss";
  ajax_field_mult["cost_lb_g"][1] = "cost_lb_g";
  ajax_field_mult["est_yards"][1] = "est_yards";
  ajax_field_mult["yards_recd"][1] = "yards_recd";
  ajax_field_mult["cost_lb_t"][1] = "cost_lb_t";
  ajax_field_mult["gr_yield"][1] = "gr_yield";
  ajax_field_mult["cost_yd_t"][1] = "cost_yd_t";
  ajax_field_mult["gr_value"][1] = "gr_value";
  ajax_field_mult["sld"][1] = "sld";
  ajax_field_mult["she"][1] = "she";
  ajax_field_mult["ld1"][1] = "ld1";
  ajax_field_mult["he1"][1] = "he1";
  ajax_field_mult["ld2"][1] = "ld2";
  ajax_field_mult["he2"][1] = "he2";

  var ajax_field_id = {
    "stddf": new Array("hidden_field_label_stddf", "hidden_field_data_stddf"),
    "p_o_number": new Array("hidden_field_label_p_o_number", "hidden_field_data_p_o_number"),
    "date": new Array("hidden_field_label_date", "hidden_field_data_date"),
    "status": new Array("hidden_field_label_status", "hidden_field_data_status"),
    "dyer2": new Array("hidden_field_label_dyer2", "hidden_field_data_dyer2"),
    "knitter2": new Array("hidden_field_label_knitter2", "hidden_field_data_knitter2"),
    "gs2": new Array("hidden_field_label_gs2", "hidden_field_data_gs2"),
    "dyer": new Array("hidden_field_label_dyer", "hidden_field_data_dyer"),
    "knitter": new Array("hidden_field_label_knitter", "hidden_field_data_knitter"),
    "gs": new Array("hidden_field_label_gs", "hidden_field_data_gs"),
    "ggd": new Array("hidden_field_label_ggd", "hidden_field_data_ggd"),
    "fs": new Array("hidden_field_label_fs", "hidden_field_data_fs"),
    "greige_wi": new Array("hidden_field_label_greige_wi", "hidden_field_data_greige_wi"),
    "put_up": new Array("hidden_field_label_put_up", "hidden_field_data_put_up"),
    "price_lb_d": new Array("hidden_field_label_price_lb_d", "hidden_field_data_price_lb_d"),
    "ydsalloc": new Array("hidden_field_label_ydsalloc", "hidden_field_data_ydsalloc"),
    "lbsalloc": new Array("hidden_field_label_lbsalloc", "hidden_field_data_lbsalloc"),
    "desc1": new Array("hidden_field_label_desc1", "hidden_field_data_desc1"),
    "desc2": new Array("hidden_field_label_desc2", "hidden_field_data_desc2"),
    "color": new Array("hidden_field_label_color", "hidden_field_data_color"),
    "color_numb": new Array("hidden_field_label_color_numb", "hidden_field_data_color_numb"),
    "finish": new Array("hidden_field_label_finish", "hidden_field_data_finish"),
    "finish_no": new Array("hidden_field_label_finish_no", "hidden_field_data_finish_no"),
    "finno": new Array("hidden_field_label_finno", "hidden_field_data_finno"),
    "fin_no": new Array("hidden_field_label_fin_no", "hidden_field_data_fin_no"),
    "frame": new Array("hidden_field_label_frame", "hidden_field_data_frame"),
    "panels": new Array("hidden_field_label_panels", "hidden_field_data_panels"),
    "fwidth": new Array("hidden_field_label_fwidth", "hidden_field_data_fwidth"),
    "cpi": new Array("hidden_field_label_cpi", "hidden_field_data_cpi"),
    "wpi": new Array("hidden_field_label_wpi", "hidden_field_data_wpi"),
    "req_fin_wt": new Array("hidden_field_label_req_fin_wt", "hidden_field_data_req_fin_wt"),
    "req_gr_yld": new Array("hidden_field_label_req_gr_yld", "hidden_field_data_req_gr_yld"),
    "spec1": new Array("hidden_field_label_spec1", "hidden_field_data_spec1"),
    "spec2": new Array("hidden_field_label_spec2", "hidden_field_data_spec2"),
    "spec3": new Array("hidden_field_label_spec3", "hidden_field_data_spec3"),
    "cost_lb_d": new Array("hidden_field_label_cost_lb_d", "hidden_field_data_cost_lb_d"),
    "dye_cost": new Array("hidden_field_label_dye_cost", "hidden_field_data_dye_cost"),
    "gr_lbs_o": new Array("hidden_field_label_gr_lbs_o", "hidden_field_data_gr_lbs_o"),
    "gr_lbs_d": new Array("hidden_field_label_gr_lbs_d", "hidden_field_data_gr_lbs_d"),
    "gr_lbs_op": new Array("hidden_field_label_gr_lbs_op", "hidden_field_data_gr_lbs_op"),
    "fin_lbs": new Array("hidden_field_label_fin_lbs", "hidden_field_data_fin_lbs"),
    "work_loss": new Array("hidden_field_label_work_loss", "hidden_field_data_work_loss"),
    "cost_lb_g": new Array("hidden_field_label_cost_lb_g", "hidden_field_data_cost_lb_g"),
    "est_yards": new Array("hidden_field_label_est_yards", "hidden_field_data_est_yards"),
    "yards_recd": new Array("hidden_field_label_yards_recd", "hidden_field_data_yards_recd"),
    "cost_lb_t": new Array("hidden_field_label_cost_lb_t", "hidden_field_data_cost_lb_t"),
    "gr_yield": new Array("hidden_field_label_gr_yield", "hidden_field_data_gr_yield"),
    "cost_yd_t": new Array("hidden_field_label_cost_yd_t", "hidden_field_data_cost_yd_t"),
    "gr_value": new Array("hidden_field_label_gr_value", "hidden_field_data_gr_value"),
    "sld": new Array("hidden_field_label_sld", "hidden_field_data_sld"),
    "she": new Array("hidden_field_label_she", "hidden_field_data_she"),
    "ld1": new Array("hidden_field_label_ld1", "hidden_field_data_ld1"),
    "he1": new Array("hidden_field_label_he1", "hidden_field_data_he1"),
    "ld2": new Array("hidden_field_label_ld2", "hidden_field_data_ld2"),
    "he2": new Array("hidden_field_label_he2", "hidden_field_data_he2")
  };

  var ajax_read_only = {
    "stddf": "off",
    "p_o_number": "on",
    "date": "on",
    "status": "off",
    "dyer2": "off",
    "knitter2": "off",
    "gs2": "off",
    "dyer": "on",
    "knitter": "on",
    "gs": "on",
    "ggd": "off",
    "fs": "off",
    "greige_wi": "on",
    "put_up": "off",
    "price_lb_d": "off",
    "ydsalloc": "off",
    "lbsalloc": "off",
    "desc1": "off",
    "desc2": "off",
    "color": "off",
    "color_numb": "off",
    "finish": "off",
    "finish_no": "off",
    "finno": "off",
    "fin_no": "on",
    "frame": "off",
    "panels": "off",
    "fwidth": "off",
    "cpi": "off",
    "wpi": "off",
    "req_fin_wt": "off",
    "req_gr_yld": "off",
    "spec1": "off",
    "spec2": "off",
    "spec3": "off",
    "cost_lb_d": "on",
    "dye_cost": "on",
    "gr_lbs_o": "on",
    "gr_lbs_d": "on",
    "gr_lbs_op": "on",
    "fin_lbs": "on",
    "work_loss": "on",
    "cost_lb_g": "on",
    "est_yards": "off",
    "yards_recd": "on",
    "cost_lb_t": "on",
    "gr_yield": "on",
    "cost_yd_t": "on",
    "gr_value": "on",
    "sld": "off",
    "she": "off",
    "ld1": "off",
    "he1": "off",
    "ld2": "off",
    "he2": "off"
  };
  var bRefreshTable = false;
  function scRefreshTable()
  {
    return false;
  }

  function scAjaxDetailValue(sIndex, sValue)
  {
    var aValue = new Array();
    aValue[0] = {"value" : sValue};
    if ("stddf" == sIndex)
    {
      scAjaxSetFieldSelect(sIndex, aValue, null);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("p_o_number" == sIndex)
    {
      scAjaxSetFieldLabel(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("date" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("status" == sIndex)
    {
      scAjaxSetFieldSelect(sIndex, aValue, null);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("dyer2" == sIndex)
    {
      scAjaxSetFieldSelect(sIndex, aValue, null);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("knitter2" == sIndex)
    {
      scAjaxSetFieldSelect(sIndex, aValue, null);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("gs2" == sIndex)
    {
      scAjaxSetFieldSelect(sIndex, aValue, null);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("dyer" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("knitter" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("gs" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("ggd" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("fs" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("greige_wi" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("put_up" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("price_lb_d" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("ydsalloc" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("lbsalloc" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("desc1" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("desc2" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("color" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("color_numb" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("finish" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("finish_no" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("finno" == sIndex)
    {
      scAjaxSetFieldSelect(sIndex, aValue, null);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("fin_no" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("frame" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("panels" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("fwidth" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("cpi" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("wpi" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("req_fin_wt" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("req_gr_yld" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("spec1" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("spec2" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("spec3" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("cost_lb_d" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("dye_cost" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("gr_lbs_o" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("gr_lbs_d" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("gr_lbs_op" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("fin_lbs" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("work_loss" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("cost_lb_g" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("est_yards" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("yards_recd" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("cost_lb_t" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("gr_yield" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("cost_yd_t" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("gr_value" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("sld" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("she" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("ld1" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("he1" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("ld2" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    if ("he2" == sIndex)
    {
      scAjaxSetFieldText(sIndex, aValue);
      updateHeaderFooter(sIndex, aValue);
      return;
    }
    scAjaxSetFieldInnerHtml(sIndex, aValue);
  }
 </SCRIPT>
