Here is some code:
In my experience, mootools (http://mootools.net) provides the smoothest animation.