| 1 |
/* $Id: toggle.js,v 1.2 2005/08/29 21:52:13 robinmonks Exp $ */
|
| 2 |
|
| 3 |
function toggle( targetId ) {
|
| 4 |
if ( document.getElementById ) {
|
| 5 |
target = document.getElementById( targetId );
|
| 6 |
if ( target.style.display == "none" ) {
|
| 7 |
target.style.display = "";
|
| 8 |
} else {
|
| 9 |
target.style.display = "none";
|
| 10 |
}
|
| 11 |
}
|
| 12 |
}
|
| 13 |
|
| 14 |
function toggleShow( targetId ) {
|
| 15 |
if ( document.getElementById ) {
|
| 16 |
target = document.getElementById( targetId );
|
| 17 |
if (target.style.display == "none") {
|
| 18 |
target.style.display = "";
|
| 19 |
}
|
| 20 |
}
|
| 21 |
}
|
| 22 |
|
| 23 |
function toggleHide( targetId ) {
|
| 24 |
if ( document.getElementById ) {
|
| 25 |
target = document.getElementById( targetId );
|
| 26 |
if (target.style.display == "") {
|
| 27 |
target.style.display = "none";
|
| 28 |
}
|
| 29 |
}
|
| 30 |
}
|
| 31 |
|
| 32 |
function toggleAll( targetTag, showHide ) {
|
| 33 |
if ( document.getElementById ) {
|
| 34 |
target = document.getElementsByTagName( targetTag );
|
| 35 |
var i;
|
| 36 |
var max = target.length;
|
| 37 |
if ( showHide == "show" ) {
|
| 38 |
for ( i = 0; i < max; i++ ) {
|
| 39 |
if ( target[ i ].style.display == "none" ) {
|
| 40 |
target[ i ].style.display = "";
|
| 41 |
}
|
| 42 |
}
|
| 43 |
}
|
| 44 |
else if ( showHide == "hide" ) {
|
| 45 |
for ( i = 0; i < max; i++ ) {
|
| 46 |
if ( target[ i ].style.display == "" ) {
|
| 47 |
target[ i ].style.display = "none";
|
| 48 |
}
|
| 49 |
}
|
| 50 |
}
|
| 51 |
}
|
| 52 |
}
|