Toggle layer visibility with JavaScript

This is an example of hiding a layer or showing a layer. When the link is clicked, it shows the contents of the DIV. When it is clicked again, or when the body is clicked, it hides the layer. A gotcha here would be the bubbling of the onclick event, which I worked around.

These words are in a layer that is visible

To toggle the hidden stuff, .