Detect When DOM Element is in Viewport

I just read a good article by Dustin Diaz (formerly of Yahoo!) about detecting where elements are in regards to scrolling and the viewport. It is simple and very powerful, so I thought I would share it.
Detect when an element has scrolled into view