
function scJQGeneralAdd() {
  scLoadScInput('input:text.sc-js-input');
  scLoadScInput('input:password.sc-js-input');
  scLoadScInput('input:checkbox.sc-js-input');
  scLoadScInput('input:radio.sc-js-input');
  scLoadScInput('select.sc-js-input');
  scLoadScInput('textarea.sc-js-input');

} // scJQGeneralAdd

function scFocusField(sField) {
  var $oField = $('#id_sc_field_' + sField);

  if (0 == $oField.length) {
    $oField = $('input[name=' + sField + ']');
  }

  if (0 == $oField.length && document.F1.elements[sField]) {
    $oField = $(document.F1.elements[sField]);
  }

  if ($("#id_ac_" + sField).length > 0) {
    if ($oField.hasClass("select2-hidden-accessible")) {
      if (false == scSetFocusOnField($oField, sField)) {
        setTimeout(function() { scSetFocusOnField($oField, sField); }, 500);
      }
    }
    else {
      if (false == scSetFocusOnField($oField, sField)) {
        if (false == scSetFocusOnField($("#id_ac_" + sField, sField))) {
          setTimeout(function() { scSetFocusOnField($("#id_ac_" + sField, sField)); }, 500);
        }
      }
      else {
        setTimeout(function() { scSetFocusOnField($oField, sField); }, 500);
      }
    }
  }
  else {
    setTimeout(function() { scSetFocusOnField($oField, sField); }, 500);
  }
} // scFocusField

function scSetFocusOnField($oField, sField) {
  if ($oField.length > 0 && $oField[0].offsetHeight > 0 && $oField[0].offsetWidth > 0 && !$oField[0].disabled) {
    $oField[0].focus();
    return true;
  }
  return false;
} // scSetFocusOnField

function scEventControl_init(iSeqRow) {
  scEventControl_data["fld_alertas" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["fld_label_status" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["data_hora_cadastro_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["titulo_manifestacao_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["desc_manifestacao_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["token_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["dt_ocorrido_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["desc_area_setor_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["id_categoria_1100" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["ouvd_anonima_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["nome_inf_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["email_inf_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["cpf_cnpj_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["tel_inf_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["nivel_atend_atual_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["area_nivel_atual" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["resp_nivel_atual" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["id_status_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["dt_ini_inv_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["dt_enc_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["andamento_inv_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["conclusao_inv_ouvd_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["andamentos" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["md_fluxo" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["anexo_ouvd_img1_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["anexo_ouvd_img2_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["anexo_ouvd_doc1_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
  scEventControl_data["anexo_ouvd_doc2_1000" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": "", "calculated": ""};
}

function scEventControl_active(iSeqRow) {
  if (scEventControl_data["fld_alertas" + iSeqRow] && scEventControl_data["fld_alertas" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["fld_alertas" + iSeqRow] && scEventControl_data["fld_alertas" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["fld_label_status" + iSeqRow] && scEventControl_data["fld_label_status" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["fld_label_status" + iSeqRow] && scEventControl_data["fld_label_status" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["data_hora_cadastro_1000" + iSeqRow] && scEventControl_data["data_hora_cadastro_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["data_hora_cadastro_1000" + iSeqRow] && scEventControl_data["data_hora_cadastro_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["titulo_manifestacao_1000" + iSeqRow] && scEventControl_data["titulo_manifestacao_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["titulo_manifestacao_1000" + iSeqRow] && scEventControl_data["titulo_manifestacao_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["desc_manifestacao_1000" + iSeqRow] && scEventControl_data["desc_manifestacao_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["desc_manifestacao_1000" + iSeqRow] && scEventControl_data["desc_manifestacao_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["token_ouvd_1000" + iSeqRow] && scEventControl_data["token_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["token_ouvd_1000" + iSeqRow] && scEventControl_data["token_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["dt_ocorrido_1000" + iSeqRow] && scEventControl_data["dt_ocorrido_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["dt_ocorrido_1000" + iSeqRow] && scEventControl_data["dt_ocorrido_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["desc_area_setor_1000" + iSeqRow] && scEventControl_data["desc_area_setor_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["desc_area_setor_1000" + iSeqRow] && scEventControl_data["desc_area_setor_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["id_categoria_1100" + iSeqRow] && scEventControl_data["id_categoria_1100" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["id_categoria_1100" + iSeqRow] && scEventControl_data["id_categoria_1100" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["ouvd_anonima_1000" + iSeqRow] && scEventControl_data["ouvd_anonima_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["ouvd_anonima_1000" + iSeqRow] && scEventControl_data["ouvd_anonima_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["nome_inf_ouvd_1000" + iSeqRow] && scEventControl_data["nome_inf_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["nome_inf_ouvd_1000" + iSeqRow] && scEventControl_data["nome_inf_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["email_inf_ouvd_1000" + iSeqRow] && scEventControl_data["email_inf_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["email_inf_ouvd_1000" + iSeqRow] && scEventControl_data["email_inf_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["cpf_cnpj_ouvd_1000" + iSeqRow] && scEventControl_data["cpf_cnpj_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["cpf_cnpj_ouvd_1000" + iSeqRow] && scEventControl_data["cpf_cnpj_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["tel_inf_ouvd_1000" + iSeqRow] && scEventControl_data["tel_inf_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["tel_inf_ouvd_1000" + iSeqRow] && scEventControl_data["tel_inf_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["nivel_atend_atual_1000" + iSeqRow] && scEventControl_data["nivel_atend_atual_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["nivel_atend_atual_1000" + iSeqRow] && scEventControl_data["nivel_atend_atual_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["area_nivel_atual" + iSeqRow] && scEventControl_data["area_nivel_atual" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["area_nivel_atual" + iSeqRow] && scEventControl_data["area_nivel_atual" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["resp_nivel_atual" + iSeqRow] && scEventControl_data["resp_nivel_atual" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["resp_nivel_atual" + iSeqRow] && scEventControl_data["resp_nivel_atual" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["id_status_ouvd_1000" + iSeqRow] && scEventControl_data["id_status_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["id_status_ouvd_1000" + iSeqRow] && scEventControl_data["id_status_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["dt_ini_inv_ouvd_1000" + iSeqRow] && scEventControl_data["dt_ini_inv_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["dt_ini_inv_ouvd_1000" + iSeqRow] && scEventControl_data["dt_ini_inv_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["dt_enc_ouvd_1000" + iSeqRow] && scEventControl_data["dt_enc_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["dt_enc_ouvd_1000" + iSeqRow] && scEventControl_data["dt_enc_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["andamento_inv_ouvd_1000" + iSeqRow] && scEventControl_data["andamento_inv_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["andamento_inv_ouvd_1000" + iSeqRow] && scEventControl_data["andamento_inv_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["conclusao_inv_ouvd_1000" + iSeqRow] && scEventControl_data["conclusao_inv_ouvd_1000" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["conclusao_inv_ouvd_1000" + iSeqRow] && scEventControl_data["conclusao_inv_ouvd_1000" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["andamentos" + iSeqRow] && scEventControl_data["andamentos" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["andamentos" + iSeqRow] && scEventControl_data["andamentos" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["md_fluxo" + iSeqRow] && scEventControl_data["md_fluxo" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["md_fluxo" + iSeqRow] && scEventControl_data["md_fluxo" + iSeqRow]["change"]) {
    return true;
  }
  return false;
} // scEventControl_active

function scEventControl_onFocus(oField, iSeq) {
  var fieldId, fieldName;
  fieldId = $(oField).attr("id");
  fieldName = fieldId.substr(12);
  scEventControl_data[fieldName]["blur"] = true;
  if ("id_categoria_1100" + iSeq == fieldName) {
    scEventControl_data[fieldName]["blur"] = false;
  }
  if ("nivel_atend_atual_1000" + iSeq == fieldName) {
    scEventControl_data[fieldName]["blur"] = false;
  }
  if ("id_status_ouvd_1000" + iSeq == fieldName) {
    scEventControl_data[fieldName]["blur"] = false;
  }
  scEventControl_data[fieldName]["change"] = false;
} // scEventControl_onFocus

function scEventControl_onBlur(sFieldName) {
  scEventControl_data[sFieldName]["blur"] = false;
  if (scEventControl_data[sFieldName]["change"]) {
        if (scEventControl_data[sFieldName]["original"] == $("#id_sc_field_" + sFieldName).val() || scEventControl_data[sFieldName]["calculated"] == $("#id_sc_field_" + sFieldName).val()) {
          scEventControl_data[sFieldName]["change"] = false;
        }
  }
} // scEventControl_onBlur

function scEventControl_onChange(sFieldName) {
  scEventControl_data[sFieldName]["change"] = false;
} // scEventControl_onChange

function scEventControl_onAutocomp(sFieldName) {
  scEventControl_data[sFieldName]["autocomp"] = false;
} // scEventControl_onChange

var scEventControl_data = {};

function scJQEventsAdd(iSeqRow) {
  $('#id_sc_field_id_registro_1000' + iSeqRow).bind('change', function() { sc_form_OUVD_1000_registro_id_registro_1000_onchange(this, iSeqRow) });
  $('#id_sc_field_titulo_manifestacao_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_titulo_manifestacao_1000_onblur('#id_sc_field_titulo_manifestacao_1000' + iSeqRow, iSeqRow) })
                                                      .bind('change', function() { sc_form_OUVD_1000_registro_titulo_manifestacao_1000_onchange(this, iSeqRow) })
                                                      .bind('focus', function() { sc_form_OUVD_1000_registro_titulo_manifestacao_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_desc_manifestacao_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_desc_manifestacao_1000_onblur('#id_sc_field_desc_manifestacao_1000' + iSeqRow, iSeqRow) })
                                                    .bind('change', function() { sc_form_OUVD_1000_registro_desc_manifestacao_1000_onchange(this, iSeqRow) })
                                                    .bind('focus', function() { sc_form_OUVD_1000_registro_desc_manifestacao_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_id_categoria_1100' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_id_categoria_1100_onblur('#id_sc_field_id_categoria_1100' + iSeqRow, iSeqRow) })
                                               .bind('change', function() { sc_form_OUVD_1000_registro_id_categoria_1100_onchange(this, iSeqRow) })
                                               .bind('focus', function() { sc_form_OUVD_1000_registro_id_categoria_1100_onfocus(this, iSeqRow) });
  $('#id_sc_field_desc_area_setor_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_desc_area_setor_1000_onblur('#id_sc_field_desc_area_setor_1000' + iSeqRow, iSeqRow) })
                                                  .bind('change', function() { sc_form_OUVD_1000_registro_desc_area_setor_1000_onchange(this, iSeqRow) })
                                                  .bind('focus', function() { sc_form_OUVD_1000_registro_desc_area_setor_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_dt_ocorrido_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_dt_ocorrido_1000_onblur('#id_sc_field_dt_ocorrido_1000' + iSeqRow, iSeqRow) })
                                              .bind('change', function() { sc_form_OUVD_1000_registro_dt_ocorrido_1000_onchange(this, iSeqRow) })
                                              .bind('focus', function() { sc_form_OUVD_1000_registro_dt_ocorrido_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_ouvd_anonima_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_ouvd_anonima_1000_onblur('#id_sc_field_ouvd_anonima_1000' + iSeqRow, iSeqRow) })
                                               .bind('change', function() { sc_form_OUVD_1000_registro_ouvd_anonima_1000_onchange(this, iSeqRow) })
                                               .bind('focus', function() { sc_form_OUVD_1000_registro_ouvd_anonima_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_nome_inf_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_nome_inf_ouvd_1000_onblur('#id_sc_field_nome_inf_ouvd_1000' + iSeqRow, iSeqRow) })
                                                .bind('change', function() { sc_form_OUVD_1000_registro_nome_inf_ouvd_1000_onchange(this, iSeqRow) })
                                                .bind('focus', function() { sc_form_OUVD_1000_registro_nome_inf_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_cpf_cnpj_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_cpf_cnpj_ouvd_1000_onblur('#id_sc_field_cpf_cnpj_ouvd_1000' + iSeqRow, iSeqRow) })
                                                .bind('change', function() { sc_form_OUVD_1000_registro_cpf_cnpj_ouvd_1000_onchange(this, iSeqRow) })
                                                .bind('focus', function() { sc_form_OUVD_1000_registro_cpf_cnpj_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_tel_inf_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_tel_inf_ouvd_1000_onblur('#id_sc_field_tel_inf_ouvd_1000' + iSeqRow, iSeqRow) })
                                               .bind('change', function() { sc_form_OUVD_1000_registro_tel_inf_ouvd_1000_onchange(this, iSeqRow) })
                                               .bind('focus', function() { sc_form_OUVD_1000_registro_tel_inf_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_email_inf_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_email_inf_ouvd_1000_onblur('#id_sc_field_email_inf_ouvd_1000' + iSeqRow, iSeqRow) })
                                                 .bind('change', function() { sc_form_OUVD_1000_registro_email_inf_ouvd_1000_onchange(this, iSeqRow) })
                                                 .bind('focus', function() { sc_form_OUVD_1000_registro_email_inf_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_dt_ini_inv_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_dt_ini_inv_ouvd_1000_onblur('#id_sc_field_dt_ini_inv_ouvd_1000' + iSeqRow, iSeqRow) })
                                                  .bind('change', function() { sc_form_OUVD_1000_registro_dt_ini_inv_ouvd_1000_onchange(this, iSeqRow) })
                                                  .bind('focus', function() { sc_form_OUVD_1000_registro_dt_ini_inv_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_andamento_inv_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_andamento_inv_ouvd_1000_onblur('#id_sc_field_andamento_inv_ouvd_1000' + iSeqRow, iSeqRow) })
                                                     .bind('change', function() { sc_form_OUVD_1000_registro_andamento_inv_ouvd_1000_onchange(this, iSeqRow) })
                                                     .bind('focus', function() { sc_form_OUVD_1000_registro_andamento_inv_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_conclusao_inv_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_conclusao_inv_ouvd_1000_onblur('#id_sc_field_conclusao_inv_ouvd_1000' + iSeqRow, iSeqRow) })
                                                     .bind('change', function() { sc_form_OUVD_1000_registro_conclusao_inv_ouvd_1000_onchange(this, iSeqRow) })
                                                     .bind('focus', function() { sc_form_OUVD_1000_registro_conclusao_inv_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_nivel_atend_atual_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_nivel_atend_atual_1000_onblur('#id_sc_field_nivel_atend_atual_1000' + iSeqRow, iSeqRow) })
                                                    .bind('change', function() { sc_form_OUVD_1000_registro_nivel_atend_atual_1000_onchange(this, iSeqRow) })
                                                    .bind('focus', function() { sc_form_OUVD_1000_registro_nivel_atend_atual_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_id_status_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_id_status_ouvd_1000_onblur('#id_sc_field_id_status_ouvd_1000' + iSeqRow, iSeqRow) })
                                                 .bind('change', function() { sc_form_OUVD_1000_registro_id_status_ouvd_1000_onchange(this, iSeqRow) })
                                                 .bind('focus', function() { sc_form_OUVD_1000_registro_id_status_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_id_controlador_1000' + iSeqRow).bind('change', function() { sc_form_OUVD_1000_registro_id_controlador_1000_onchange(this, iSeqRow) });
  $('#id_sc_field_data_hora_cadastro_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_data_hora_cadastro_1000_onblur('#id_sc_field_data_hora_cadastro_1000' + iSeqRow, iSeqRow) })
                                                     .bind('change', function() { sc_form_OUVD_1000_registro_data_hora_cadastro_1000_onchange(this, iSeqRow) })
                                                     .bind('focus', function() { sc_form_OUVD_1000_registro_data_hora_cadastro_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_token_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_token_ouvd_1000_onblur('#id_sc_field_token_ouvd_1000' + iSeqRow, iSeqRow) })
                                             .bind('change', function() { sc_form_OUVD_1000_registro_token_ouvd_1000_onchange(this, iSeqRow) })
                                             .bind('focus', function() { sc_form_OUVD_1000_registro_token_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_anexo_ouvd_img1_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_anexo_ouvd_img1_1000_onblur('#id_sc_field_anexo_ouvd_img1_1000' + iSeqRow, iSeqRow) })
                                                  .bind('change', function() { sc_form_OUVD_1000_registro_anexo_ouvd_img1_1000_onchange(this, iSeqRow) })
                                                  .bind('focus', function() { sc_form_OUVD_1000_registro_anexo_ouvd_img1_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_anexo_ouvd_img2_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_anexo_ouvd_img2_1000_onblur('#id_sc_field_anexo_ouvd_img2_1000' + iSeqRow, iSeqRow) })
                                                  .bind('change', function() { sc_form_OUVD_1000_registro_anexo_ouvd_img2_1000_onchange(this, iSeqRow) })
                                                  .bind('focus', function() { sc_form_OUVD_1000_registro_anexo_ouvd_img2_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_anexo_ouvd_doc1_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_anexo_ouvd_doc1_1000_onblur('#id_sc_field_anexo_ouvd_doc1_1000' + iSeqRow, iSeqRow) })
                                                  .bind('change', function() { sc_form_OUVD_1000_registro_anexo_ouvd_doc1_1000_onchange(this, iSeqRow) })
                                                  .bind('focus', function() { sc_form_OUVD_1000_registro_anexo_ouvd_doc1_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_anexo_ouvd_doc2_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_anexo_ouvd_doc2_1000_onblur('#id_sc_field_anexo_ouvd_doc2_1000' + iSeqRow, iSeqRow) })
                                                  .bind('change', function() { sc_form_OUVD_1000_registro_anexo_ouvd_doc2_1000_onchange(this, iSeqRow) })
                                                  .bind('focus', function() { sc_form_OUVD_1000_registro_anexo_ouvd_doc2_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_dt_enc_ouvd_1000' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_dt_enc_ouvd_1000_onblur('#id_sc_field_dt_enc_ouvd_1000' + iSeqRow, iSeqRow) })
                                              .bind('change', function() { sc_form_OUVD_1000_registro_dt_enc_ouvd_1000_onchange(this, iSeqRow) })
                                              .bind('focus', function() { sc_form_OUVD_1000_registro_dt_enc_ouvd_1000_onfocus(this, iSeqRow) });
  $('#id_sc_field_andamentos' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_andamentos_onblur('#id_sc_field_andamentos' + iSeqRow, iSeqRow) })
                                        .bind('change', function() { sc_form_OUVD_1000_registro_andamentos_onchange(this, iSeqRow) })
                                        .bind('focus', function() { sc_form_OUVD_1000_registro_andamentos_onfocus(this, iSeqRow) });
  $('#id_sc_field_area_nivel_atual' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_area_nivel_atual_onblur('#id_sc_field_area_nivel_atual' + iSeqRow, iSeqRow) })
                                              .bind('change', function() { sc_form_OUVD_1000_registro_area_nivel_atual_onchange(this, iSeqRow) })
                                              .bind('focus', function() { sc_form_OUVD_1000_registro_area_nivel_atual_onfocus(this, iSeqRow) });
  $('#id_sc_field_fld_alertas' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_fld_alertas_onblur('#id_sc_field_fld_alertas' + iSeqRow, iSeqRow) })
                                         .bind('change', function() { sc_form_OUVD_1000_registro_fld_alertas_onchange(this, iSeqRow) })
                                         .bind('focus', function() { sc_form_OUVD_1000_registro_fld_alertas_onfocus(this, iSeqRow) });
  $('#id_sc_field_last_status' + iSeqRow).bind('change', function() { sc_form_OUVD_1000_registro_last_status_onchange(this, iSeqRow) });
  $('#id_sc_field_md_fluxo' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_md_fluxo_onblur('#id_sc_field_md_fluxo' + iSeqRow, iSeqRow) })
                                      .bind('change', function() { sc_form_OUVD_1000_registro_md_fluxo_onchange(this, iSeqRow) })
                                      .bind('focus', function() { sc_form_OUVD_1000_registro_md_fluxo_onfocus(this, iSeqRow) });
  $('#id_sc_field_resp_nivel_atual' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_resp_nivel_atual_onblur('#id_sc_field_resp_nivel_atual' + iSeqRow, iSeqRow) })
                                              .bind('change', function() { sc_form_OUVD_1000_registro_resp_nivel_atual_onchange(this, iSeqRow) })
                                              .bind('focus', function() { sc_form_OUVD_1000_registro_resp_nivel_atual_onfocus(this, iSeqRow) });
  $('#id_sc_field_fld_label_status' + iSeqRow).bind('blur', function() { sc_form_OUVD_1000_registro_fld_label_status_onblur('#id_sc_field_fld_label_status' + iSeqRow, iSeqRow) })
                                              .bind('change', function() { sc_form_OUVD_1000_registro_fld_label_status_onchange(this, iSeqRow) })
                                              .bind('focus', function() { sc_form_OUVD_1000_registro_fld_label_status_onfocus(this, iSeqRow) });
  $('.sc-ui-radio-ouvd_anonima_1000' + iSeqRow).on('click', function() { scMarkFormAsChanged(); });
} // scJQEventsAdd

function sc_form_OUVD_1000_registro_id_registro_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_titulo_manifestacao_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_titulo_manifestacao_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_titulo_manifestacao_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_titulo_manifestacao_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_desc_manifestacao_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_desc_manifestacao_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_desc_manifestacao_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_desc_manifestacao_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_id_categoria_1100_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_id_categoria_1100();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_id_categoria_1100_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_id_categoria_1100_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_desc_area_setor_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_desc_area_setor_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_desc_area_setor_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_desc_area_setor_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_dt_ocorrido_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_dt_ocorrido_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_dt_ocorrido_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_dt_ocorrido_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_ouvd_anonima_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_ouvd_anonima_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_ouvd_anonima_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_ouvd_anonima_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_nome_inf_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_nome_inf_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_nome_inf_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_nome_inf_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_cpf_cnpj_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_cpf_cnpj_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_cpf_cnpj_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_cpf_cnpj_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_tel_inf_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_tel_inf_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_tel_inf_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_tel_inf_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_email_inf_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_email_inf_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_email_inf_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_email_inf_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_dt_ini_inv_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_dt_ini_inv_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_dt_ini_inv_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_dt_ini_inv_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_andamento_inv_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_andamento_inv_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_andamento_inv_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_andamento_inv_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_conclusao_inv_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_conclusao_inv_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_conclusao_inv_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_conclusao_inv_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_nivel_atend_atual_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_nivel_atend_atual_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_nivel_atend_atual_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_nivel_atend_atual_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_id_status_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_id_status_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_id_status_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_id_status_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_id_controlador_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_data_hora_cadastro_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_data_hora_cadastro_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_data_hora_cadastro_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_data_hora_cadastro_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_token_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_token_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_token_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_token_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_img1_1000_onblur(oThis, iSeqRow) {
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_img1_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_anexo_ouvd_img1_1000_onfocus(oThis, iSeqRow) {
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_img2_1000_onblur(oThis, iSeqRow) {
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_img2_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_anexo_ouvd_img2_1000_onfocus(oThis, iSeqRow) {
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_doc1_1000_onblur(oThis, iSeqRow) {
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_doc1_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_anexo_ouvd_doc1_1000_onfocus(oThis, iSeqRow) {
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_doc2_1000_onblur(oThis, iSeqRow) {
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_anexo_ouvd_doc2_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_anexo_ouvd_doc2_1000_onfocus(oThis, iSeqRow) {
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_dt_enc_ouvd_1000_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_dt_enc_ouvd_1000();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_dt_enc_ouvd_1000_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_dt_enc_ouvd_1000_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_andamentos_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_andamentos();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_andamentos_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_andamentos_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_area_nivel_atual_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_area_nivel_atual();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_area_nivel_atual_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_area_nivel_atual_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_fld_alertas_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_fld_alertas();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_fld_alertas_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_fld_alertas_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_last_status_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_md_fluxo_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_md_fluxo();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_md_fluxo_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_md_fluxo_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_resp_nivel_atual_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_resp_nivel_atual();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_resp_nivel_atual_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_resp_nivel_atual_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function sc_form_OUVD_1000_registro_fld_label_status_onblur(oThis, iSeqRow) {
  do_ajax_form_OUVD_1000_registro_validate_fld_label_status();
  scCssBlur(oThis);
}

function sc_form_OUVD_1000_registro_fld_label_status_onchange(oThis, iSeqRow) {
  scMarkFormAsChanged();
}

function sc_form_OUVD_1000_registro_fld_label_status_onfocus(oThis, iSeqRow) {
  scEventControl_onFocus(oThis, iSeqRow);
  scCssFocus(oThis);
}

function displayChange_block(block, status) {
        if ("0" == block) {
                displayChange_block_0(status);
        }
        if ("1" == block) {
                displayChange_block_1(status);
        }
        if ("2" == block) {
                displayChange_block_2(status);
        }
        if ("3" == block) {
                displayChange_block_3(status);
        }
        if ("4" == block) {
                displayChange_block_4(status);
        }
        if ("5" == block) {
                displayChange_block_5(status);
        }
        if ("6" == block) {
                displayChange_block_6(status);
        }
        if ("7" == block) {
                displayChange_block_7(status);
        }
        if ("8" == block) {
                displayChange_block_8(status);
        }
        if ("9" == block) {
                displayChange_block_9(status);
        }
        if ("10" == block) {
                displayChange_block_10(status);
        }
}

function displayChange_block_0(status) {
        displayChange_field("fld_alertas", "", status);
        displayChange_field("fld_label_status", "", status);
}

function displayChange_block_1(status) {
        displayChange_field("data_hora_cadastro_1000", "", status);
        displayChange_field("titulo_manifestacao_1000", "", status);
        displayChange_field("desc_manifestacao_1000", "", status);
}

function displayChange_block_2(status) {
        displayChange_field("token_ouvd_1000", "", status);
        displayChange_field("dt_ocorrido_1000", "", status);
        displayChange_field("desc_area_setor_1000", "", status);
        displayChange_field("id_categoria_1100", "", status);
        displayChange_field("ouvd_anonima_1000", "", status);
}

function displayChange_block_3(status) {
        displayChange_field("nome_inf_ouvd_1000", "", status);
        displayChange_field("email_inf_ouvd_1000", "", status);
        displayChange_field("cpf_cnpj_ouvd_1000", "", status);
        displayChange_field("tel_inf_ouvd_1000", "", status);
}

function displayChange_block_4(status) {
        displayChange_field("nivel_atend_atual_1000", "", status);
        displayChange_field("area_nivel_atual", "", status);
        displayChange_field("resp_nivel_atual", "", status);
}

function displayChange_block_5(status) {
        displayChange_field("id_status_ouvd_1000", "", status);
        displayChange_field("dt_ini_inv_ouvd_1000", "", status);
        displayChange_field("dt_enc_ouvd_1000", "", status);
}

function displayChange_block_6(status) {
        displayChange_field("andamento_inv_ouvd_1000", "", status);
}

function displayChange_block_7(status) {
        displayChange_field("conclusao_inv_ouvd_1000", "", status);
}

function displayChange_block_8(status) {
        displayChange_field("andamentos", "", status);
}

function displayChange_block_9(status) {
        displayChange_field("md_fluxo", "", status);
}

function displayChange_block_10(status) {
        displayChange_field("anexo_ouvd_img1_1000", "", status);
        displayChange_field("anexo_ouvd_img2_1000", "", status);
        displayChange_field("anexo_ouvd_doc1_1000", "", status);
        displayChange_field("anexo_ouvd_doc2_1000", "", status);
}

function displayChange_row(row, status) {
        displayChange_field_fld_alertas(row, status);
        displayChange_field_fld_label_status(row, status);
        displayChange_field_data_hora_cadastro_1000(row, status);
        displayChange_field_titulo_manifestacao_1000(row, status);
        displayChange_field_desc_manifestacao_1000(row, status);
        displayChange_field_token_ouvd_1000(row, status);
        displayChange_field_dt_ocorrido_1000(row, status);
        displayChange_field_desc_area_setor_1000(row, status);
        displayChange_field_id_categoria_1100(row, status);
        displayChange_field_ouvd_anonima_1000(row, status);
        displayChange_field_nome_inf_ouvd_1000(row, status);
        displayChange_field_email_inf_ouvd_1000(row, status);
        displayChange_field_cpf_cnpj_ouvd_1000(row, status);
        displayChange_field_tel_inf_ouvd_1000(row, status);
        displayChange_field_nivel_atend_atual_1000(row, status);
        displayChange_field_area_nivel_atual(row, status);
        displayChange_field_resp_nivel_atual(row, status);
        displayChange_field_id_status_ouvd_1000(row, status);
        displayChange_field_dt_ini_inv_ouvd_1000(row, status);
        displayChange_field_dt_enc_ouvd_1000(row, status);
        displayChange_field_andamento_inv_ouvd_1000(row, status);
        displayChange_field_conclusao_inv_ouvd_1000(row, status);
        displayChange_field_andamentos(row, status);
        displayChange_field_md_fluxo(row, status);
        displayChange_field_anexo_ouvd_img1_1000(row, status);
        displayChange_field_anexo_ouvd_img2_1000(row, status);
        displayChange_field_anexo_ouvd_doc1_1000(row, status);
        displayChange_field_anexo_ouvd_doc2_1000(row, status);
}

function displayChange_field(field, row, status) {
        if ("fld_alertas" == field) {
                displayChange_field_fld_alertas(row, status);
        }
        if ("fld_label_status" == field) {
                displayChange_field_fld_label_status(row, status);
        }
        if ("data_hora_cadastro_1000" == field) {
                displayChange_field_data_hora_cadastro_1000(row, status);
        }
        if ("titulo_manifestacao_1000" == field) {
                displayChange_field_titulo_manifestacao_1000(row, status);
        }
        if ("desc_manifestacao_1000" == field) {
                displayChange_field_desc_manifestacao_1000(row, status);
        }
        if ("token_ouvd_1000" == field) {
                displayChange_field_token_ouvd_1000(row, status);
        }
        if ("dt_ocorrido_1000" == field) {
                displayChange_field_dt_ocorrido_1000(row, status);
        }
        if ("desc_area_setor_1000" == field) {
                displayChange_field_desc_area_setor_1000(row, status);
        }
        if ("id_categoria_1100" == field) {
                displayChange_field_id_categoria_1100(row, status);
        }
        if ("ouvd_anonima_1000" == field) {
                displayChange_field_ouvd_anonima_1000(row, status);
        }
        if ("nome_inf_ouvd_1000" == field) {
                displayChange_field_nome_inf_ouvd_1000(row, status);
        }
        if ("email_inf_ouvd_1000" == field) {
                displayChange_field_email_inf_ouvd_1000(row, status);
        }
        if ("cpf_cnpj_ouvd_1000" == field) {
                displayChange_field_cpf_cnpj_ouvd_1000(row, status);
        }
        if ("tel_inf_ouvd_1000" == field) {
                displayChange_field_tel_inf_ouvd_1000(row, status);
        }
        if ("nivel_atend_atual_1000" == field) {
                displayChange_field_nivel_atend_atual_1000(row, status);
        }
        if ("area_nivel_atual" == field) {
                displayChange_field_area_nivel_atual(row, status);
        }
        if ("resp_nivel_atual" == field) {
                displayChange_field_resp_nivel_atual(row, status);
        }
        if ("id_status_ouvd_1000" == field) {
                displayChange_field_id_status_ouvd_1000(row, status);
        }
        if ("dt_ini_inv_ouvd_1000" == field) {
                displayChange_field_dt_ini_inv_ouvd_1000(row, status);
        }
        if ("dt_enc_ouvd_1000" == field) {
                displayChange_field_dt_enc_ouvd_1000(row, status);
        }
        if ("andamento_inv_ouvd_1000" == field) {
                displayChange_field_andamento_inv_ouvd_1000(row, status);
        }
        if ("conclusao_inv_ouvd_1000" == field) {
                displayChange_field_conclusao_inv_ouvd_1000(row, status);
        }
        if ("andamentos" == field) {
                displayChange_field_andamentos(row, status);
        }
        if ("md_fluxo" == field) {
                displayChange_field_md_fluxo(row, status);
        }
        if ("anexo_ouvd_img1_1000" == field) {
                displayChange_field_anexo_ouvd_img1_1000(row, status);
        }
        if ("anexo_ouvd_img2_1000" == field) {
                displayChange_field_anexo_ouvd_img2_1000(row, status);
        }
        if ("anexo_ouvd_doc1_1000" == field) {
                displayChange_field_anexo_ouvd_doc1_1000(row, status);
        }
        if ("anexo_ouvd_doc2_1000" == field) {
                displayChange_field_anexo_ouvd_doc2_1000(row, status);
        }
}

function displayChange_field_fld_alertas(row, status) {
    var fieldId;
}

function displayChange_field_fld_label_status(row, status) {
    var fieldId;
}

function displayChange_field_data_hora_cadastro_1000(row, status) {
    var fieldId;
}

function displayChange_field_titulo_manifestacao_1000(row, status) {
    var fieldId;
}

function displayChange_field_desc_manifestacao_1000(row, status) {
    var fieldId;
}

function displayChange_field_token_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_dt_ocorrido_1000(row, status) {
    var fieldId;
}

function displayChange_field_desc_area_setor_1000(row, status) {
    var fieldId;
}

function displayChange_field_id_categoria_1100(row, status) {
    var fieldId;
}

function displayChange_field_ouvd_anonima_1000(row, status) {
    var fieldId;
}

function displayChange_field_nome_inf_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_email_inf_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_cpf_cnpj_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_tel_inf_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_nivel_atend_atual_1000(row, status) {
    var fieldId;
}

function displayChange_field_area_nivel_atual(row, status) {
    var fieldId;
}

function displayChange_field_resp_nivel_atual(row, status) {
    var fieldId;
}

function displayChange_field_id_status_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_dt_ini_inv_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_dt_enc_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_andamento_inv_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_conclusao_inv_ouvd_1000(row, status) {
    var fieldId;
}

function displayChange_field_andamentos(row, status) {
    var fieldId;
        if ("on" == status && typeof $("#nmsc_iframe_liga_grid_OUVD_2000_andamento")[0].contentWindow.scRecreateSelect2 === "function") {
                $("#nmsc_iframe_liga_grid_OUVD_2000_andamento")[0].contentWindow.scRecreateSelect2();
        }
}

function displayChange_field_md_fluxo(row, status) {
    var fieldId;
        if ("on" == status && typeof $("#nmsc_iframe_liga_grid_OUVD_3000_fluxo_nivel")[0].contentWindow.scRecreateSelect2 === "function") {
                $("#nmsc_iframe_liga_grid_OUVD_3000_fluxo_nivel")[0].contentWindow.scRecreateSelect2();
        }
}

function displayChange_field_anexo_ouvd_img1_1000(row, status) {
    var fieldId;
}

function displayChange_field_anexo_ouvd_img2_1000(row, status) {
    var fieldId;
}

function displayChange_field_anexo_ouvd_doc1_1000(row, status) {
    var fieldId;
}

function displayChange_field_anexo_ouvd_doc2_1000(row, status) {
    var fieldId;
}

function scRecreateSelect2() {
}
function scResetPagesDisplay() {
        $(".sc-form-page").show();
}

function scHidePage(pageNo) {
        $("#id_form_OUVD_1000_registro_form" + pageNo).hide();
}

function scCheckNoPageSelected() {
        if (!$(".sc-form-page").filter(".scTabActive").filter(":visible").length) {
                var inactiveTabs = $(".sc-form-page").filter(".scTabInactive").filter(":visible");
                if (inactiveTabs.length) {
                        var tabNo = $(inactiveTabs[0]).attr("id").substr(31);
                }
        }
}
var sc_jq_calendar_value = {};

function scJQCalendarAdd(iSeqRow) {
  $("#id_sc_field_data_hora_cadastro_1000" + iSeqRow).datepicker('destroy');
  $("#id_sc_field_data_hora_cadastro_1000" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_data_hora_cadastro_1000" + iSeqRow] = $oField.val();
    },
    onClose: function(dateText, inst) {
      do_ajax_form_OUVD_1000_registro_validate_data_hora_cadastro_1000(iSeqRow);
    },
    showWeek: true,
    numberOfMonths: 1,
    changeMonth: true,
    changeYear: true,
    yearRange: 'c-5:c+5',
    dayNames: ["<?php        echo html_entity_decode($this->Ini->Nm_lang['lang_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>"],
    dayNamesMin: ["<?php     echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    monthNames: ["<?php      echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_janu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_febr"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_marc"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_apri"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_mayy"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_june"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_july"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_augu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_sept"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_octo"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_nove"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_dece"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>"],
    monthNamesShort: ["<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_janu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_febr'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_marc'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_apri'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_mayy'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_june'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_july'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_augu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_sept'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_octo'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_nove'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_dece'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    weekHeader: "<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_days_sem'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>",
    firstDay: <?php echo $this->jqueryCalendarWeekInit("" . $_SESSION['scriptcase']['reg_conf']['date_week_ini'] . ""); ?>,
    dateFormat: "<?php echo $this->jqueryCalendarDtFormat("" . str_replace(array('/', 'aaaa', $_SESSION['scriptcase']['reg_conf']['date_sep']), array('', 'yyyy', ''), $this->field_config['data_hora_cadastro_1000']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
<?php
$miniCalendarIcon   = $this->jqueryIconFile('calendar');
$miniCalendarFA     = $this->jqueryFAFile('calendar');
$miniCalendarButton = $this->jqueryButtonText('calendar');
if ('' != $miniCalendarIcon) {
?>
    buttonImage: "<?php echo $miniCalendarIcon; ?>",
    buttonImageOnly: true,
<?php
}
elseif ('' != $miniCalendarFA) {
?>
    buttonText: "",
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    buttonText: "",
<?php
}
?>
    currentText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_per_today"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
    closeText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_btns_mess_clse"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
  })
<?php
if ('' != $miniCalendarFA) {
?>
    .next('button').append("<?php echo $miniCalendarFA; ?>")
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    .next('button').append("<?php echo $miniCalendarButton[0]; ?>")
<?php
}
?>
  $("#id_sc_field_dt_ocorrido_1000" + iSeqRow).datepicker('destroy');
  $("#id_sc_field_dt_ocorrido_1000" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_dt_ocorrido_1000" + iSeqRow] = $oField.val();
    },
    onClose: function(dateText, inst) {
      do_ajax_form_OUVD_1000_registro_validate_dt_ocorrido_1000(iSeqRow);
    },
    showWeek: true,
    numberOfMonths: 1,
    changeMonth: true,
    changeYear: true,
    yearRange: 'c-5:c+5',
    dayNames: ["<?php        echo html_entity_decode($this->Ini->Nm_lang['lang_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>"],
    dayNamesMin: ["<?php     echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    monthNames: ["<?php      echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_janu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_febr"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_marc"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_apri"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_mayy"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_june"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_july"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_augu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_sept"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_octo"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_nove"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_dece"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>"],
    monthNamesShort: ["<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_janu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_febr'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_marc'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_apri'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_mayy'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_june'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_july'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_augu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_sept'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_octo'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_nove'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_dece'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    weekHeader: "<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_days_sem'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>",
    firstDay: <?php echo $this->jqueryCalendarWeekInit("" . $_SESSION['scriptcase']['reg_conf']['date_week_ini'] . ""); ?>,
    dateFormat: "<?php echo $this->jqueryCalendarDtFormat("" . str_replace(array('/', 'aaaa', $_SESSION['scriptcase']['reg_conf']['date_sep']), array('', 'yyyy', ''), $this->field_config['dt_ocorrido_1000']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
<?php
$miniCalendarIcon   = $this->jqueryIconFile('calendar');
$miniCalendarFA     = $this->jqueryFAFile('calendar');
$miniCalendarButton = $this->jqueryButtonText('calendar');
if ('' != $miniCalendarIcon) {
?>
    buttonImage: "<?php echo $miniCalendarIcon; ?>",
    buttonImageOnly: true,
<?php
}
elseif ('' != $miniCalendarFA) {
?>
    buttonText: "",
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    buttonText: "",
<?php
}
?>
    currentText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_per_today"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
    closeText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_btns_mess_clse"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
  })
<?php
if ('' != $miniCalendarFA) {
?>
    .next('button').append("<?php echo $miniCalendarFA; ?>")
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    .next('button').append("<?php echo $miniCalendarButton[0]; ?>")
<?php
}
?>
  $("#id_sc_field_dt_ini_inv_ouvd_1000" + iSeqRow).datepicker('destroy');
  $("#id_sc_field_dt_ini_inv_ouvd_1000" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_dt_ini_inv_ouvd_1000" + iSeqRow] = $oField.val();
    },
    onClose: function(dateText, inst) {
      do_ajax_form_OUVD_1000_registro_validate_dt_ini_inv_ouvd_1000(iSeqRow);
    },
    showWeek: true,
    numberOfMonths: 1,
    changeMonth: true,
    changeYear: true,
    yearRange: 'c-5:c+5',
    minDate: new Date('<?php echo date('Y-m-d', strtotime(date('Y-m-d') . ' +1 day')); ?>'),
    dayNames: ["<?php        echo html_entity_decode($this->Ini->Nm_lang['lang_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>"],
    dayNamesMin: ["<?php     echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    monthNames: ["<?php      echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_janu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_febr"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_marc"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_apri"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_mayy"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_june"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_july"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_augu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_sept"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_octo"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_nove"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_dece"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>"],
    monthNamesShort: ["<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_janu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_febr'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_marc'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_apri'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_mayy'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_june'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_july'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_augu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_sept'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_octo'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_nove'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_dece'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    weekHeader: "<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_days_sem'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>",
    firstDay: <?php echo $this->jqueryCalendarWeekInit("" . $_SESSION['scriptcase']['reg_conf']['date_week_ini'] . ""); ?>,
    dateFormat: "<?php echo $this->jqueryCalendarDtFormat("" . str_replace(array('/', 'aaaa', $_SESSION['scriptcase']['reg_conf']['date_sep']), array('', 'yyyy', ''), $this->field_config['dt_ini_inv_ouvd_1000']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
<?php
$miniCalendarIcon   = $this->jqueryIconFile('calendar');
$miniCalendarFA     = $this->jqueryFAFile('calendar');
$miniCalendarButton = $this->jqueryButtonText('calendar');
if ('' != $miniCalendarIcon) {
?>
    buttonImage: "<?php echo $miniCalendarIcon; ?>",
    buttonImageOnly: true,
<?php
}
elseif ('' != $miniCalendarFA) {
?>
    buttonText: "",
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    buttonText: "",
<?php
}
?>
    currentText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_per_today"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
    closeText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_btns_mess_clse"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
  })
<?php
if ('' != $miniCalendarFA) {
?>
    .next('button').append("<?php echo $miniCalendarFA; ?>")
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    .next('button').append("<?php echo $miniCalendarButton[0]; ?>")
<?php
}
?>
  $("#id_sc_field_dt_enc_ouvd_1000" + iSeqRow).datepicker('destroy');
  $("#id_sc_field_dt_enc_ouvd_1000" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_dt_enc_ouvd_1000" + iSeqRow] = $oField.val();
    },
    onClose: function(dateText, inst) {
      do_ajax_form_OUVD_1000_registro_validate_dt_enc_ouvd_1000(iSeqRow);
    },
    showWeek: true,
    numberOfMonths: 1,
    changeMonth: true,
    changeYear: true,
    yearRange: 'c-5:c+5',
    dayNames: ["<?php        echo html_entity_decode($this->Ini->Nm_lang['lang_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);        ?>"],
    dayNamesMin: ["<?php     echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_sund'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_mond'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_tued'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_wend'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_thud'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_frid'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_satd'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    monthNames: ["<?php      echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_janu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_febr"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_marc"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_apri"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_mayy"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_june"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_july"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_augu"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_sept"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_octo"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_nove"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>","<?php echo html_entity_decode($this->Ini->Nm_lang["lang_mnth_dece"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);      ?>"],
    monthNamesShort: ["<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_janu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_febr'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_marc'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_apri'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_mayy'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_june'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_july'], ENT_COMPAT, $_SESSION['scriptcase']['charset']);   ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_augu'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_sept'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_octo'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_nove'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>","<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_dece'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>"],
    weekHeader: "<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_days_sem'], ENT_COMPAT, $_SESSION['scriptcase']['charset']); ?>",
    firstDay: <?php echo $this->jqueryCalendarWeekInit("" . $_SESSION['scriptcase']['reg_conf']['date_week_ini'] . ""); ?>,
    dateFormat: "<?php echo $this->jqueryCalendarDtFormat("" . str_replace(array('/', 'aaaa', $_SESSION['scriptcase']['reg_conf']['date_sep']), array('', 'yyyy', ''), $this->field_config['dt_enc_ouvd_1000']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
<?php
$miniCalendarIcon   = $this->jqueryIconFile('calendar');
$miniCalendarFA     = $this->jqueryFAFile('calendar');
$miniCalendarButton = $this->jqueryButtonText('calendar');
if ('' != $miniCalendarIcon) {
?>
    buttonImage: "<?php echo $miniCalendarIcon; ?>",
    buttonImageOnly: true,
<?php
}
elseif ('' != $miniCalendarFA) {
?>
    buttonText: "",
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    buttonText: "",
<?php
}
?>
    currentText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_per_today"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
    closeText: "<?php  echo html_entity_decode($this->Ini->Nm_lang["lang_btns_mess_clse"], ENT_COMPAT, $_SESSION["scriptcase"]["charset"]);       ?>",
  })
<?php
if ('' != $miniCalendarFA) {
?>
    .next('button').append("<?php echo $miniCalendarFA; ?>")
<?php
}
elseif ('' != $miniCalendarButton[0]) {
?>
    .next('button').append("<?php echo $miniCalendarButton[0]; ?>")
<?php
}
?>
} // scJQCalendarAdd

function scJQUploadAdd(iSeqRow) {
  $("#id_sc_field_anexo_ouvd_img1_1000" + iSeqRow).fileupload({
    datatype: "json",
    url: "form_OUVD_1000_registro_ul_save.php",
    dropZone: $("#hidden_field_data_anexo_ouvd_img1_1000" + iSeqRow),
    formData: function() {
      return [
        {name: 'param_field', value: 'anexo_ouvd_img1_1000'},
        {name: 'param_seq', value: '<?php echo $this->Ini->sc_page; ?>'},
        {name: 'upload_file_row', value: iSeqRow}
      ];
    },
    progress: function(e, data) {
      var loader, progress;
      if (data.lengthComputable && window.FormData !== undefined) {
        loader = $("#id_img_loader_anexo_ouvd_img1_1000" + iSeqRow);
        loaderContent = $("#id_img_loader_anexo_ouvd_img1_1000" + iSeqRow + " .scProgressBarLoading");
        loaderContent.html("&nbsp;");
        progress = parseInt(data.loaded / data.total * 100, 10);
        loader.show().find("div").css("width", progress + "%");
      }
      else {
        loader = $("#id_ajax_loader_anexo_ouvd_img1_1000" + iSeqRow);
        loader.show();
      }
    },
    done: function(e, data) {
      var fileData, respData, respPos, respMsg, thumbDisplay, checkDisplay, var_ajax_img_thumb, oTemp;
      fileData = null;
      respMsg = "";
      if (data && data.result && data.result[0] && data.result[0].body) {
        respData = data.result[0].body.innerText;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = $.parseJSON(respData);
        }
        else {
          respMsg = respData;
        }
      }
      else {
        respData = data.result;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = eval(respData);
        }
        else {
          respMsg = respData;
        }
      }
      if (window.FormData !== undefined)
      {
        $("#id_img_loader_anexo_ouvd_img1_1000" + iSeqRow).hide();
      }
      else
      {
        $("#id_ajax_loader_anexo_ouvd_img1_1000" + iSeqRow).hide();
      }
      if (null == fileData) {
        if ("" != respMsg) {
          oTemp = {"htmOutput" : "<?php echo $this->Ini->Nm_lang['lang_errm_upld_admn']; ?>"};
          scAjaxShowDebug(oTemp);
        }
        return;
      }
      if (fileData[0].error && "" != fileData[0].error) {
        var uploadErrorMessage = "";
        oResp = {};
        if ("acceptFileTypes" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_invl']) ?>";
        }
        else if ("maxFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("minFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("emptyFile" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_empty']) ?>";
        }
        scAjaxShowErrorDisplay("table", uploadErrorMessage);
        return;
      }
      $("#id_sc_field_anexo_ouvd_img1_1000" + iSeqRow).val("");
      $("#id_sc_field_anexo_ouvd_img1_1000_ul_name" + iSeqRow).val(fileData[0].sc_ul_name);
      $("#id_sc_field_anexo_ouvd_img1_1000_ul_type" + iSeqRow).val(fileData[0].type);
      var_ajax_img_anexo_ouvd_img1_1000 = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_image_source;
      var_ajax_img_thumb = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_thumb_prot;
      thumbDisplay = ("" == var_ajax_img_anexo_ouvd_img1_1000) ? "none" : "";
      $("#id_ajax_img_anexo_ouvd_img1_1000" + iSeqRow).attr("src", var_ajax_img_thumb);
      $("#id_ajax_img_anexo_ouvd_img1_1000" + iSeqRow).css("display", thumbDisplay);
      if (document.F1.temp_out1_anexo_ouvd_img1_1000) {
        document.F1.temp_out_anexo_ouvd_img1_1000.value = var_ajax_img_thumb;
        document.F1.temp_out1_anexo_ouvd_img1_1000.value = var_ajax_img_anexo_ouvd_img1_1000;
      }
      else if (document.F1.temp_out_anexo_ouvd_img1_1000) {
        document.F1.temp_out_anexo_ouvd_img1_1000.value = var_ajax_img_anexo_ouvd_img1_1000;
      }
      checkDisplay = ("" == fileData[0].sc_random_prot.substr(12)) ? "none" : "";
      $("#chk_ajax_img_anexo_ouvd_img1_1000" + iSeqRow).css("display", checkDisplay);
      $("#txt_ajax_img_anexo_ouvd_img1_1000" + iSeqRow).html(fileData[0].name);
      $("#txt_ajax_img_anexo_ouvd_img1_1000" + iSeqRow).css("display", checkDisplay);
      $("#id_ajax_link_anexo_ouvd_img1_1000" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
    }
  });

  $("#id_sc_field_anexo_ouvd_img2_1000" + iSeqRow).fileupload({
    datatype: "json",
    url: "form_OUVD_1000_registro_ul_save.php",
    dropZone: $("#hidden_field_data_anexo_ouvd_img2_1000" + iSeqRow),
    formData: function() {
      return [
        {name: 'param_field', value: 'anexo_ouvd_img2_1000'},
        {name: 'param_seq', value: '<?php echo $this->Ini->sc_page; ?>'},
        {name: 'upload_file_row', value: iSeqRow}
      ];
    },
    progress: function(e, data) {
      var loader, progress;
      if (data.lengthComputable && window.FormData !== undefined) {
        loader = $("#id_img_loader_anexo_ouvd_img2_1000" + iSeqRow);
        loaderContent = $("#id_img_loader_anexo_ouvd_img2_1000" + iSeqRow + " .scProgressBarLoading");
        loaderContent.html("&nbsp;");
        progress = parseInt(data.loaded / data.total * 100, 10);
        loader.show().find("div").css("width", progress + "%");
      }
      else {
        loader = $("#id_ajax_loader_anexo_ouvd_img2_1000" + iSeqRow);
        loader.show();
      }
    },
    done: function(e, data) {
      var fileData, respData, respPos, respMsg, thumbDisplay, checkDisplay, var_ajax_img_thumb, oTemp;
      fileData = null;
      respMsg = "";
      if (data && data.result && data.result[0] && data.result[0].body) {
        respData = data.result[0].body.innerText;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = $.parseJSON(respData);
        }
        else {
          respMsg = respData;
        }
      }
      else {
        respData = data.result;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = eval(respData);
        }
        else {
          respMsg = respData;
        }
      }
      if (window.FormData !== undefined)
      {
        $("#id_img_loader_anexo_ouvd_img2_1000" + iSeqRow).hide();
      }
      else
      {
        $("#id_ajax_loader_anexo_ouvd_img2_1000" + iSeqRow).hide();
      }
      if (null == fileData) {
        if ("" != respMsg) {
          oTemp = {"htmOutput" : "<?php echo $this->Ini->Nm_lang['lang_errm_upld_admn']; ?>"};
          scAjaxShowDebug(oTemp);
        }
        return;
      }
      if (fileData[0].error && "" != fileData[0].error) {
        var uploadErrorMessage = "";
        oResp = {};
        if ("acceptFileTypes" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_invl']) ?>";
        }
        else if ("maxFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("minFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("emptyFile" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_empty']) ?>";
        }
        scAjaxShowErrorDisplay("table", uploadErrorMessage);
        return;
      }
      $("#id_sc_field_anexo_ouvd_img2_1000" + iSeqRow).val("");
      $("#id_sc_field_anexo_ouvd_img2_1000_ul_name" + iSeqRow).val(fileData[0].sc_ul_name);
      $("#id_sc_field_anexo_ouvd_img2_1000_ul_type" + iSeqRow).val(fileData[0].type);
      var_ajax_img_anexo_ouvd_img2_1000 = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_image_source;
      var_ajax_img_thumb = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_thumb_prot;
      thumbDisplay = ("" == var_ajax_img_anexo_ouvd_img2_1000) ? "none" : "";
      $("#id_ajax_img_anexo_ouvd_img2_1000" + iSeqRow).attr("src", var_ajax_img_thumb);
      $("#id_ajax_img_anexo_ouvd_img2_1000" + iSeqRow).css("display", thumbDisplay);
      if (document.F1.temp_out1_anexo_ouvd_img2_1000) {
        document.F1.temp_out_anexo_ouvd_img2_1000.value = var_ajax_img_thumb;
        document.F1.temp_out1_anexo_ouvd_img2_1000.value = var_ajax_img_anexo_ouvd_img2_1000;
      }
      else if (document.F1.temp_out_anexo_ouvd_img2_1000) {
        document.F1.temp_out_anexo_ouvd_img2_1000.value = var_ajax_img_anexo_ouvd_img2_1000;
      }
      checkDisplay = ("" == fileData[0].sc_random_prot.substr(12)) ? "none" : "";
      $("#chk_ajax_img_anexo_ouvd_img2_1000" + iSeqRow).css("display", checkDisplay);
      $("#txt_ajax_img_anexo_ouvd_img2_1000" + iSeqRow).html(fileData[0].name);
      $("#txt_ajax_img_anexo_ouvd_img2_1000" + iSeqRow).css("display", checkDisplay);
      $("#id_ajax_link_anexo_ouvd_img2_1000" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
    }
  });

  $("#id_sc_field_anexo_ouvd_doc1_1000" + iSeqRow).fileupload({
    datatype: "json",
    url: "form_OUVD_1000_registro_ul_save.php",
    dropZone: $("#hidden_field_data_anexo_ouvd_doc1_1000" + iSeqRow),
    formData: function() {
      return [
        {name: 'param_field', value: 'anexo_ouvd_doc1_1000'},
        {name: 'param_seq', value: '<?php echo $this->Ini->sc_page; ?>'},
        {name: 'upload_file_row', value: iSeqRow}
      ];
    },
    progress: function(e, data) {
      var loader, progress;
      if (data.lengthComputable && window.FormData !== undefined) {
        loader = $("#id_img_loader_anexo_ouvd_doc1_1000" + iSeqRow);
        loaderContent = $("#id_img_loader_anexo_ouvd_doc1_1000" + iSeqRow + " .scProgressBarLoading");
        loaderContent.html("&nbsp;");
        progress = parseInt(data.loaded / data.total * 100, 10);
        loader.show().find("div").css("width", progress + "%");
      }
      else {
        loader = $("#id_ajax_loader_anexo_ouvd_doc1_1000" + iSeqRow);
        loader.show();
      }
    },
    done: function(e, data) {
      var fileData, respData, respPos, respMsg, thumbDisplay, checkDisplay, var_ajax_img_thumb, oTemp;
      fileData = null;
      respMsg = "";
      if (data && data.result && data.result[0] && data.result[0].body) {
        respData = data.result[0].body.innerText;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = $.parseJSON(respData);
        }
        else {
          respMsg = respData;
        }
      }
      else {
        respData = data.result;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = eval(respData);
        }
        else {
          respMsg = respData;
        }
      }
      if (window.FormData !== undefined)
      {
        $("#id_img_loader_anexo_ouvd_doc1_1000" + iSeqRow).hide();
      }
      else
      {
        $("#id_ajax_loader_anexo_ouvd_doc1_1000" + iSeqRow).hide();
      }
      if (null == fileData) {
        if ("" != respMsg) {
          oTemp = {"htmOutput" : "<?php echo $this->Ini->Nm_lang['lang_errm_upld_admn']; ?>"};
          scAjaxShowDebug(oTemp);
        }
        return;
      }
      if (fileData[0].error && "" != fileData[0].error) {
        var uploadErrorMessage = "";
        oResp = {};
        if ("acceptFileTypes" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_invl']) ?>";
        }
        else if ("maxFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("minFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("emptyFile" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_empty']) ?>";
        }
        scAjaxShowErrorDisplay("table", uploadErrorMessage);
        return;
      }
      $("#id_sc_field_anexo_ouvd_doc1_1000" + iSeqRow).val("");
      $("#id_sc_field_anexo_ouvd_doc1_1000_ul_name" + iSeqRow).val(fileData[0].sc_ul_name);
      $("#id_sc_field_anexo_ouvd_doc1_1000_ul_type" + iSeqRow).val(fileData[0].type);
      $("#id_ajax_doc_anexo_ouvd_doc1_1000" + iSeqRow).html(fileData[0].name);
      $("#id_ajax_doc_anexo_ouvd_doc1_1000" + iSeqRow).css("display", "");
      checkDisplay = ("" == fileData[0].sc_random_prot.substr(12)) ? "none" : "";
      $("#chk_ajax_img_anexo_ouvd_doc1_1000" + iSeqRow).css("display", checkDisplay);
      $("#id_ajax_link_anexo_ouvd_doc1_1000" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
    }
  });

  $("#id_sc_field_anexo_ouvd_doc2_1000" + iSeqRow).fileupload({
    datatype: "json",
    url: "form_OUVD_1000_registro_ul_save.php",
    dropZone: $("#hidden_field_data_anexo_ouvd_doc2_1000" + iSeqRow),
    formData: function() {
      return [
        {name: 'param_field', value: 'anexo_ouvd_doc2_1000'},
        {name: 'param_seq', value: '<?php echo $this->Ini->sc_page; ?>'},
        {name: 'upload_file_row', value: iSeqRow}
      ];
    },
    progress: function(e, data) {
      var loader, progress;
      if (data.lengthComputable && window.FormData !== undefined) {
        loader = $("#id_img_loader_anexo_ouvd_doc2_1000" + iSeqRow);
        loaderContent = $("#id_img_loader_anexo_ouvd_doc2_1000" + iSeqRow + " .scProgressBarLoading");
        loaderContent.html("&nbsp;");
        progress = parseInt(data.loaded / data.total * 100, 10);
        loader.show().find("div").css("width", progress + "%");
      }
      else {
        loader = $("#id_ajax_loader_anexo_ouvd_doc2_1000" + iSeqRow);
        loader.show();
      }
    },
    done: function(e, data) {
      var fileData, respData, respPos, respMsg, thumbDisplay, checkDisplay, var_ajax_img_thumb, oTemp;
      fileData = null;
      respMsg = "";
      if (data && data.result && data.result[0] && data.result[0].body) {
        respData = data.result[0].body.innerText;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = $.parseJSON(respData);
        }
        else {
          respMsg = respData;
        }
      }
      else {
        respData = data.result;
        respPos = respData.indexOf("[{");
        if (-1 !== respPos) {
          respMsg = respData.substr(0, respPos);
          respData = respData.substr(respPos);
          fileData = eval(respData);
        }
        else {
          respMsg = respData;
        }
      }
      if (window.FormData !== undefined)
      {
        $("#id_img_loader_anexo_ouvd_doc2_1000" + iSeqRow).hide();
      }
      else
      {
        $("#id_ajax_loader_anexo_ouvd_doc2_1000" + iSeqRow).hide();
      }
      if (null == fileData) {
        if ("" != respMsg) {
          oTemp = {"htmOutput" : "<?php echo $this->Ini->Nm_lang['lang_errm_upld_admn']; ?>"};
          scAjaxShowDebug(oTemp);
        }
        return;
      }
      if (fileData[0].error && "" != fileData[0].error) {
        var uploadErrorMessage = "";
        oResp = {};
        if ("acceptFileTypes" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_invl']) ?>";
        }
        else if ("maxFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("minFileSize" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_size']) ?>";
        }
        else if ("emptyFile" == fileData[0].error) {
          uploadErrorMessage = "<?php echo $this->form_encode_input($this->Ini->Nm_lang['lang_errm_file_empty']) ?>";
        }
        scAjaxShowErrorDisplay("table", uploadErrorMessage);
        return;
      }
      $("#id_sc_field_anexo_ouvd_doc2_1000" + iSeqRow).val("");
      $("#id_sc_field_anexo_ouvd_doc2_1000_ul_name" + iSeqRow).val(fileData[0].sc_ul_name);
      $("#id_sc_field_anexo_ouvd_doc2_1000_ul_type" + iSeqRow).val(fileData[0].type);
      $("#id_ajax_doc_anexo_ouvd_doc2_1000" + iSeqRow).html(fileData[0].name);
      $("#id_ajax_doc_anexo_ouvd_doc2_1000" + iSeqRow).css("display", "");
      checkDisplay = ("" == fileData[0].sc_random_prot.substr(12)) ? "none" : "";
      $("#chk_ajax_img_anexo_ouvd_doc2_1000" + iSeqRow).css("display", checkDisplay);
      $("#id_ajax_link_anexo_ouvd_doc2_1000" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
    }
  });

} // scJQUploadAdd

var api_cache_requests = [];
function ajax_check_file(img_name, field  ,t, p, p_cache, iSeqRow, hasRun, img_before){
    setTimeout(function(){
        if(img_name == '') return;
        iSeqRow= iSeqRow !== undefined && iSeqRow !== null ? iSeqRow : '';
        var hasVar = p.indexOf('_@NM@_') > -1 || p_cache.indexOf('_@NM@_') > -1 ? true : false;

        p = p.split('_@NM@_');
        $.each(p, function(i,v){
            try{
                p[i] = $('[name='+v+iSeqRow+']').val();
            }
            catch(err){
                p[i] = v;
            }
        });
        p = p.join('');

        p_cache = p_cache.split('_@NM@_');
        $.each(p_cache, function(i,v){
            try{
                p_cache[i] = $('[name='+v+iSeqRow+']').val();
            }
            catch(err){
                p_cache[i] = v;
            }
        });
        p_cache = p_cache.join('');

        img_before = img_before !== undefined ? img_before : $(t).attr('src');
        var str_key_cache = '<?php echo $this->Ini->sc_page; ?>' + img_name+field+p+p_cache;
        if(api_cache_requests[ str_key_cache ] !== undefined && api_cache_requests[ str_key_cache ] !== null){
            if(api_cache_requests[ str_key_cache ] != false){
                do_ajax_check_file(api_cache_requests[ str_key_cache ], field  ,t, iSeqRow);
            }
            return;
        }
        //scAjaxProcOn();
        $(t).attr('src', '<?php echo $this->Ini->path_icones ?>/scriptcase__NM__ajax_load.gif');
        api_cache_requests[ str_key_cache ] = false;
        var rs =$.ajax({
                    type: "POST",
                    url: 'index.php?script_case_init=<?php echo $this->Ini->sc_page; ?>',
                    async: true,
                    data:'nmgp_opcao=ajax_check_file&AjaxCheckImg=' + encodeURI(img_name) +'&rsargs='+ field + '&p=' + p + '&p_cache=' + p_cache,
                    success: function (rs) {
                        if(rs.indexOf('</span>') != -1){
                            rs = rs.substr(rs.indexOf('</span>') + 7);
                        }
                        if(rs.indexOf('/') != -1 && rs.indexOf('/') != 0){
                            rs = rs.substr(rs.indexOf('/'));
                        }
                        rs = sc_trim(rs);

                        // if(rs == 0 && hasVar && hasRun === undefined){
                        //     delete window.api_cache_requests[ str_key_cache ];
                        //     ajax_check_file(img_name, field  ,t, p, p_cache, iSeqRow, 1, img_before);
                        //     return;
                        // }
                        window.api_cache_requests[ str_key_cache ] = rs;
                        do_ajax_check_file(rs, field  ,t, iSeqRow)
                        if(rs == 0){
                            delete window.api_cache_requests[ str_key_cache ];

                           // $(t).attr('src',img_before);
                            do_ajax_check_file(img_before+'_@@NM@@_' + img_before, field  ,t, iSeqRow)

                        }


                    }
        });
    },100);
}

function do_ajax_check_file(rs, field  ,t, iSeqRow){
    if (rs != 0) {
        rs_split = rs.split('_@@NM@@_');
        rs_orig = rs_split[0];
        rs2 = rs_split[1];
        try{
            if(!$(t).is('img')){

                if($('#id_read_on_'+field+iSeqRow).length > 0 ){
                                    var usa_read_only = false;

                switch(field){

                }
                     if(usa_read_only && $('a',$('#id_read_on_'+field+iSeqRow)).length == 0){
                         $(t).html("<a href=\"javascript:nm_mostra_doc('0', '"+rs2+"', 'form_OUVD_1000_registro')\">"+$('#id_read_on_'+field+iSeqRow).text()+"</a>");
                     }
                }
                if($('#id_ajax_doc_'+field+iSeqRow+' a').length > 0){
                    var target = $('#id_ajax_doc_'+field+iSeqRow+' a').attr('href').split(',');
                    target[1] = "'"+rs2+"'";
                    $('#id_ajax_doc_'+field+iSeqRow+' a').attr('href', target.join(','));
                }else{
                    var target = $(t).attr('href').split(',');
                     target[1] = "'"+rs2+"'";
                     $(t).attr('href', target.join(','));
                }
            }else{
                $(t).attr('src', rs2);
                $(t).css('display', '');
                if($('#id_ajax_doc_'+field+iSeqRow+' a').length > 0){
                    var target = $('#id_ajax_doc_'+field+iSeqRow+' a').attr('href').split(',');
                    target[1] = "'"+rs2+"'";
                    $(t).attr('href', target.join(','));
                }else{
                     var t_link = $(t).parent('a');
                     var target = $(t_link).attr('href').split(',');
                     target[0] = "javascript:nm_mostra_img('"+rs_orig+"'";
                     $(t_link).attr('href', target.join(','));
                }

            }
            eval("window.var_ajax_img_"+field+iSeqRow+" = '"+rs_orig+"';");

        } catch(err){
                        eval("window.var_ajax_img_"+field+iSeqRow+" = '"+rs_orig+"';");

        }
    }
   /* hasFalseCacheRequest = false;
    $.each(api_cache_requests, function(i,v){
        if(v == false){
            hasFalseCacheRequest = true;
        }
    });
    if(hasFalseCacheRequest == false){
        scAjaxProcOff();
    }*/
}

$(document).ready(function(){
});

function scJQPasswordToggleAdd(seqRow) {
  $(".sc-ui-pwd-toggle-icon" + seqRow).on("click", function() {
    var fieldName = $(this).attr("id").substr(17), fieldObj = $("#id_sc_field_" + fieldName), fieldFA = $("#id_pwd_fa_" + fieldName);
    if ("text" == fieldObj.attr("type")) {
      fieldObj.attr("type", "password");
      fieldFA.attr("class", "fa fa-eye sc-ui-pwd-eye");
    } else {
      fieldObj.attr("type", "text");
      fieldFA.attr("class", "fa fa-eye-slash sc-ui-pwd-eye");
    }
  });
} // scJQPasswordToggleAdd

function scJQSelect2Add(seqRow, specificField) {
} // scJQSelect2Add


function scJQElementsAdd(iLine) {
  scJQEventsAdd(iLine);
  scEventControl_init(iLine);
  scJQCalendarAdd(iLine);
  scJQUploadAdd(iLine);
  scJQPasswordToggleAdd(iLine);
  scJQSelect2Add(iLine);
} // scJQElementsAdd

function scGetFileExtension(fileName)
{
    fileNameParts = fileName.split(".");

    if (1 === fileNameParts.length || (2 === fileNameParts.length && "" == fileNameParts[0])) {
        return "";
    }

    return fileNameParts.pop().toLowerCase();
}

function scFormatExtensionSizeErrorMsg(errorMsg)
{
    var msgInfo = errorMsg.split("||"), returnMsg = "";

    if ("err_size" == msgInfo[0]) {
        returnMsg = "<?php echo $this->Ini->Nm_lang['lang_errm_file_size'] ?>. <?php echo $this->Ini->Nm_lang['lang_errm_file_size_extension'] ?>".replace("{SC_EXTENSION}", msgInfo[1]).replace("{SC_LIMIT}", msgInfo[2]);
    } else if ("err_extension" == msgInfo[0]) {
        returnMsg = "<?php echo $this->Ini->Nm_lang['lang_errm_file_invl'] ?>";
    }

    return returnMsg;
}

