I used to waddle in the javascripts that Yahoo! uses for its web email user interface.
I should have known it was given as an open source code in their Yahoo! Developer Network web site.
http://com1.devnet.scd.yahoo.com/yui/
The Yahoo! User Interface Library is a set of utilities and controls, in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX.
If you really care about usability of your web site, you would want to read their excellent blog:
http://yuiblog.com/