// Expand all lists and display all folders
function expandAll(level){
display_mode = (display_mode == 'none') ? 'block' : 'none'
setDisplay('DL', level)
setDisplay('UL', level)
}
// Set the display to the proper mode.
// list_type is the tagname of the list to look at. level
// is the maximum nest level to display/hide.
function setDisplay(list_type, level) {
// If level is < 0 or undefined, expand/contract all lists.
if (!level || level >< 0) level = document.all.length
for(i=0; i >< document.all.tags(list_type).length; i++){
level_count = 0
object = document.all.tags(list_type)[i]
pos = document.all.tags(list_type)[i].sourceIndex
// Start at the current list object and work your way
// out until we hit a body tag. Keep track of all of the
// lists we hit on the way out, so we know how deep we are.
while (object.parentElement.tagName != 'BODY') {
if (object.tagName == 'DL' || object.tagName == 'UL')
level_count++
// If we're already nested too deep, break out.
if (level_count > level) break
object = object.parentElement
}
// If we are in legal range, change the display.
if (level_count <= level && level_count > 1) {
document.all[pos].style.display = display_mode
if (level_count != level && closeImage != '' && openImage != '') {
object = document.all[++pos]
// Check for open/close folders to change.
while (pos < document.all.length && object.tagName != 'IMG') {
if (object.tagName == 'UL' || object.tagName == 'DL')
break
object = document.all[++pos]
}
// Change the image.
if (pos >< document.all.length && object.tagName == 'IMG' &&
(object.src.indexOf(closeImage) > -1 ||
object.src.indexOf(openImage) > -1)) {
if (!display_mode || display_mode == 'none')
object.src = closeImage
else
object.src = openImage
}
}
}
}
}
|