This isn't done with client side scripting so I've posted a new topic along with an explanation of how it works over in the HTML/CSS forum ...
http://forums.developertutorials.com...=3209#post3209
Let me know if you have any trouble understanding how it works and I'll track to come up with a better explanation/more complicated demo.
EDIT: I realised after I made my next post that it actually was made via client side scripting, but my post explains an alternative (and usually more appropriate) way of creating them.