3 // get a reference to the output block
4 outputBlock = document.getElementById("output-" + id);
6 // and the image that's next to the block
7 img = document.getElementById("img-" + id);
9 old_src = img.getAttribute("src");
11 current_display = outputBlock.style.display;
13 // try to handle the case where the display is not explicitly set
14 if (current_display == "") {
15 if (outputBlock.currentStyle) { // ack, IE
16 current_display = outputBlock.currentStyle.display;
18 else if (document.defaultView.getComputedStyle) { // oooh, DOM
19 var style_list = document.defaultView.getComputedStyle(outputBlock, "");
21 // konqueor has getComputedStyle, but it does not work
22 if (style_list != null) {
23 current_display = style_list.getPropertyValue("display");
26 // in the case than neither works, we will do nothing. it just
27 // means the user will have to click twice to do the initial
31 if (current_display == "block") {
32 outputBlock.style.display = "none";
33 img.setAttribute("src", old_src.replace("_hide", "_unhide"));
36 outputBlock.style.display = "block";
37 img.setAttribute("src", old_src.replace("_unhide", "_hide"));