First off : Do not use MD5 : It is not strong enough.
Excellent suggestion by @Shaggy Frog, use bycrypt. These posts should help you out:
https://stackoverflow.com/questions/2299434/bcrypt-implementation-in-javascript
Do I need to store the salt with bcrypt?
JS implementation of Bcrypt on Google Code
See th bCrypt JavaDoc.
What you would do is on the server when someone saves a password:
BCrypt.hashpw(plain_password, salt);
When someone tries to login:
if(BCrypt.checkpw(password_typed_by_user, stored_hash)
{
//itmatches.. log him/her in.
}
What you could do is use the username (or maybe a few letters from the username) for the salt, so you don't have to store that somewhere too.
When the password changes you need to take the plain text password again (on the server) and hash it again just like you would do when you saved it initially. If you are thinking of retrieval, there is no way, thats the point of hashing. Like most websites, you can change the password to some random numbers and then email this off to the requested address.