A very common and well known issue in our cars. The auto-dimming (also known as photo-chromatic) function of our mirrors (side and rear) operate through the use of a film filled with some liquid with mercury in it. Replacement "oval" M5 mirrors cost over $500 from BMW. However, a company called Sybesma (sp?) will take your mirror and fix it (with a new electronically-dimming mirror) for around $100. I can personally vouch for Sybesma's service. Some people like to buy the standard rectangular 5 series mirror. All modern BMWs use the same mirror mount, so you can use whatever you would like to use.
Be sure to try a search next time. Check out my comment in this thread here for more details on replacements:
http://www.m5board.com/vbulletin/e3...94479-large-bubble-mirror-15.html#post1920684
Be sure to be careful when removing the mirror not to crack the windshield!