
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_sm' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_sm_onblur(this, iSeqRow) })
                                .bind('focus', function() { sc_shippinig_doit_form_sm_onfocus(this, iSeqRow) });
  $('#id_sc_field_factor' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_factor_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_factor_onfocus(this, iSeqRow) });
  $('#id_sc_field_terms' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_terms_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_shippinig_doit_form_terms_onfocus(this, iSeqRow) });
  $('#id_sc_field_terms2' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_terms2_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_terms2_onfocus(this, iSeqRow) });
  $('#id_sc_field_salesman' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_salesman_onblur(this, iSeqRow) })
                                      .bind('focus', function() { sc_shippinig_doit_form_salesman_onfocus(this, iSeqRow) });
  $('#id_sc_field_our_order' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_our_order_onblur(this, iSeqRow) })
                                       .bind('focus', function() { sc_shippinig_doit_form_our_order_onfocus(this, iSeqRow) });
  $('#id_sc_field_invoice' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_invoice_onblur(this, iSeqRow) })
                                     .bind('focus', function() { sc_shippinig_doit_form_invoice_onfocus(this, iSeqRow) });
  $('#id_sc_field_bl' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_bl_onblur(this, iSeqRow) })
                                .bind('focus', function() { sc_shippinig_doit_form_bl_onfocus(this, iSeqRow) });
  $('#id_sc_field_sdate' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_sdate_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_shippinig_doit_form_sdate_onfocus(this, iSeqRow) });
  $('#id_sc_field_p_o_number' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_p_o_number_onblur(this, iSeqRow) })
                                        .bind('focus', function() { sc_shippinig_doit_form_p_o_number_onfocus(this, iSeqRow) });
  $('#id_sc_field_lyards' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_lyards_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_lyards_onfocus(this, iSeqRow) });
  $('#id_sc_field_syards' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_syards_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_syards_onfocus(this, iSeqRow) });
  $('#id_sc_field_style' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_style_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_shippinig_doit_form_style_onfocus(this, iSeqRow) });
  $('#id_sc_field_color' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_color_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_shippinig_doit_form_color_onfocus(this, iSeqRow) });
  $('#id_sc_field_color_no' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_color_no_onblur(this, iSeqRow) })
                                      .bind('focus', function() { sc_shippinig_doit_form_color_no_onfocus(this, iSeqRow) });
  $('#id_sc_field_width' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_width_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_shippinig_doit_form_width_onfocus(this, iSeqRow) });
  $('#id_sc_field_dye_lot' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_dye_lot_onblur(this, iSeqRow) })
                                     .bind('focus', function() { sc_shippinig_doit_form_dye_lot_onfocus(this, iSeqRow) });
  $('#id_sc_field_price' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_price_onblur(this, iSeqRow) })
                                   .bind('focus', function() { sc_shippinig_doit_form_price_onfocus(this, iSeqRow) });
  $('#id_sc_field_unit' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_unit_onblur(this, iSeqRow) })
                                  .bind('focus', function() { sc_shippinig_doit_form_unit_onfocus(this, iSeqRow) });
  $('#id_sc_field_custno' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_custno_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_custno_onfocus(this, iSeqRow) });
  $('#id_sc_field_it' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_it_onblur(this, iSeqRow) })
                                .bind('focus', function() { sc_shippinig_doit_form_it_onfocus(this, iSeqRow) });
  $('#id_sc_field_smit' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_smit_onblur(this, iSeqRow) })
                                  .bind('focus', function() { sc_shippinig_doit_form_smit_onfocus(this, iSeqRow) });
  $('#id_sc_field_desc' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_desc_onblur(this, iSeqRow) })
                                  .bind('focus', function() { sc_shippinig_doit_form_desc_onfocus(this, iSeqRow) });
  $('#id_sc_field_approx' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_approx_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_approx_onfocus(this, iSeqRow) });
  $('#id_sc_field_status' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_status_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_status_onfocus(this, iSeqRow) });
  $('#id_sc_field_bilsep' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_bilsep_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_bilsep_onfocus(this, iSeqRow) });
  $('#id_sc_field_dday' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_dday_onblur(this, iSeqRow) })
                                  .bind('focus', function() { sc_shippinig_doit_form_dday_onfocus(this, iSeqRow) });
  $('#id_sc_field_pcount' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_pcount_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_pcount_onfocus(this, iSeqRow) });
  $('#id_sc_field_n3case' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_n3case_onblur(this, iSeqRow) })
                                    .bind('focus', function() { sc_shippinig_doit_form_n3case_onfocus(this, iSeqRow) });
  $('#id_sc_field_n3casesavail' + iSeqRow).bind('blur', function() { sc_shippinig_doit_form_n3casesavail_onblur(this, iSeqRow) })
                                          .bind('focus', function() { sc_shippinig_doit_form_n3casesavail_onfocus(this, iSeqRow) });
} // scJQEventsAdd

function sc_shippinig_doit_form_sm_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_sm();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_factor_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_factor();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_terms_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_terms();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_terms2_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_terms2();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_salesman_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_salesman();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_our_order_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_our_order();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_invoice_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_invoice();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_bl_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_bl();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_sdate_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_sdate();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_p_o_number_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_p_o_number();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_lyards_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_lyards();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_syards_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_syards();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_style_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_style();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_color_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_color();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_color_no_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_color_no();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_width_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_width();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_dye_lot_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_dye_lot();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_price_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_price();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_unit_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_unit();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_custno_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_custno();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_it_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_it();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_smit_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_smit();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_desc_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_desc();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_approx_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_approx();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_status_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_status();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_bilsep_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_bilsep();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_dday_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_dday();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_pcount_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_pcount();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_n3case_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_n3case();
  scCssBlur(oThis);
}

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

function sc_shippinig_doit_form_n3casesavail_onblur(oThis, iSeqRow) {
  do_ajax_shippinig_doit_form_validate_n3casesavail();
  scCssBlur(oThis);
}

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

var sc_jq_calendar_value = {};

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

} // scJQCalendarAdd

function scJQUploadAdd(iSeqRow) {
} // scJQUploadAdd


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

