Go to maps.google.com
right click on the map, select "what's here"
and you will see similar behaviour to what you are asking. Viewing the js code it looks very similar to what Eric mentions. I've learned quite a bit by looking at the code on the Google Maps web site.