I found this particular thread through Google, and was so thrilled to find a forum where people know what they're doing, that I signed right up.
If you read the previous messages in this thread, it's pretty easy to see what's being undertaken, and this all worked well for me. But I'm bumping this thread because I need to toggle multiple sections of the website, and in each instance, use a DIFFERENT image switch. Below is the code I have so far. But I can only use the 2008 graphics, once either of the sections is toggled.
Is there any way to add multiple images in, without writing calling a new script for each one?
<script type="text/javascript">
function toggle_visibility(id,imgid) {
var e = document.getElementById(id);
if(e.style.display == '')
{e.style.display = 'none';
document.getElementById(imgid).src="/images/Show2008.jpg"}
else {
e.style.display = '';
document.getElementById(imgid).src="/images/Hide2008.jpg"}
}
</script>
<a onclick="toggle_visibility('2008','2008i');"><img src="/images/Show2008.jpg" width=50 id="2008i"></a>
<tbody id="2008" style='display:none';> Table full of Stuff I'm Toggling </tbody>
<a onclick="toggle_visibility('2009','2009i');"><img src="/images/Show2009.jpg" width=50 id="2009i"></a>
<tbody id="2009" style='display:none';> A Different Table full of Stuff that I'm Toggling </tbody>