Hi,

I have been using this function for a while and it has served well, however, I need some modifications to it and when it comes to Javascript I don't have a clue .

This function basically hides a div when the link is clicked:

HTML Code:
<div>
<a href="#" onclick="show_comment('4');return false;">Hide</a>
<h2>Custom Keywords</h2>
<div style="display:block;" id="4"> 
This is the JS function:

HTML Code:
function show_comment(id) {
 menu = document.getElementById(id);
 if(menu.style.display == "block"){
  menu.style.display = "none";
 } else {
  menu.style.display = "block";
 }
} //end function show_comment()
I would like the function to change the link text from 'Hide' to show when the div is in a hidden state and when the div is visible keep the text as hide.

Does anyone know how I can modify this function to do this?

Thanks,