+TreeMaker.prototype.getExpansion = function() {
+ var rows = this.root.getElementsByTagName('TR');
+ var row, cells, stateCell, button, expid, node_depth, last_depth = -1, dd, step;
+ var steps = new Array();
+ steps.push(this.root.getAttribute('name'));
+
+ var expanded = (/.*mi\.gif$|.*mi_ani\.gif$/);
+ for(i=0 ; i < rows.length ; i++) {
+ row = rows[i];
+ cells = row.getElementsByTagName('TD');
+ stateCell = cells[cells.length-2]; // cell where the +/- button is
+ button = stateCell.getElementsByTagName('IMG');
+ if (! button.length)
+ continue;
+ button = button[0];
+ if (expanded.test(button.src)) {
+ expid = button.parentNode.getAttribute("name");
+ node_depth = cells[0].getAttribute('colspan') || 0;
+ dd = last_depth - node_depth + 1;
+ last_depth = node_depth;
+ if (dd > 0) {
+ step = '';
+ for (var j = 0 ; j < dd ; j++)
+ step = step + '_';
+ steps.push(step);
+ }
+ steps.push(expid);
+ }
+ }
+ return steps.join(':');
+};
+