// makes tables sortable // based on http://www.kryogenix.org/code/browser/sorttable/ // file is part of the vB Code [table] product by StGaensler // (available from http://www.vbulletin.org/forum/showthread.php?t=107985) // file rev: 0.1.5.3.3 addEvent(window, "load", sortables_init); var SORT_COLUMN_INDEX; function sortables_init() { // Find all tables with class sortable and make them sortable if (!document.getElementsByTagName) return; tbls = document.getElementsByTagName("table"); for (ti=0;ti 0) { var firstRow = table.rows[0]; } if (!firstRow) return; // We have a first row: assume it's the header, and make its contents clickable links for (var i=0;i'+txt+' '; // create link for sorting the column //var link = document.createElement('a'); //link.className = 'sortheader'; //link.href = '#'; //var onclick = document.createAttribute("onclick") //onclick.nodeValue = 'ts_resortTable(this, '+i+');return false;' //link.setAttributeNode(onclick); // move the current contents of the cell into the hyperlink //var inner = cell.childNodes; //for (var j=0;j'; newRows.reverse(); span.setAttribute('sortdir','up'); } else { ARROW = ' '; span.setAttribute('sortdir','down'); } // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones // don't do sortbottom rows for (i=0;i