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

} // 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 (false == scSetFocusOnField($oField) && 0 < $("#id_ac_" + sField).length) {
    scSetFocusOnField($("#id_ac_" + sField));
  }
} // scFocusField

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

function scEventControl_init(iSeqRow) {
  scEventControl_data["wtrequestdate" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtproducerbranchid" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["producerb_address" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["prbrresponse" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["pphone" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["premail" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtproducerewc" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["ewctitle" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtproducerperiferia" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtproduceracceptweigth" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtproducerqty" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtprducerm3" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtproducersign" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wttransportdate" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wttransporternumberid" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wttransportervechicle" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wttransporterid" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["envregistrationno_transporter" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["transporterresponse" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["transporteremail" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["transporterphone" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["transporterfax" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["checktransvsproducer" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["checktransportervsfdest" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtwasteid" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtequipment" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wttransportersign" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestdate" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestid" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestperiferia" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["envregistrationno_fdest" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["fdestaddress" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["fdestrespone" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["fdestphone" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["fdestresponseemail" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestewc" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["fdewctitle" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestrd" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestqty" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestm3" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtfdestsign" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
  scEventControl_data["wtproducerremarks" + iSeqRow] = {"blur": false, "change": false, "autocomp": false, "original": ""};
}

function scEventControl_active(iSeqRow) {
  if (scEventControl_data["wtrequestdate" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtrequestdate" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtproducerbranchid" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtproducerbranchid" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["producerb_address" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["producerb_address" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["prbrresponse" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["prbrresponse" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["pphone" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["pphone" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["premail" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["premail" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtproducerewc" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtproducerewc" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["ewctitle" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["ewctitle" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtproducerperiferia" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtproducerperiferia" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtproduceracceptweigth" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtproduceracceptweigth" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtproducerqty" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtproducerqty" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtprducerm3" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtprducerm3" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wttransportdate" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wttransportdate" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wttransporternumberid" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wttransporternumberid" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wttransportervechicle" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wttransportervechicle" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wttransporterid" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wttransporterid" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["envregistrationno_transporter" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["envregistrationno_transporter" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["transporterresponse" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["transporterresponse" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["transporteremail" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["transporteremail" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["transporterphone" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["transporterphone" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["transporterfax" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["transporterfax" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["checktransvsproducer" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["checktransvsproducer" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["checktransportervsfdest" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["checktransportervsfdest" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtwasteid" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtwasteid" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtequipment" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtequipment" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtfdestdate" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtfdestdate" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtfdestid" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtfdestid" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtfdestperiferia" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtfdestperiferia" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["envregistrationno_fdest" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["envregistrationno_fdest" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["fdestaddress" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["fdestaddress" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["fdestrespone" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["fdestrespone" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["fdestphone" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["fdestphone" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["fdestresponseemail" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["fdestresponseemail" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtfdestewc" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtfdestewc" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["fdewctitle" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["fdewctitle" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtfdestrd" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtfdestrd" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtfdestqty" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtfdestqty" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtfdestm3" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtfdestm3" + iSeqRow]["change"]) {
    return true;
  }
  if (scEventControl_data["wtproducerremarks" + iSeqRow]["blur"]) {
    return true;
  }
  if (scEventControl_data["wtproducerremarks" + iSeqRow]["change"]) {
    return true;
  }
  return false;
} // scEventControl_active

function scEventControl_onFocus(oField, iSeq) {
  var fieldId, fieldName;
  fieldId = $(oField).attr("id");
  fieldName = fieldId.substr(12);
  if ("wtproducerqty" + iSeq == fieldName) {
    _scCalculatorBlurOk[fieldId] = false;
  }
  if ("wtfdestqty" + iSeq == fieldName) {
    _scCalculatorBlurOk[fieldId] = false;
  }
  scEventControl_data[fieldName]["blur"] = true;
  if ("wtfdestewc" + iSeq == fieldName) {
    scEventControl_data[fieldName]["change"]   = true;
    scEventControl_data[fieldName]["original"] = $(oField).val();
    return;
  }
  if ("wtfdestid" + iSeq == fieldName) {
    scEventControl_data[fieldName]["change"]   = true;
    scEventControl_data[fieldName]["original"] = $(oField).val();
    return;
  }
  if ("wtproducerbranchid" + iSeq == fieldName) {
    scEventControl_data[fieldName]["change"]   = true;
    scEventControl_data[fieldName]["original"] = $(oField).val();
    return;
  }
  if ("wtproducerewc" + iSeq == fieldName) {
    scEventControl_data[fieldName]["change"]   = true;
    scEventControl_data[fieldName]["original"] = $(oField).val();
    return;
  }
  if ("wttransporterid" + iSeq == fieldName) {
    scEventControl_data[fieldName]["change"]   = true;
    scEventControl_data[fieldName]["original"] = $(oField).val();
    return;
  }
  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]["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

function scEventControl_onCalculator_wtproducerqty() {
  if (!_scCalculatorControl["id_sc_field_wtproducerqty"]) {
    _scCalculatorBlurOk["id_sc_field_wtproducerqty"] = true;
    do_ajax_validate_wastetransactions_mob_event_wtproducerqty_onblur();
  }
} // scEventControl_onCalculator_wtproducerqty

function scEventControl_onCalculator_wtfdestqty() {
  if (!_scCalculatorControl["id_sc_field_wtfdestqty"]) {
    _scCalculatorBlurOk["id_sc_field_wtfdestqty"] = true;
    do_ajax_validate_wastetransactions_mob_event_wtfdestqty_onblur();
  }
} // scEventControl_onCalculator_wtfdestqty

var scEventControl_data = {};

function scJQEventsAdd(iSeqRow) {
  $('#id_sc_field_wtrequestdate' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtrequestdate_onblur(this, iSeqRow) })
                                           .bind('focus', function() { sc_validate_wastetransactions_wtrequestdate_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtproducerbranchid' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtproducerbranchid_onblur(this, iSeqRow) })
                                                .bind('change', function() { sc_validate_wastetransactions_wtproducerbranchid_onchange(this, iSeqRow) })
                                                .bind('click', function() { sc_validate_wastetransactions_wtproducerbranchid_onclick(this, iSeqRow) })
                                                .bind('focus', function() { sc_validate_wastetransactions_wtproducerbranchid_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtproducerperiferia' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtproducerperiferia_onblur(this, iSeqRow) })
                                                 .bind('focus', function() { sc_validate_wastetransactions_wtproducerperiferia_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtproduceracceptweigth' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtproduceracceptweigth_onblur(this, iSeqRow) })
                                                    .bind('click', function() { sc_validate_wastetransactions_wtproduceracceptweigth_onclick(this, iSeqRow) })
                                                    .bind('focus', function() { sc_validate_wastetransactions_wtproduceracceptweigth_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtproducerewc' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtproducerewc_onblur(this, iSeqRow) })
                                           .bind('change', function() { sc_validate_wastetransactions_wtproducerewc_onchange(this, iSeqRow) })
                                           .bind('focus', function() { sc_validate_wastetransactions_wtproducerewc_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtproducerqty' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtproducerqty_onblur(this, iSeqRow) })
                                           .bind('focus', function() { sc_validate_wastetransactions_wtproducerqty_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtprducerm3' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtprducerm3_onblur(this, iSeqRow) })
                                         .bind('focus', function() { sc_validate_wastetransactions_wtprducerm3_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtproducerremarks' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtproducerremarks_onblur(this, iSeqRow) })
                                               .bind('focus', function() { sc_validate_wastetransactions_wtproducerremarks_onfocus(this, iSeqRow) });
  $('#id_sc_field_wttransportdate' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wttransportdate_onblur(this, iSeqRow) })
                                             .bind('focus', function() { sc_validate_wastetransactions_wttransportdate_onfocus(this, iSeqRow) });
  $('#id_sc_field_wttransporterid' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wttransporterid_onblur(this, iSeqRow) })
                                             .bind('change', function() { sc_validate_wastetransactions_wttransporterid_onchange(this, iSeqRow) })
                                             .bind('focus', function() { sc_validate_wastetransactions_wttransporterid_onfocus(this, iSeqRow) });
  $('#id_sc_field_wttransportervechicle' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wttransportervechicle_onblur(this, iSeqRow) })
                                                   .bind('focus', function() { sc_validate_wastetransactions_wttransportervechicle_onfocus(this, iSeqRow) });
  $('#id_sc_field_envregistrationno_transporter' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_envregistrationno_transporter_onblur(this, iSeqRow) })
                                                           .bind('focus', function() { sc_validate_wastetransactions_envregistrationno_transporter_onfocus(this, iSeqRow) });
  $('#id_sc_field_wttransporternumberid' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wttransporternumberid_onblur(this, iSeqRow) })
                                                   .bind('focus', function() { sc_validate_wastetransactions_wttransporternumberid_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtwasteid' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtwasteid_onblur(this, iSeqRow) })
                                       .bind('focus', function() { sc_validate_wastetransactions_wtwasteid_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtequipment' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtequipment_onblur(this, iSeqRow) })
                                         .bind('focus', function() { sc_validate_wastetransactions_wtequipment_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestdate' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestdate_onblur(this, iSeqRow) })
                                         .bind('focus', function() { sc_validate_wastetransactions_wtfdestdate_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestid' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestid_onblur(this, iSeqRow) })
                                       .bind('change', function() { sc_validate_wastetransactions_wtfdestid_onchange(this, iSeqRow) })
                                       .bind('click', function() { sc_validate_wastetransactions_wtfdestid_onclick(this, iSeqRow) })
                                       .bind('focus', function() { sc_validate_wastetransactions_wtfdestid_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestperiferia' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestperiferia_onblur(this, iSeqRow) })
                                              .bind('focus', function() { sc_validate_wastetransactions_wtfdestperiferia_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestewc' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestewc_onblur(this, iSeqRow) })
                                        .bind('change', function() { sc_validate_wastetransactions_wtfdestewc_onchange(this, iSeqRow) })
                                        .bind('focus', function() { sc_validate_wastetransactions_wtfdestewc_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestrd' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestrd_onblur(this, iSeqRow) })
                                       .bind('focus', function() { sc_validate_wastetransactions_wtfdestrd_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestqty' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestqty_onblur(this, iSeqRow) })
                                        .bind('focus', function() { sc_validate_wastetransactions_wtfdestqty_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestm3' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestm3_onblur(this, iSeqRow) })
                                       .bind('focus', function() { sc_validate_wastetransactions_wtfdestm3_onfocus(this, iSeqRow) });
  $('#id_sc_field_envregistrationno_fdest' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_envregistrationno_fdest_onblur(this, iSeqRow) })
                                                     .bind('focus', function() { sc_validate_wastetransactions_envregistrationno_fdest_onfocus(this, iSeqRow) });
  $('#id_sc_field_wttransportersign' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wttransportersign_onblur(this, iSeqRow) })
                                               .bind('focus', function() { sc_validate_wastetransactions_wttransportersign_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtproducersign' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtproducersign_onblur(this, iSeqRow) })
                                            .bind('focus', function() { sc_validate_wastetransactions_wtproducersign_onfocus(this, iSeqRow) });
  $('#id_sc_field_wtfdestsign' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_wtfdestsign_onblur(this, iSeqRow) })
                                         .bind('focus', function() { sc_validate_wastetransactions_wtfdestsign_onfocus(this, iSeqRow) });
  $('#id_sc_field_checktransvsproducer' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_checktransvsproducer_onblur(this, iSeqRow) })
                                                  .bind('focus', function() { sc_validate_wastetransactions_checktransvsproducer_onfocus(this, iSeqRow) });
  $('#id_sc_field_checktransportervsfdest' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_checktransportervsfdest_onblur(this, iSeqRow) })
                                                     .bind('focus', function() { sc_validate_wastetransactions_checktransportervsfdest_onfocus(this, iSeqRow) });
  $('#id_sc_field_ewctitle' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_ewctitle_onblur(this, iSeqRow) })
                                      .bind('change', function() { sc_validate_wastetransactions_ewctitle_onchange(this, iSeqRow) })
                                      .bind('focus', function() { sc_validate_wastetransactions_ewctitle_onfocus(this, iSeqRow) });
  $('#id_sc_field_fdewctitle' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_fdewctitle_onblur(this, iSeqRow) })
                                        .bind('focus', function() { sc_validate_wastetransactions_fdewctitle_onfocus(this, iSeqRow) });
  $('#id_sc_field_fdestaddress' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_fdestaddress_onblur(this, iSeqRow) })
                                          .bind('focus', function() { sc_validate_wastetransactions_fdestaddress_onfocus(this, iSeqRow) });
  $('#id_sc_field_fdestphone' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_fdestphone_onblur(this, iSeqRow) })
                                        .bind('focus', function() { sc_validate_wastetransactions_fdestphone_onfocus(this, iSeqRow) });
  $('#id_sc_field_fdestrespone' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_fdestrespone_onblur(this, iSeqRow) })
                                          .bind('focus', function() { sc_validate_wastetransactions_fdestrespone_onfocus(this, iSeqRow) });
  $('#id_sc_field_fdestresponseemail' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_fdestresponseemail_onblur(this, iSeqRow) })
                                                .bind('focus', function() { sc_validate_wastetransactions_fdestresponseemail_onfocus(this, iSeqRow) });
  $('#id_sc_field_pphone' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_pphone_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_validate_wastetransactions_pphone_onfocus(this, iSeqRow) });
  $('#id_sc_field_premail' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_premail_onblur(this, iSeqRow) })
                                     .bind('focus', function() { sc_validate_wastetransactions_premail_onfocus(this, iSeqRow) });
  $('#id_sc_field_prbrresponse' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_prbrresponse_onblur(this, iSeqRow) })
                                          .bind('focus', function() { sc_validate_wastetransactions_prbrresponse_onfocus(this, iSeqRow) });
  $('#id_sc_field_producerb_address' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_producerb_address_onblur(this, iSeqRow) })
                                               .bind('focus', function() { sc_validate_wastetransactions_producerb_address_onfocus(this, iSeqRow) });
  $('#id_sc_field_transporteremail' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_transporteremail_onblur(this, iSeqRow) })
                                              .bind('focus', function() { sc_validate_wastetransactions_transporteremail_onfocus(this, iSeqRow) });
  $('#id_sc_field_transporterfax' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_transporterfax_onblur(this, iSeqRow) })
                                            .bind('focus', function() { sc_validate_wastetransactions_transporterfax_onfocus(this, iSeqRow) });
  $('#id_sc_field_transporterphone' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_transporterphone_onblur(this, iSeqRow) })
                                              .bind('focus', function() { sc_validate_wastetransactions_transporterphone_onfocus(this, iSeqRow) });
  $('#id_sc_field_transporterresponse' + iSeqRow).bind('blur', function() { sc_validate_wastetransactions_transporterresponse_onblur(this, iSeqRow) })
                                                 .bind('focus', function() { sc_validate_wastetransactions_transporterresponse_onfocus(this, iSeqRow) });
} // scJQEventsAdd

function sc_validate_wastetransactions_wtrequestdate_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtrequestdate();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtproducerbranchid_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtproducerbranchid();
  scCssBlur(oThis);
}

function sc_validate_wastetransactions_wtproducerbranchid_onchange(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_refresh_wtproducerbranchid();
  nm_recarga_form('bloco_0', 0);
  do_ajax_validate_wastetransactions_mob_event_wtproducerbranchid_onchange();
}

function sc_validate_wastetransactions_wtproducerbranchid_onclick(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_event_wtproducerbranchid_onclick();
}

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

function sc_validate_wastetransactions_wtproducerperiferia_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtproducerperiferia();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtproduceracceptweigth_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtproduceracceptweigth();
  scCssBlur(oThis);
}

function sc_validate_wastetransactions_wtproduceracceptweigth_onclick(oThis, iSeqRow) {
  nm_recarga_form('bloco_0', 0);
}

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

function sc_validate_wastetransactions_wtproducerewc_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtproducerewc();
  scCssBlur(oThis);
}

function sc_validate_wastetransactions_wtproducerewc_onchange(oThis, iSeqRow) {
  nm_recarga_form('bloco_0', 0);
  do_ajax_validate_wastetransactions_mob_event_wtproducerewc_onchange();
}

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

function sc_validate_wastetransactions_wtproducerqty_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtproducerqty();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtprducerm3_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtprducerm3();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtproducerremarks_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtproducerremarks();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wttransportdate_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wttransportdate();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wttransporterid_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wttransporterid();
  scCssBlur(oThis);
}

function sc_validate_wastetransactions_wttransporterid_onchange(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_event_wttransporterid_onchange();
}

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

function sc_validate_wastetransactions_wttransportervechicle_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wttransportervechicle();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_envregistrationno_transporter_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_envregistrationno_transporter();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wttransporternumberid_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wttransporternumberid();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtwasteid_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtwasteid();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtequipment_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtequipment();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtfdestdate_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtfdestdate();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtfdestid_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtfdestid();
  scCssBlur(oThis);
}

function sc_validate_wastetransactions_wtfdestid_onchange(oThis, iSeqRow) {
  nm_recarga_form('bloco_2', 0);
  do_ajax_validate_wastetransactions_mob_event_wtfdestid_onchange();
}

function sc_validate_wastetransactions_wtfdestid_onclick(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_event_wtfdestid_onclick();
}

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

function sc_validate_wastetransactions_wtfdestperiferia_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtfdestperiferia();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtfdestewc_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtfdestewc();
  scCssBlur(oThis);
}

function sc_validate_wastetransactions_wtfdestewc_onchange(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_event_wtfdestewc_onchange();
}

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

function sc_validate_wastetransactions_wtfdestrd_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtfdestrd();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtfdestqty_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtfdestqty();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_wtfdestm3_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_wtfdestm3();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_envregistrationno_fdest_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_envregistrationno_fdest();
  scCssBlur(oThis);
}

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

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

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

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

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

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

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

function sc_validate_wastetransactions_checktransvsproducer_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_checktransvsproducer();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_checktransportervsfdest_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_checktransportervsfdest();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_ewctitle_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_ewctitle();
  scCssBlur(oThis);
}

function sc_validate_wastetransactions_ewctitle_onchange(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_refresh_ewctitle();
}

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

function sc_validate_wastetransactions_fdewctitle_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_fdewctitle();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_fdestaddress_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_fdestaddress();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_fdestphone_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_fdestphone();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_fdestrespone_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_fdestrespone();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_fdestresponseemail_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_fdestresponseemail();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_pphone_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_pphone();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_premail_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_premail();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_prbrresponse_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_prbrresponse();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_producerb_address_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_producerb_address();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_transporteremail_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_transporteremail();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_transporterfax_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_transporterfax();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_transporterphone_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_transporterphone();
  scCssBlur(oThis);
}

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

function sc_validate_wastetransactions_transporterresponse_onblur(oThis, iSeqRow) {
  do_ajax_validate_wastetransactions_mob_validate_transporterresponse();
  scCssBlur(oThis);
}

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

var sc_jq_calendar_value = {};

function scJQCalendarAdd(iSeqRow) {
  $("#id_sc_field_wtrequestdate" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_wtrequestdate" + iSeqRow] = $oField.val();
    },
    onClose: function(dateText, inst) {
    },
    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']); ?>'],
    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['wtrequestdate']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calendar'); ?>",
    buttonImageOnly: true
  });

  $("#id_sc_field_wttransportdate" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_wttransportdate" + iSeqRow] = $oField.val();
    },
    onClose: function(dateText, inst) {
    },
    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']); ?>'],
    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['wttransportdate']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calendar'); ?>",
    buttonImageOnly: true
  });

  $("#id_sc_field_wtfdestdate" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_wtfdestdate" + iSeqRow] = $oField.val();
    },
    onClose: function(dateText, inst) {
    },
    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']); ?>'],
    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['wtfdestdate']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calendar'); ?>",
    buttonImageOnly: true
  });

} // scJQCalendarAdd

var jqCalcMonetPos = {};
var _scCalculatorBlurOk = {};

function scJQCalculatorAdd(iSeqRow) {
  _scCalculatorBlurOk["id_sc_field_transporterregno" + iSeqRow] = true;
  $("#id_sc_field_wtproducerqty" + iSeqRow).calculator({
    onOpen: function(value, inst) {
      if (typeof _scCalculatorControl !== "undefined") {
        if (!_scCalculatorControl["id_sc_field_wtproducerqty" + iSeqRow]) {
          _scCalculatorControl["id_sc_field_wtproducerqty" + iSeqRow] = true;
        }
      }
      value = scJQCalculatorUnformat(value, "#id_sc_field_wtproducerqty" + iSeqRow, '<?php echo str_replace("'", "\'", $this->field_config['wtproducerqty']['symbol_grp']); ?>', <?php echo $this->field_config['wtproducerqty']['symbol_fmt']; ?>, '<?php echo str_replace("'", "\'", $this->field_config['wtproducerqty']['symbol_dec']); ?>', '');
      $(this).val(value);
    },
    onClose: function(value, inst) {
      var oldValue = $(this.val);
      if (typeof _scCalculatorControl !== "undefined") {
        if (_scCalculatorControl["id_sc_field_wtproducerqty" + iSeqRow]) {
          _scCalculatorControl["id_sc_field_wtproducerqty" + iSeqRow] = null;
        }
      }
      value = scJQCalculatorFormat(value, "#id_sc_field_wtproducerqty" + iSeqRow, '<?php echo str_replace("'", "\'", $this->field_config['wtproducerqty']['symbol_grp']); ?>', <?php echo $this->field_config['wtproducerqty']['symbol_fmt']; ?>, '<?php echo str_replace("'", "\'", $this->field_config['wtproducerqty']['symbol_dec']); ?>', 3, '');
      $(this).val(value);
      if (oldValue != value) {
        $(this).trigger('change');
      }
    },
    precision: 3,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calculator'); ?>",
    buttonImageOnly: true
  });

  $("#id_sc_field_wtfdestqty" + iSeqRow).calculator({
    onOpen: function(value, inst) {
      if (typeof _scCalculatorControl !== "undefined") {
        if (!_scCalculatorControl["id_sc_field_wtfdestqty" + iSeqRow]) {
          _scCalculatorControl["id_sc_field_wtfdestqty" + iSeqRow] = true;
        }
      }
      value = scJQCalculatorUnformat(value, "#id_sc_field_wtfdestqty" + iSeqRow, '<?php echo str_replace("'", "\'", $this->field_config['wtfdestqty']['symbol_grp']); ?>', <?php echo $this->field_config['wtfdestqty']['symbol_fmt']; ?>, '<?php echo str_replace("'", "\'", $this->field_config['wtfdestqty']['symbol_dec']); ?>', '');
      $(this).val(value);
    },
    onClose: function(value, inst) {
      var oldValue = $(this.val);
      if (typeof _scCalculatorControl !== "undefined") {
        if (_scCalculatorControl["id_sc_field_wtfdestqty" + iSeqRow]) {
          _scCalculatorControl["id_sc_field_wtfdestqty" + iSeqRow] = null;
        }
      }
      value = scJQCalculatorFormat(value, "#id_sc_field_wtfdestqty" + iSeqRow, '<?php echo str_replace("'", "\'", $this->field_config['wtfdestqty']['symbol_grp']); ?>', <?php echo $this->field_config['wtfdestqty']['symbol_fmt']; ?>, '<?php echo str_replace("'", "\'", $this->field_config['wtfdestqty']['symbol_dec']); ?>', 3, '');
      $(this).val(value);
      if (oldValue != value) {
        $(this).trigger('change');
      }
    },
    precision: 3,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calculator'); ?>",
    buttonImageOnly: true
  });

} // scJQCalculatorAdd

function scJQCalculatorUnformat(fValue, sField, sThousands, sFormat, sDecimals, sMonetary) {
  fValue = scJQCalculatorCurrency(fValue, sField, sMonetary);
  if ("" != sThousands) {
    if ("." == sThousands) {
      sThousands = "\\.";
    }
    sRegEx = eval("/" + sThousands + "/g");
    fValue = fValue.replace(sRegEx, "");
  }
  if ("." != sDecimals) {
    sRegEx = eval("/" + sDecimals + "/g");
    fValue = fValue.replace(sRegEx, ".");
  }
  if ("." == fValue.substr(0, 1) || "," == fValue.substr(0, 1)) {
    fValue = "0" + fValue;
  }
  return fValue;
} // scJQCalculatorUnformat

function scJQCalculatorFormat(fValue, sField, sThousands, sFormat, sDecimals, iPrecision, sMonetary) {
  fValue = scJQCalculatorCurrency(fValue.toString(), sField, sMonetary);
  if (-1 < fValue.indexOf('.')) {
    var parts = fValue.split('.'),
        pref = parts[0],
        suf = parts[1];
  }
  else {
    var pref = fValue,
        suf = '';
  }
  if ('' != sThousands) {
    if (3 == sFormat) {
      if (4 <= pref.length) {
        pref_rest = pref.substr(0, pref.length - 3);
        pref = sThousands + pref.substr(pref.length - 3);
        while (2 < pref_rest.length) {
          pref = sThousands + pref_rest.substr(pref_rest.length - 2) + pref;
          pref_rest = pref_rest.substr(0, pref_rest.length - 2);
        }
        if ('' != pref_rest) {
          pref = pref_rest + pref;
        }
      }
    }
    else if (2 == sFormat) {
      if (4 <= pref.length) {
        pref = pref.substr(0, pref.length - 3) + sThousands + pref.substr(pref.length - 3);
      }
    }
    else {
      pref_rest = pref;
      pref = '';
      while (3 < pref_rest.length) {
        pref = sThousands + pref_rest.substr(pref_rest.length - 3) + pref;
        pref_rest = pref_rest.substr(0, pref_rest.length - 3);
      }
      if ('' != pref_rest) {
        pref = pref_rest + pref;
      }
    }
  }
  if ('' != iPrecision) {
    if (suf.length > iPrecision) {
      suf = '1' + suf.substr(0, iPrecision) + '.' + suf.substr(iPrecision);
      suf = Math.round(parseFloat(suf)).toString().substr(1);
    }
    else {
      while (suf.length < iPrecision) {
        suf += '0';
      }
    }
  }
  if ('' != sDecimals && '' != suf) {
    fValue = pref + sDecimals + suf;
  }
  else {
    fValue = pref;
  }
  if ('' != sMonetary) {
    fValue = 'left' == jqCalcMonetPos[sField] ? sMonetary + ' ' + fValue : fValue + ' ' + sMonetary;
  }
  return fValue;
} // scJQCalculatorFormat

function scJQCalculatorCurrency(fValue, sField, sMonetary) {
  if ("" != sMonetary) {
    if (sMonetary + ' ' == fValue.substr(0, sMonetary.length + 1)) {
        fValue = fValue.substr(sMonetary.length + 1);
        jqCalcMonetPos[sField] = 'left';
    }
    else if (sMonetary == fValue.substr(0, sMonetary.length)) {
        fValue = fValue.substr(sMonetary.length + 1);
        jqCalcMonetPos[sField] = 'left';
    }
    else if (' ' + sMonetary == fValue.substr(fValue.length - sMonetary.length - 1)) {
        fValue = fValue.substr(0, fValue.length - sMonetary.length - 1);
        jqCalcMonetPos[sField] = 'right';
    }
    else if (sMonetary == fValue.substr(fValue.length - sMonetary.length)) {
        fValue = fValue.substr(0, fValue.length - sMonetary.length);
        jqCalcMonetPos[sField] = 'right';
    }
  }
  if ("" == fValue) {
    fValue = "0";
  }
  return fValue;
} // scJQCalculatorCurrency

function scJQUploadAdd(iSeqRow) {
  $("#id_sc_field_wtproducersign" + iSeqRow).fileupload({
    datatype: "json",
    url: "validate_wastetransactions_mob_ul_save.php",
    dropZone: "",
    formData: function() {
      return [
        {name: 'app_dir', value: '<?php echo $this->Ini->path_aplicacao; ?>'},
        {name: 'app_name', value: 'validate_wastetransactions_mob'},
        {name: 'upload_dir', value: '<?php echo $this->Ini->root . $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_url', value: '<?php echo $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_url', value: '<?php echo $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_type', value: 'single'},
        {name: 'param_name', value: 'wtproducersign' + iSeqRow},
        {name: 'upload_file_height', value: '90'},
        {name: 'upload_file_width', value: '90'},
        {name: 'upload_file_aspect', value: 'N'},
        {name: 'upload_file_type', value: 'I'},
        {name: 'upload_file_row', value: iSeqRow}
      ];
    },
    progress: function(e, data) {
      var loader, progress;
      if (data.lengthComputable && window.FormData !== undefined) {
        loader = $("#id_img_loader_wtproducersign" + iSeqRow);
        progress = parseInt(data.loaded / data.total * 100, 10);
        loader.show().find("div").css("width", progress + "%");
      }
      else {
        loader = $("#id_ajax_loader_wtproducersign" + iSeqRow);
        loader.show();
      }
    },
    done: function(e, data) {
      var fileData, thumbDisplay, checkDisplay, var_ajax_img_thumb;
      if (data.result[0].body) {
        fileData = $.parseJSON(data.result[0].body.innerText);
      }
      else {
        fileData = eval(data.result);
      }
      $("#id_sc_field_wtproducersign" + iSeqRow).val("");
      $("#id_sc_field_wtproducersign_ul_name" + iSeqRow).val(fileData[0].sc_random_prot);
      $("#id_sc_field_wtproducersign_ul_type" + iSeqRow).val(fileData[0].type);
      var_ajax_img_wtproducersign = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_random_prot;
      var_ajax_img_thumb = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_thumb_prot;
      thumbDisplay = ("" == var_ajax_img_wtproducersign) ? "none" : "";
      $("#id_ajax_img_wtproducersign" + iSeqRow).attr("src", var_ajax_img_thumb);
      $("#id_ajax_img_wtproducersign" + iSeqRow).css("display", thumbDisplay);
      if (document.F1.temp_out1_wtproducersign) {
        document.F1.temp_out_wtproducersign.value = var_ajax_img_thumb;
        document.F1.temp_out1_wtproducersign.value = var_ajax_img_wtproducersign;
      }
      else if (document.F1.temp_out_wtproducersign) {
        document.F1.temp_out_wtproducersign.value = var_ajax_img_wtproducersign;
      }
      checkDisplay = ("" == fileData[0].sc_random_prot.substr(12)) ? "none" : "";
      $("#chk_ajax_img_wtproducersign" + iSeqRow).css("display", checkDisplay);
      $("#txt_ajax_img_wtproducersign" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
      $("#txt_ajax_img_wtproducersign" + iSeqRow).css("display", checkDisplay);
      $("#id_ajax_link_wtproducersign" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
      if (window.FormData !== undefined)
      {
        $("#id_img_loader_wtproducersign" + iSeqRow).hide();
      }
      else
      {
        $("#id_ajax_loader_wtproducersign" + iSeqRow).hide();
      }
    }
  });

  $("#id_sc_field_wttransportersign" + iSeqRow).fileupload({
    datatype: "json",
    url: "validate_wastetransactions_mob_ul_save.php",
    dropZone: "",
    formData: function() {
      return [
        {name: 'app_dir', value: '<?php echo $this->Ini->path_aplicacao; ?>'},
        {name: 'app_name', value: 'validate_wastetransactions_mob'},
        {name: 'upload_dir', value: '<?php echo $this->Ini->root . $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_url', value: '<?php echo $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_url', value: '<?php echo $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_type', value: 'single'},
        {name: 'param_name', value: 'wttransportersign' + iSeqRow},
        {name: 'upload_file_height', value: '90'},
        {name: 'upload_file_width', value: '90'},
        {name: 'upload_file_aspect', value: 'N'},
        {name: 'upload_file_type', value: 'I'},
        {name: 'upload_file_row', value: iSeqRow}
      ];
    },
    progress: function(e, data) {
      var loader, progress;
      if (data.lengthComputable && window.FormData !== undefined) {
        loader = $("#id_img_loader_wttransportersign" + iSeqRow);
        progress = parseInt(data.loaded / data.total * 100, 10);
        loader.show().find("div").css("width", progress + "%");
      }
      else {
        loader = $("#id_ajax_loader_wttransportersign" + iSeqRow);
        loader.show();
      }
    },
    done: function(e, data) {
      var fileData, thumbDisplay, checkDisplay, var_ajax_img_thumb;
      if (data.result[0].body) {
        fileData = $.parseJSON(data.result[0].body.innerText);
      }
      else {
        fileData = eval(data.result);
      }
      $("#id_sc_field_wttransportersign" + iSeqRow).val("");
      $("#id_sc_field_wttransportersign_ul_name" + iSeqRow).val(fileData[0].sc_random_prot);
      $("#id_sc_field_wttransportersign_ul_type" + iSeqRow).val(fileData[0].type);
      var_ajax_img_wttransportersign = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_random_prot;
      var_ajax_img_thumb = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_thumb_prot;
      thumbDisplay = ("" == var_ajax_img_wttransportersign) ? "none" : "";
      $("#id_ajax_img_wttransportersign" + iSeqRow).attr("src", var_ajax_img_thumb);
      $("#id_ajax_img_wttransportersign" + iSeqRow).css("display", thumbDisplay);
      if (document.F1.temp_out1_wttransportersign) {
        document.F1.temp_out_wttransportersign.value = var_ajax_img_thumb;
        document.F1.temp_out1_wttransportersign.value = var_ajax_img_wttransportersign;
      }
      else if (document.F1.temp_out_wttransportersign) {
        document.F1.temp_out_wttransportersign.value = var_ajax_img_wttransportersign;
      }
      checkDisplay = ("" == fileData[0].sc_random_prot.substr(12)) ? "none" : "";
      $("#chk_ajax_img_wttransportersign" + iSeqRow).css("display", checkDisplay);
      $("#txt_ajax_img_wttransportersign" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
      $("#txt_ajax_img_wttransportersign" + iSeqRow).css("display", checkDisplay);
      $("#id_ajax_link_wttransportersign" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
      if (window.FormData !== undefined)
      {
        $("#id_img_loader_wttransportersign" + iSeqRow).hide();
      }
      else
      {
        $("#id_ajax_loader_wttransportersign" + iSeqRow).hide();
      }
    }
  });

  $("#id_sc_field_wtfdestsign" + iSeqRow).fileupload({
    datatype: "json",
    url: "validate_wastetransactions_mob_ul_save.php",
    dropZone: "",
    formData: function() {
      return [
        {name: 'app_dir', value: '<?php echo $this->Ini->path_aplicacao; ?>'},
        {name: 'app_name', value: 'validate_wastetransactions_mob'},
        {name: 'upload_dir', value: '<?php echo $this->Ini->root . $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_url', value: '<?php echo $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_url', value: '<?php echo $this->Ini->path_imag_temp; ?>/'},
        {name: 'upload_type', value: 'single'},
        {name: 'param_name', value: 'wtfdestsign' + iSeqRow},
        {name: 'upload_file_height', value: '90'},
        {name: 'upload_file_width', value: '90'},
        {name: 'upload_file_aspect', value: 'N'},
        {name: 'upload_file_type', value: 'I'},
        {name: 'upload_file_row', value: iSeqRow}
      ];
    },
    progress: function(e, data) {
      var loader, progress;
      if (data.lengthComputable && window.FormData !== undefined) {
        loader = $("#id_img_loader_wtfdestsign" + iSeqRow);
        progress = parseInt(data.loaded / data.total * 100, 10);
        loader.show().find("div").css("width", progress + "%");
      }
      else {
        loader = $("#id_ajax_loader_wtfdestsign" + iSeqRow);
        loader.show();
      }
    },
    done: function(e, data) {
      var fileData, thumbDisplay, checkDisplay, var_ajax_img_thumb;
      if (data.result[0].body) {
        fileData = $.parseJSON(data.result[0].body.innerText);
      }
      else {
        fileData = eval(data.result);
      }
      $("#id_sc_field_wtfdestsign" + iSeqRow).val("");
      $("#id_sc_field_wtfdestsign_ul_name" + iSeqRow).val(fileData[0].sc_random_prot);
      $("#id_sc_field_wtfdestsign_ul_type" + iSeqRow).val(fileData[0].type);
      var_ajax_img_wtfdestsign = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_random_prot;
      var_ajax_img_thumb = '<?php echo $this->Ini->path_imag_temp; ?>/' + fileData[0].sc_thumb_prot;
      thumbDisplay = ("" == var_ajax_img_wtfdestsign) ? "none" : "";
      $("#id_ajax_img_wtfdestsign" + iSeqRow).attr("src", var_ajax_img_thumb);
      $("#id_ajax_img_wtfdestsign" + iSeqRow).css("display", thumbDisplay);
      if (document.F1.temp_out1_wtfdestsign) {
        document.F1.temp_out_wtfdestsign.value = var_ajax_img_thumb;
        document.F1.temp_out1_wtfdestsign.value = var_ajax_img_wtfdestsign;
      }
      else if (document.F1.temp_out_wtfdestsign) {
        document.F1.temp_out_wtfdestsign.value = var_ajax_img_wtfdestsign;
      }
      checkDisplay = ("" == fileData[0].sc_random_prot.substr(12)) ? "none" : "";
      $("#chk_ajax_img_wtfdestsign" + iSeqRow).css("display", checkDisplay);
      $("#txt_ajax_img_wtfdestsign" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
      $("#txt_ajax_img_wtfdestsign" + iSeqRow).css("display", checkDisplay);
      $("#id_ajax_link_wtfdestsign" + iSeqRow).html(fileData[0].sc_random_prot.substr(12));
      if (window.FormData !== undefined)
      {
        $("#id_img_loader_wtfdestsign" + iSeqRow).hide();
      }
      else
      {
        $("#id_ajax_loader_wtfdestsign" + iSeqRow).hide();
      }
    }
  });

} // scJQUploadAdd


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

var scBtnGrpStatus = {};
function scBtnGrpShow(sGroup) {
  var btnPos = $('#sc_btgp_btn_' + sGroup).offset();
  scBtnGrpStatus[sGroup] = 'open';
  $('#sc_btgp_btn_' + sGroup).mouseout(function() {
    setTimeout(function() {
      scBtnGrpHide(sGroup);
    }, 1000);
  });
  $('#sc_btgp_div_' + sGroup + ' span a').click(function() {
    scBtnGrpStatus[sGroup] = 'out';
    scBtnGrpHide(sGroup);
  });
  $('#sc_btgp_div_' + sGroup).css({
    'left': btnPos.left
  })
  .mouseover(function() {
    scBtnGrpStatus[sGroup] = 'over';
  })
  .mouseleave(function() {
    scBtnGrpStatus[sGroup] = 'out';
    setTimeout(function() {
      scBtnGrpHide(sGroup);
    }, 1000);
  })
  .show('fast');
}
function scBtnGrpHide(sGroup) {
  if ('over' != scBtnGrpStatus[sGroup]) {
    $('#sc_btgp_div_' + sGroup).hide('fast');
  }
}
