I've actually been thinking about doing one myself.
What you're talking about is usually refered to as a "fav icon"
First... you need to create an icon graphic. There are lots of tools that do this. My favorite is QTAM Bitmap to Icon 3, but there are others. I hear that even photoshop has a plugin for this now.
Once you have the icon try something like this in the head of your document.
Remember to change favicon.ico to the name of your icon file. In this example, you would keep the .ico file in your root directory. But this can be done in any directory off the root using /path/to/file/ type linking.
Hope that helps.
Enjoy.