Use Google AJAX Libraries API, get IP geocoding free
We've all read about the great benefits of loading your JS libraries from Google. But one that isn't terribly obvious is IP Geocoding. When you include "http://www.google.com/jsapi" on your page, Google has automatically done its best to locate the client's machine for you (to the 'metro' level). Isn't that nice of them? It's called google.loader.ClientLocation.