rem: value_i = cell.getAttribute('value'); value_winner = nextCell.getAttribute('value'); 
add: value_i = cell.getAttribute('label'); value_winner = nextCell.getAttribute('label'); 
context: function bubbleSort(columnPosition, ascending, children){  var a = children.childNodes;  var n = a.length, m = n - 1;  // for efficiencey, read all the value attributes only once and store in an array  var keys = [];  for (var x=0; x<n; x++){    var keyCell = a[x].firstChild.childNodes[columnPosition];    keys[x] = keyCell.getAttribute('value');  }  for (var i = 0; i < m; i++) {    var key = keys[i];    var winner = -1;    for (var j = i + 1; j < n; j++) {      var nextKey = keys[j];      if (ascending ? key > nextKey : key < nextKey) {        key = nextKey;        winner = j;      }    }    if (winner != -1){      // get the corresponding menuitems      var item = a[i];      var row = item.firstChild;      var nextItem = a[winner];      var nextRow = nextItem.firstChild;      // swap the row values and the id's of the corresponding menuitems      var temp = item.getAttribute('id');      item.setAttribute('id', nextItem.getAttribute('id'));      nextItem.setAttribute('id', temp);      var cell = row.firstChild;      var nextCell = nextRow.firstChild;      var position = 0;      while (cell) {        var value_i;        var value_winner;        if (position == columnPosition) {          value_i = keys[i];          value_winner = keys[winner];          keys[i] = value_winner;          keys[winner] = value_i;        } else {          value_i = cell.getAttribute('value');          value_winner = nextCell.getAttribute('value');        }        cell.setAttribute('value', value_winner);        nextCell.setAttribute('value', value_i);        cell = cell.nextSibling;        nextCell = nextCell.nextSibling;        position++;      }    }  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/468f64643e26e0591170e638f088eae9964b3087/treeUtils.js/clean/suite/common/permissions/treeUtils.js