Index: /trunk/admin/themes/default/js/LocalStorageCache.js
===================================================================
--- /trunk/admin/themes/default/js/LocalStorageCache.js	(revision 28539)
+++ /trunk/admin/themes/default/js/LocalStorageCache.js	(revision 28540)
@@ -1,4 +1,4 @@
 var LocalStorageCache = function(options) {
-  this.key = options.key + '-' + options.serverId;
+  this.key = options.key + '_' + options.serverId;
   this.serverKey = options.serverKey;
   this.lifetime = options.lifetime ? options.lifetime*1000 : 3600*1000;
Index: /trunk/admin/themes/default/js/addAlbum.js
===================================================================
--- /trunk/admin/themes/default/js/addAlbum.js	(revision 28539)
+++ /trunk/admin/themes/default/js/addAlbum.js	(revision 28540)
@@ -9,5 +9,5 @@
       valueField: 'id',
       labelField: 'fullname',
-      sortField: 'fullname',
+      sortField: 'global_rank',
       searchField: ['fullname'],
       plugins: ['remove_button'],
@@ -108,5 +108,6 @@
         categories.push({
           id: 0,
-          fullname: '------------'
+          fullname: '------------',
+          global_rank: 0
         });
         
Index: /trunk/admin/themes/default/template/batch_manager_global.tpl
===================================================================
--- /trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 28539)
+++ /trunk/admin/themes/default/template/batch_manager_global.tpl	(revision 28540)
@@ -135,5 +135,5 @@
     valueField: 'id',
     labelField: 'fullname',
-    sortField: 'fullname',
+    sortField: 'global_rank',
     searchField: ['fullname'],
     plugins: ['remove_button']
@@ -141,8 +141,4 @@
   
   categoriesCache.get(function(categories) {
-    categories.sort(function(a, b) {
-      return a.fullname.localeCompare(b.fullname);
-    });
-    
     jQuery('[data-selectize=categories]').each(function() {
       this.selectize.load(function(callback) {
Index: /trunk/admin/themes/default/template/cat_modify.tpl
===================================================================
--- /trunk/admin/themes/default/template/cat_modify.tpl	(revision 28539)
+++ /trunk/admin/themes/default/template/cat_modify.tpl	(revision 28540)
@@ -21,5 +21,5 @@
   valueField: 'id',
   labelField: 'fullname',
-  sortField: 'fullname',
+  sortField: 'global_rank',
   searchField: ['fullname'],
   plugins: ['remove_button']
@@ -29,5 +29,6 @@
   categories.push({
     id: 0,
-    fullname: '------------'
+    fullname: '------------',
+    global_rank: 0
   });
   
@@ -35,8 +36,4 @@
   categories = jQuery.grep(categories, function(cat) {
     return !(/\b{$CAT_ID}\b/.test(cat.uppercats));
-  });
-  
-  categories.sort(function(a, b) {
-    return a.fullname.localeCompare(b.fullname);
   });
   
@@ -52,9 +49,9 @@
     // prevent empty value
     if (this.selectize.getValue() == '') {
-      this.selectize.setValue(categories[0].id);
+      this.selectize.setValue(0);
     }
     this.selectize.on('dropdown_close', function() {
       if (this.getValue() == '') {
-        this.setValue(categories[0].id);
+        this.setValue(0);
       }
     });
Index: /trunk/admin/themes/default/template/photos_add_direct.tpl
===================================================================
--- /trunk/admin/themes/default/template/photos_add_direct.tpl	(revision 28539)
+++ /trunk/admin/themes/default/template/photos_add_direct.tpl	(revision 28540)
@@ -32,5 +32,5 @@
   valueField: 'id',
   labelField: 'fullname',
-  sortField: 'fullname',
+  sortField: 'global_rank',
   searchField: ['fullname'],
   plugins: ['remove_button']
@@ -41,8 +41,4 @@
     jQuery("#albumSelection").show();
   }
-
-  categories.sort(function(a, b) {
-    return a.fullname.localeCompare(b.fullname);
-  });
   
   jQuery('[data-selectize=categories]').each(function() {
Index: /trunk/admin/themes/default/template/picture_modify.tpl
===================================================================
--- /trunk/admin/themes/default/template/picture_modify.tpl	(revision 28539)
+++ /trunk/admin/themes/default/template/picture_modify.tpl	(revision 28540)
@@ -26,5 +26,5 @@
   valueField: 'id',
   labelField: 'fullname',
-  sortField: 'fullname',
+  sortField: 'global_rank',
   searchField: ['fullname'],
   plugins: ['remove_button']
