anchor.diff:          $("#search_sequences_dialog").html(content);
           $("#search_sequences_dialog").dialog("open");
       }
  -};
  +}
  +;
   
   function update_checked(checked) {
       $("#checkbox_option").prop("checked", checked);
       table.$(".track_select").prop("checked", checked);
  -};
  +}
  +;
   
   function login() {
       var $login = $("#login_dialog");
  
positive.code: <script src="jslib/jquery-ui-menubar/jquery.ui.menu.js" type="text/javascript"></script>
  <script src="jslib/jquery-ui-menubar/jquery.ui.menubar.js" type="text/javascript"></script>
  <script src="jslib/jquery-ui-menubar/jquery.ui.dialog.js" type="text/javascript"></script>
  <script type="text/javascript" src="<%=new URL(request.getRequestURL().toString()).getProtocol()%>://www.google.com/jsapi"></script>
  
  <script type="text/javascript" src="jslib/DataTables/js/jquery.dataTables.js"></script>
  <script type="text/javascript" src="jslib/DataTables-plugins/dataTablesPlugins.js"></script>
  
negative.code:         write_data($(this).text(), tracks, $(this).attr("_options"));
      });
  
      $("#select_tracks").click(function () {
          window.location = "selectTrack.jsp";
      });
  
      $("#search_sequence_item").click(function () {
          open_search_dialog();
      });
      $("#user_manager_item").click(function () {
          open_user_manager_dialog();
      });
      $("#delete_selected_item").click(function () {
          delete_selected_items();
      });
  
      <%
  for(String status : allStatusList){
  %>
      $("#change_status_selected_item-<%=status.replaceAll(" ","_")%>").click(function () {
          change_status_selected_items('<%=status%>');
      });
  
      <%
      }
      %>
  
      cleanup_user_item();
  });
  
  // TODO: this may need to be split up into multiple submissions if across chromosomes.
  function change_status_selected_items(updated_status) {
      var trackName = "";
      var tracks = new Array();
      table.$(".track_select").each(function () {
          if ($(this).prop("checked")) {
              var wholeId = $(this).attr("id");
              trackName = wholeId.split("<=>")[0];
              var featureId = wholeId.split("<=>")[1];
              tracks.push(featureId);
          }
      });
      var trackString = "\"features\": [";
      for (var i = 0; i < tracks.length; i++) {
          if (i > 0) {
              trackString += ',';
          }
          trackString += "{ \"uniquename\": \"" + tracks[i] + "\",\"status\":\"" + updated_status + "\" }";
      }
      trackString += ']';
  
  //    var doDelete = confirm("Are you sure you want to update "+tracks.length+" annotations?");
  //    if(doDelete){
      var postData = '{ "track": "' + trackName + '", ' + trackString + ', "operation": "set_status" }';
      $.ajax({
          type: "post",
          data: postData,
          url: "AnnotationEditorService",
          success: function (data, textStatus, jqXHR) {
              console.log('success');
              window.location = "recentChanges.jsp";
  
          },
          error: function (qXHR, textStatus, errorThrown) {
              console.log('error');
              alert('Error updating status: ' + errorThrown);
              ok = false;
          }
      });
  //    }
  }
  ;
  
  // TODO: this may need to be split up into multiple submissions if across chromosomes.
  function delete_selected_items() {
      var trackName = "";
      var tracks = new Array();
      table.$(".track_select").each(function () {
          if ($(this).prop("checked")) {
              var wholeId = $(this).attr("id");
              trackName = wholeId.split("<=>")[0];
              var featureId = wholeId.split("<=>")[1];
              tracks.push(featureId);
          }
      });
      var trackString = "\"features\": [";
      for (var i = 0; i < tracks.length; i++) {
          if (i > 0) {
              trackString += ',';
          }
          trackString += "{ \"uniquename\": \"" + tracks[i] + "\" }"
      }
      trackString += ']';
  
      var doDelete = confirm("Are you sure you want to delete " + tracks.length + " annotations?");
      if (doDelete) {
          var postData = '{ "track": "' + trackName + '", ' + trackString + ', "operation": "delete_feature" }';
  
          $.ajax({
              type: "post",
              data: postData,
              url: "AnnotationEditorService",
              success: function (data, textStatus, jqXHR) {
                  console.log('success');
  //                    alert('Deleted '+tracks.size() + ' successfully.');
                  window.location = "recentChanges.jsp";
  
              },
              error: function (qXHR, textStatus, errorThrown) {
                  console.log('error');
                  alert('Error deleting: ' + errorThrown);
                  ok = false;
              }
          });
      }
  }
  ;
  
  function cleanup_logo() {
      $("#logo").parent().css("padding", "0 0 0 0");
  }
  ;
  
  function cleanup_user_item() {
      $("#user_item").parent().attr("id", "user_item_menu");
  }
  ;
  
  function createListener() {
      $.ajax({
          url: "AnnotationChangeNotificationService?track=<%=username + "_" + session.getId()%>",
          success: function () {
              createListener();
          },
          error: function (jqXHR, textStatus, errorThrown) {
              var status = jqXHR.status;
              switch (status) {
                  case 0:
                      if (textStatus == "timeout") {
                          createListener();
                      }
                      break;
                  case 403:
                      alert("Logged out");
                      location.reload();
                      break;
                  case 502:
                      createListener();
                      break;
                  case 504:
                      createListener();
                      break;
                  default:
                      alert("Server connection error");
                      location.reload();
                      break;
              }
          },
          timeout: 5 * 60 * 1000
      });
  }
  ;
  
  function write_data(adapter, tracks, options, successMessage) {
      $("#data_adapter_dialog").dialog("option", "closeOnEscape", false);
      $(".ui-dialog-titlebar-close", this.parentNode).hide();
  
      var enableClose = function () {
          $("#data_adapter_dialog").dialog("option", "closeOnEscape", true);
          $(".ui-dialog-titlebar-close", this.parentNode).show();
      };
  