"Bas Cost Budde" <ba*@heuveltop.org> wrote in message
news:c0***********@news2.solcon.nl...
<snip>
Keep the ID of the opened question in a public variable,
and on click of an item first close the opened one.
Rather than saving the ID of the element that needs to be re-hidden as a
string in a global variable it would be more efficient to save a
reference to the element, or, better yet, its style object. It would
save having to re-locate the element within the DOM (getElementById is
not necessarily that fast). The script must have had that reference when
it made the element visible so it can just assign the reference at that
point, having defaulted the global variable to null. Then if the
variable refers to an object when it is time to make a different element
visible it is a simple matter to first render the stored element hidden.
Richard.