//browser detection var ie4 = (document.all) ? true : false; var ns4 = (document.layers) ? true : false; var ns6 = (document.getElementById && !document.all) ? true : false; var open_pic = 'http://images.thesanctuarynet.org/minus.gif'; //the [-] next to menu item var closed_pic = 'http://images.thesanctuarynet.org/plus.gif'; //the [+] next to menu items //called when someone clicks on the [+]/[-] on a menu item //chooses whether to open or close the menu and calls openDiv()/closeDiv() accordingly function changeDiv(lay) { if (ie4) { if(document.all[lay].style.display == 'none') { closeAll(); openDiv(lay); }else{ closeDiv(lay); } } if (ns4) { if(document.layers[lay].visibility == 'hide') { closeAll(); openDiv(lay); }else{ closeDiv(lay); } } if (ns6) { if(document.getElementById([lay]).style.display == 'none') { closeAll(); openDiv(lay); }else{ closeDiv(lay); } } } //opens the menu branch passed to it and changes the [+] to a [-] function closeDiv(lay) { var bgcolor=''; if (ie4) { document.all[lay].style.display = 'none'; //document.all[lay+'p'].style.background = bgcolor; } if (ns4) { document.layers[lay].visibility = 'hide'; } if (ns6) { document.getElementById([lay]).style.display = 'none'; //document.getElementById([lay+'p']).style.background = bgcolor; } //document.images[lay+'i'].src = closed_pic; } //closes the tree passed to it and changes the [-] to a [+] function openDiv(lay) { var bgcolor = ''; if (ie4) { document.all[lay].style.display = ''; //document.all[lay+'p'].style.background = bgcolor; } if (ns4) { document.layers[lay].visibility = 'show'; } if (ns6) { document.getElementById([lay]).style.display = ''; //document.getElementById([lay+'p']).style.background = bgcolor; } //document.images[lay+'i'].src = open_pic; } function closeAll() { for (var i = 0; i < cat_ids.length; i++) { closeDiv('div_'+cat_ids[i]); } } //functions for changing the mouse pointer to a hand when the mouse goes over the [+]/[-] function MouseHandlerOver( bPtr ) { bPtr.style.cursor = "hand"; } function MouseHandlerOut( bPtr ) { bPtr.style.cursor = "default"; }