')
frames["tree_frame"].document.writeln('')
// Calculate and display the indentation
indent_width = child_node[0].level * 20
if (!its_a_folder) {
// Need a bit extra for a document
indent_width += 7
}
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(' | ')
// Handle folders and documents separately
if (its_a_folder) {
frames["tree_frame"].document.writeln('')
if (child_node[0].state == "closed") {
frames["tree_frame"].document.write('')
}
else {
frames["tree_frame"].document.write('')
}
frames["tree_frame"].document.writeln('<\/td>')
frames["tree_frame"].document.writeln(' | ')
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 {
// Is it the currently displayed document?
if (child_node[0].index == current_document) {
frames["tree_frame"].document.writeln('')
frames["tree_frame"].document.writeln('<\/td>')
frames["tree_frame"].document.writeln(' | ')
frames["tree_frame"].document.writeln(child_node[0].text)
}
else {
frames["tree_frame"].document.writeln('' +
'')
frames["tree_frame"].document.writeln('<\/td>')
frames["tree_frame"].document.writeln(' | ')
frames["tree_frame"].document.writeln('')
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>')
}
frames["tree_frame"].document.writeln('<\/td>')
frames["tree_frame"].document.writeln('<\/tr>')
}
}
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)
}
//-->
|