I use Google's apps a lot more than Yahoo as well. However, it's interesting that you call Google's code "magic." It's probably only magical because until now they haven't released it to the public. Now the magic is gone and it's just a bunch of javascript...
I haven't seen anything that says that's the library they use for Gmail - I got the impression it was a brand new library produced as part of the Doctype project (partly for educational purposes). Got a link to back that statement up?
"This is a big part of the encyclopedia and the guide. It is not just having a reference section but having a series of how-to articles and larger case studies. And those articles are primarily based around previously unreleased Google code that we are open sourcing as part of this project. We have a JavaScript library that handles a lot of cross browser compatibility issues which we use in properties like Gmail. If you ever viewed source you've seen the compiled version which isn't terrible readable. As part of this encyclopedia project, we are releasing the original uncompiled version that has the actual comments and real function names and description of things. So that is all open sourced under a OSI approved license."
This is so unbelievably cool, why aren't Google or other blogs playing this up more??
http://code.google.com/p/doctype/source/browse
Awesome.