/* Use jquery to attach ajax calls to Item Status checkboxes in View Items as List */

/* want to use (on)change here, but IE doesn't work; onchange only seems to trigger
when a second event is registered */
$(document).ready(function () {
  $("input.itemStatus").click( function() {
    /* alert("Hello " + $(this).attr("id")); */
    
    $.getJSON("/callback.php", {id: $(this).attr("id"),val: $(this).attr("checked"), ajax: 'true'}, function(j) {
        if (j == "false") {
          alert("Your session has expired. Please refresh the page and login again.");
        }
        else {
          checkId = '#' + j;
          $(checkId).parent().parent().highlightFade({speed:2000});
        }
      }
    );

  });
})