Here's an example. I realize I left a couple of points out of the CSS -- background-position and repeat.
http://scripty.walterdavisstudio.com/loading
This page also demonstrates two different uses of the overlay technique. The first, as in a lightbox, is click to show, click on the overlay to hide. The second uses the Ajax.Responders.register method to hook all Ajax requests on the page with one behavior. (It also disables the click-to-close behavior for the duration, so it becomes a modal overlay.)
Once this is hooked up, you could have dozens of separate Ajax functions running on this page, and each one would trigger the overlay while it was running. Note the use of defer inside these methods, you really need that in Firefox, maybe Safari, or the overlay will either never show, or never hide -- the page will just get stuck during the request.
Walter