Chris Peitschmann has posted an exelent blog on calculating the distance between two geocodes using javascript.

http://pietschsoft.com/Blog/Post.aspx?PostID=1452

The Ninija