<!-- JavaScript for select all -->
<script type="text/javascript">
$(document).ready(function() {
        
  $("#jak_delete_all").click(function() {
    var checked_status = this.checked;
    $(".highlight").each(function()
    {
      this.checked = checked_status;
    });
  });

  var fixHelperModified = function(e, tr) {
    var $originals = tr.children();
    var $helper = tr.clone();
    $helper.children().each(function(index) {
      $(this).width($originals.eq(index).width())
    });
    return $helper;
  },
  updateIndex = function(e, ui) {
    $('.corder', ui.item.parent()).each(function (i) {
      $(this).val(i + 1);
    });
  };

  $("#sortTable tbody").sortable({
    helper: fixHelperModified,
    stop: updateIndex
  }).disableSelection();
  
  $("tbody").sortable({
    distance: 5,
    delay: 100,
    opacity: 0.6,
    cursor: 'move',
    update: function() {}
  });
          
});

ls.main_url = "<?php echo BASE_URL_ADMIN;?>";
ls.orig_main_url = "<?php echo BASE_URL_ORIG;?>";
ls.main_lang = "<?php echo JAK_LANG;?>";
</script>
