
function scJQGeneralAdd() {
  $('input:text.sc-js-input').listen();
  $('input:password.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 (0 < $oField.length && 0 < $oField[0].offsetHeight && 0 < $oField[0].offsetWidth && !$oField[0].disabled) {
    $oField[0].focus();
  }
} // scFocusField

function scJQEventsAdd(iSeqRow) {
  $('#id_sc_field_p_o_number' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_p_o_number_onblur(this, iSeqRow) })
                                        .bind('focus', function() { sc_dye_fgtemp_form_p_o_number_onfocus(this, iSeqRow) });
  $('#id_sc_field_dye_lot' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_dye_lot_onblur(this, iSeqRow) })
                                     .bind('focus', function() { sc_dye_fgtemp_form_dye_lot_onfocus(this, iSeqRow) });
  $('#id_sc_field_invoice' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_invoice_onblur(this, iSeqRow) })
                                     .bind('focus', function() { sc_dye_fgtemp_form_invoice_onfocus(this, iSeqRow) });
  $('#id_sc_field_location' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_location_onblur(this, iSeqRow) })
                                      .bind('focus', function() { sc_dye_fgtemp_form_location_onfocus(this, iSeqRow) });
  $('#id_sc_field_date' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_date_onblur(this, iSeqRow) })
                                  .bind('focus', function() { sc_dye_fgtemp_form_date_onfocus(this, iSeqRow) });
  $('#id_sc_field_style' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_style_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_style_onfocus(this, iSeqRow) });
  $('#id_sc_field_finish' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_finish_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_dye_fgtemp_form_finish_onfocus(this, iSeqRow) });
  $('#id_sc_field_fin_no' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_fin_no_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_dye_fgtemp_form_fin_no_onfocus(this, iSeqRow) });
  $('#id_sc_field_cost_lb_d' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_cost_lb_d_onblur(this, iSeqRow) })
                                       .bind('focus', function() { sc_dye_fgtemp_form_cost_lb_d_onfocus(this, iSeqRow) });
  $('#id_sc_field_total_cost' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_total_cost_onblur(this, iSeqRow) })
                                        .bind('change', function() { sc_dye_fgtemp_form_total_cost_onchange(this, iSeqRow) })
                                        .bind('focus', function() { sc_dye_fgtemp_form_total_cost_onfocus(this, iSeqRow) });
  $('#id_sc_field_work_loss' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_work_loss_onblur(this, iSeqRow) })
                                       .bind('focus', function() { sc_dye_fgtemp_form_work_loss_onfocus(this, iSeqRow) });
  $('#id_sc_field_gr_yield' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_gr_yield_onblur(this, iSeqRow) })
                                      .bind('focus', function() { sc_dye_fgtemp_form_gr_yield_onfocus(this, iSeqRow) });
  $('#id_sc_field_yards_recd' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_yards_recd_onblur(this, iSeqRow) })
                                        .bind('focus', function() { sc_dye_fgtemp_form_yards_recd_onfocus(this, iSeqRow) });
  $('#id_sc_field_gr_lbs_rec' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_gr_lbs_rec_onblur(this, iSeqRow) })
                                        .bind('change', function() { sc_dye_fgtemp_form_gr_lbs_rec_onchange(this, iSeqRow) })
                                        .bind('focus', function() { sc_dye_fgtemp_form_gr_lbs_rec_onfocus(this, iSeqRow) });
  $('#id_sc_field_fin_lbs' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_fin_lbs_onblur(this, iSeqRow) })
                                     .bind('focus', function() { sc_dye_fgtemp_form_fin_lbs_onfocus(this, iSeqRow) });
  $('#id_sc_field_color' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_color_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_color_onfocus(this, iSeqRow) });
  $('#id_sc_field_color_no' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_color_no_onblur(this, iSeqRow) })
                                      .bind('focus', function() { sc_dye_fgtemp_form_color_no_onfocus(this, iSeqRow) });
  $('#id_sc_field_width' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_width_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_width_onfocus(this, iSeqRow) });
  $('#id_sc_field_cpi' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_cpi_onblur(this, iSeqRow) })
                                 .bind('focus', function() { sc_dye_fgtemp_form_cpi_onfocus(this, iSeqRow) });
  $('#id_sc_field_wpi' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_wpi_onblur(this, iSeqRow) })
                                 .bind('focus', function() { sc_dye_fgtemp_form_wpi_onfocus(this, iSeqRow) });
  $('#id_sc_field_cost' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_cost_onblur(this, iSeqRow) })
                                  .bind('focus', function() { sc_dye_fgtemp_form_cost_onfocus(this, iSeqRow) });
  $('#id_sc_field_trans' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_trans_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_trans_onfocus(this, iSeqRow) });
  $('#id_sc_field_waste' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_waste_onblur(this, iSeqRow) })
                                   .bind('change', function() { sc_dye_fgtemp_form_waste_onchange(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_waste_onfocus(this, iSeqRow) });
  $('#id_sc_field_gyards' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_gyards_onblur(this, iSeqRow) })
                                    .bind('change', function() { sc_dye_fgtemp_form_gyards_onchange(this, iSeqRow) })
                                    .bind('focus', function() { sc_dye_fgtemp_form_gyards_onfocus(this, iSeqRow) });
  $('#id_sc_field_adate' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_adate_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_adate_onfocus(this, iSeqRow) });
  $('#id_sc_field_edate' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_edate_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_edate_onfocus(this, iSeqRow) });
  $('#id_sc_field_sq' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_sq_onblur(this, iSeqRow) })
                                .bind('focus', function() { sc_dye_fgtemp_form_sq_onfocus(this, iSeqRow) });
  $('#id_sc_field_putup' + iSeqRow).bind('blur', function() { sc_dye_fgtemp_form_putup_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_dye_fgtemp_form_putup_onfocus(this, iSeqRow) });
} // scJQEventsAdd

function sc_dye_fgtemp_form_p_o_number_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_p_o_number();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_dye_lot_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_dye_lot();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_invoice_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_invoice();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_location_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_location();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_date_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_date();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_style_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_style();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_finish_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_finish();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_fin_no_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_fin_no();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_cost_lb_d_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_cost_lb_d();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_total_cost_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_total_cost();
  scCssBlur(oThis);
}

function sc_dye_fgtemp_form_total_cost_onchange(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_event_total_cost_onchange();
}

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

function sc_dye_fgtemp_form_work_loss_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_work_loss();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_gr_yield_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_gr_yield();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_yards_recd_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_yards_recd();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_gr_lbs_rec_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_gr_lbs_rec();
  scCssBlur(oThis);
}

function sc_dye_fgtemp_form_gr_lbs_rec_onchange(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_event_gr_lbs_rec_onchange();
}

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

function sc_dye_fgtemp_form_fin_lbs_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_fin_lbs();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_color_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_color();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_color_no_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_color_no();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_width_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_width();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_cpi_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_cpi();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_wpi_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_wpi();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_cost_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_cost();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_trans_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_trans();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_waste_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_waste();
  scCssBlur(oThis);
}

function sc_dye_fgtemp_form_waste_onchange(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_event_waste_onchange();
}

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

function sc_dye_fgtemp_form_gyards_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_gyards();
  scCssBlur(oThis);
}

function sc_dye_fgtemp_form_gyards_onchange(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_event_gyards_onchange();
}

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

function sc_dye_fgtemp_form_adate_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_adate();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_edate_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_edate();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_sq_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_sq();
  scCssBlur(oThis);
}

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

function sc_dye_fgtemp_form_putup_onblur(oThis, iSeqRow) {
  do_ajax_dye_fgtemp_form_validate_putup();
  scCssBlur(oThis);
}

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

var sc_jq_calendar_value = {};

function scJQCalendarAdd(iSeqRow) {
  $("#id_sc_field_date" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_date" + 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']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_mond']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_tued']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_wend']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_thud']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_frid']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_satd']);        ?>'],
    dayNamesMin: ['<?php     echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_sund']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_mond']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_tued']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_wend']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_thud']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_frid']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_satd']); ?>'],
    monthNamesShort: ['<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_janu']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_febr']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_marc']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_apri']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_mayy']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_june']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_july']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_augu']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_sept']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_octo']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_nove']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_dece']); ?>'],
    weekHeader: "<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_days_sem']); ?>",
    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['date']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calendar'); ?>",
    buttonImageOnly: true
  });

  $("#id_sc_field_adate" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_adate" + 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']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_mond']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_tued']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_wend']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_thud']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_frid']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_satd']);        ?>'],
    dayNamesMin: ['<?php     echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_sund']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_mond']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_tued']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_wend']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_thud']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_frid']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_satd']); ?>'],
    monthNamesShort: ['<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_janu']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_febr']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_marc']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_apri']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_mayy']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_june']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_july']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_augu']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_sept']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_octo']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_nove']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_dece']); ?>'],
    weekHeader: "<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_days_sem']); ?>",
    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['adate']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calendar'); ?>",
    buttonImageOnly: true
  });

  $("#id_sc_field_edate" + iSeqRow).datepicker({
    beforeShow: function(input, inst) {
      var $oField = $(this),
          aParts  = $oField.val().split(" "),
          sTime   = "";
      sc_jq_calendar_value["#id_sc_field_edate" + 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']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_mond']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_tued']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_wend']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_thud']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_frid']);        ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_days_satd']);        ?>'],
    dayNamesMin: ['<?php     echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_sund']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_mond']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_tued']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_wend']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_thud']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_frid']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_substr_days_satd']); ?>'],
    monthNamesShort: ['<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_janu']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_febr']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_marc']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_apri']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_mayy']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_june']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_july']);   ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_augu']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_sept']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_octo']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_nove']); ?>','<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_mnth_dece']); ?>'],
    weekHeader: "<?php echo html_entity_decode($this->Ini->Nm_lang['lang_shrt_days_sem']); ?>",
    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['edate']['date_format']) . "", "" . $_SESSION['scriptcase']['reg_conf']['date_sep'] . ""); ?>",
    showOtherMonths: true,
    showOn: "button",
    buttonImage: "<?php echo $this->jqueryIconFile('calendar'); ?>",
    buttonImageOnly: true
  });

} // scJQCalendarAdd

function scJQPopupAdd(iSeqRow) {
  $('.scFormPopupBubble' + iSeqRow).each(function() {
    var distance = 10;
    var time = 250;
    var hideDelay = 500;
    var hideDelayTimer = null;
    var beingShown = false;
    var shown = false;
    var trigger = $('.scFormPopupTrigger', this);
    var info = $('.scFormPopup', this).css('opacity', 0);
    $([trigger.get(0), info.get(0)]).mouseover(function() {
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      if (beingShown || shown) {
        // don't trigger the animation again
        return;
      } else {
        // reset position of info box
        beingShown = true;
        info.css({
          top: trigger.position().top - (info.height() - trigger.height()),
          left: trigger.position().left - ((info.width() - trigger.width()) / 2),
          display: 'block'
        }).animate({
          top: '-=' + distance + 'px',
          opacity: 1
        }, time, 'swing', function() {
          beingShown = false;
          shown = true;
        });
      }
      return false;
      }).mouseout(function() {
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      hideDelayTimer = setTimeout(function() {
        hideDelayTimer = null;
        info.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function() {
          shown = false;
          info.css('display', 'none');
        });
      }, hideDelay);
      return false;
    });
  });
} // scJQPopupAdd

function scJQUploadAdd(iSeqRow) {
} // scJQUploadAdd


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

