I note from your post that you are a newbie. As such, its already difficult to know what you want to shoot...let alone decide which camera brand is better.
I would suggest you buy the Nikon D300 and the Cannon 40D.. use both cameras and decide for yourself which is better. Once you establish your needs, you can sell away the other camera that you find is not so useful to you.
I can be contacted via PM when you need to sell the camera. I hope you sell the Nikon D300 though..