// Changes the class of the given tag from classa to classb or back function classoggle(tag, classa, classb) { if (tag.className==classa){ tag.className=classb; } else { tag.className=classa; } } // Toggles the class name of the indexed div between 'hideMe' and 'showMe' // and toggles the src attribute of the referenced img tag between openPicture and closePicture function visoggle(divID, img) { var d = document.getElementById(divID); classoggle(d, 'hideMe', 'showMe'); if (img!=undefined && img != 'null') { if (img.src == closePicture){ img.src = openPicture; } else { img.src = closePicture; } } } // Toggles the indicated image and collapses all other ones function visoggleSolo(divID, prefix, img, anchor, tagName){ var d = document.getElementById(divID); var isHid = d.className == 'hideMe'; var noImg = img=='null'; collapseAll(prefix, 0, noImg, tagName); if (isHid){ if (noImg) { visoggle(divID); } else { visoggle(divID, img); } } if (anchor != 'null') { location.hash=anchor; } } // Collapses and changes the image for all tags that start with the given prefix. Expands them if exp=1 function collapseAll(start, exp, noImg, tagName) { var cTag = 'div'; if(tagName != undefined && tagName!='null'){ cTag = tagName; }//if var expand = exp==1; var doimages = true; if (noImg) { doimages = false; }//if if (expand) { if(doimages){ var newPic = openPicture; var oldPic = closePicture; }//if var newClass = 'showMe'; } else { if(doimages){ var newPic = closePicture; var oldPic = openPicture; }//if var newClass = 'hideMe'; }//else if(doimages){ var allImgs = document.getElementsByTagName('img'); for (i=0; i < allImgs.length; i++) { if (allImgs[i].name.indexOf(start) == 0){ allImgs[i].src = newPic; }//if }//for }//if var allDivs = document.getElementsByTagName(cTag); for (i=0; i < allDivs.length; i++) { if (allDivs[i].id.indexOf(start) == 0) { allDivs[i].className = newClass }//if }//for }//function