javascript code for expanding and collapsing row

Hi,i'm using a javscript code for expanding and collapsing a row of a table .but it is expanding and collapsing.the problem is the plus and minus sign is not changing.anybody have a idea or any used code ,plz reply me.
[240 byte] By [hgjgha] at [2007-10-2 16:48:27]
# 1
what is the plus and minus sign in your code?
jgalacambraa at 2007-7-13 17:59:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi,plus and minus is the gif images.it should be changed when expanding and collapsing.
hgjgha at 2007-7-13 17:59:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
so what you did in displaying and hiding rows is what you can also do in displaying the plus or minus sign
jgalacambraa at 2007-7-13 17:59:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

HI,

Sure, i'm sending my code.if there is any mistake plz,modify that.

function collapseSpan(spanName) {

if (document.getElementById(spanName) != null) {

document.getElementById(spanName).style.display = "none";

document.getElementById(spanName).src = "./images/plus.gif";

}

}

function expandSpan(spanName) {

if (document.getElementById(spanName) != null) {

document.getElementById(spanName).style.display = "";

document.getElementById(spanName).src = "./images/minus.gif";

}

}

function spanToggle(spanName) {

if (document.getElementById(spanName).style.display == "none") {

expandSpan(spanName);

} else {

collapseSpan(spanName);

}

}

hgjgha at 2007-7-13 17:59:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
in the expandSpan function the display should be inline
jgalacambraa at 2007-7-13 17:59:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Hi,i tried that ,any other way.
hgjgha at 2007-7-13 17:59:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
sorry i forgot to mention you should put an id to both the img and when you call the function the id's of the images should be passed to the functions
jgalacambraa at 2007-7-13 17:59:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...