5D.
Be aware that in August/September of this year Canon will release the follow-up to the 5D (not necessarily called 5D). Bigger sensor, LiveView, and a few other bells and whistles.
At that point A LOT of 5Ds will come out on the secondary market (craigslist), and you'll probably be able to get one for 1500.
If you're going to go with the 40D, consider the new XSI instead. Most of the features of the 40, in a smaller body, and will be sold new for $900 with a kit lens (18-55 IS).