rem: for (var i = 0; i < columns.length; ++i) { if (columns[i].getAttribute('sortDirection')) return columns[i]; 
add: var i = 0; var column; while ((column = columns.item(i++)) != null) { if (column.getAttribute('sortDirection')) return column; 
context: function find_sort_column(){  var columns = document.getElementsByTagName('treecol');  for (var i = 0; i < columns.length; ++i) {    if (columns[i].getAttribute('sortDirection'))      return columns[i];  }  return columns[0];}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/fef48cc2d03220de91a667eed5b98f5b47d84b13/nsTreeSorting.js/clean/xpfe/global/resources/content/nsTreeSorting.js