Forum Moderators: open
This is commonly called "show/hide divs" or sometimes "show/hide content". The topic is really one for our Javascript forum rather than here in the HTML forum. There are already many threads you can reference on the topic. Try our site search [google.com] to see the available threads.
I've spent a few hours searching for this kind of script (the animated type) for a project of mine and, the best one I've found takes the shape of three JS files that you can find easily with Google :
prototype.js
scriptaculous.js
effect.js
Then, you use this snippet :
function id_toggle ( targetId ) {
if (document.getElementById(targetId).style.display != "none")
Effect.BlindUp(targetId);
else
Effect.BlindDown(targetId);
}