Site hosted by Angelfire.com: Build your free website today!
') frames["tree_frame"].document.writeln('

') // Create a table and use a row for each node frames["tree_frame"].document.writeln('') frames["tree_frame"].document.writeln('') // Write the main node var main_node = nodes_array[0] frames["tree_frame"].document.writeln('') frames["tree_frame"].document.writeln('
') frames["tree_frame"].document.writeln('' + main_node[0].text + '') frames["tree_frame"].document.writeln('<\/td>') frames["tree_frame"].document.writeln('<\/tr>') frames["tree_frame"].document.writeln("<\/table>") // If the main node state is "open", write the child nodes if (main_node[0].state == "open") { write_children(main_node) } // Finish up frames["tree_frame"].document.writeln('<\/body>') frames["tree_frame"].document.writeln('<\/html>') frames["tree_frame"].document.close() } // This function writes all the child node for whatever // parent node is specified as the argument. Note that // this function is called recursively whenever any // child node has children of its own. function write_children(parent_node) { var child_node var indent_width // Run through all of the parent's child nodes // parent_node[0] refers to the parent node itself, so start at 1 for (var counter = 1; counter < parent_node.length; counter++) { // Store the child node child_node = parent_node[counter] // Start a new table for the child node frames["tree_frame"].document.writeln('') frames["tree_frame"].document.writeln('') // Write the node // Calculate and display the indentation indent_width = child_node[0].level * 20 frames["tree_frame"].document.writeln('
') frames["tree_frame"].document.writeln('') frames["tree_frame"].document.writeln('<\/td>') // Write the node text frames["tree_frame"].document.writeln('') frames["tree_frame"].document.writeln('
') // First check to see if this is a folder or a document if (child_node.length > 1) { // It's a folder frames["tree_frame"].document.writeln('' + child_node[0].text + '') frames["tree_frame"].document.writeln('<\/td>') frames["tree_frame"].document.writeln('<\/tr>') frames["tree_frame"].document.writeln('<\/table>') // If this child's state is "open", recursively call // this function to write the child's children (if any) if (child_node[0].state == "open") { write_children(child_node) } } else { // It's a document // Is it the currently displayed document? //if (current_document) { if (child_node[0].index == current_document) { frames["tree_frame"].document.writeln(child_node[0].text) } //} else { frames["tree_frame"].document.writeln('' + child_node[0].text + '') } frames["tree_frame"].document.writeln('<\/td>') frames["tree_frame"].document.writeln('<\/tr>') frames["tree_frame"].document.writeln('<\/table>') } } } function toggle_state(node_index) { // Get the node from the global nodes_array var current_node = nodes_array[node_index] // Store the node's current state current_state = current_node[0].state // Change it to the other state if (current_state == "open") { current_node[0].state = "closed" } else { current_node[0].state = "open" } // Is this a document? if (current_node.length == 1) { if (current_document != -1) { nodes_array[current_document].state = "closed" } current_document = current_node[0].index frames["content_frame"].location = current_node[0].url } // Rewrite the menu timeout_id = setTimeout("write_menu()", 50) } function change_all(new_state) { var current_node // Run through the global nodes_array for (counter = 0; counter < nodes_array.length; counter++) { //Store the current node current_node = nodes_array[counter] // Work only with folders if (current_node.length > 1) { current_node[0].state = new_state } } // Rewrite the menu timeout_id = setTimeout("write_menu()", 50) } //-->