--- /home/berend/src/drupal-focus/src/svn/vendor/drupal/core/6/current/misc/tabledrag.js	2008-09-17 19:59:39.000000000 +1200
+++ ./tabledrag.js	2008-11-07 15:08:55.000000000 +1300
@@ -76,13 +76,13 @@
     // manually append 2 indentations in the first draggable row, measure
     // the offset, then remove.
     var indent = Drupal.theme('tableDragIndentation');
-    var testCell = $('tr.draggable:first td:first', table).prepend(indent).prepend(indent);
+    var testCell = $('> tbody > tr.draggable:first td:first, > tr.draggable:first td:first', table).prepend(indent).prepend(indent);
     this.indentAmount = $('.indentation', testCell).get(1).offsetLeft - $('.indentation', testCell).get(0).offsetLeft;
     $('.indentation', testCell).slice(0, 2).remove();
   }
 
   // Make each applicable row draggable.
-  $('tr.draggable', table).each(function() { self.makeDraggable(this); });
+  $('> tr.draggable, > tbody > tr.draggable', table).each(function() { self.makeDraggable(this); });
 
   // Hide columns containing affected form elements.
   this.hideColumns();
@@ -112,9 +112,9 @@
     // Hide the column containing this field.
     if (hidden && cell[0] && cell.css('display') != 'none') {
       // Add 1 to our indexes. The nth-child selector is 1 based, not 0 based.
-      var columnIndex = $('td', cell.parent()).index(cell.get(0)) + 1;
-      var headerIndex = $('td:not(:hidden)', cell.parent()).index(cell.get(0)) + 1;
-      $('tr', this.table).each(function(){
+      var columnIndex = $('> td', cell.parent()).index(cell.get(0)) + 1;
+      var headerIndex = $('> td:not(:hidden)', cell.parent()).index(cell.get(0)) + 1;
+      $('> thead > tr, > tbody > tr, > tr', this.table).each(function(){
         var row = $(this);
         var parentTag = row.parent().get(0).tagName.toLowerCase();
         var index = (parentTag == 'thead') ? headerIndex : columnIndex;
@@ -701,7 +701,7 @@
           var maxVal = values[values.length - 1];
           // Populate the values in the siblings.
           $(targetClass, siblings).each(function() {
-            // If there are more items than possible values, assign the maximum value to the row. 
+            // If there are more items than possible values, assign the maximum value to the row.
             if (values.length > 0) {
               this.value = values.shift();
             }
@@ -775,7 +775,7 @@
 Drupal.tableDrag.prototype.restripeTable = function() {
   // :even and :odd are reversed because jquery counts from 0 and
   // we count from 1, so we're out of sync.
-  $('tr.draggable', this.table)
+  $('> tbody > tr.draggable, > tr.draggable', this.table)
     .filter(':odd').filter('.odd')
       .removeClass('odd').addClass('even')
     .end().end()
