If you want a factory warranty, Nikon will not sell the D40 just buy itself. I never read anything of the opposite, but I have read from stores on eBay that the Nikon D40 [camera body only] they sell comes with a Nikon Warranty.
Anyway, since you are just starting out I'd go for the D40x 10.2MP and a great beginner camera. Or if you find yourself a Canon favorite go for the XTi, XSi, or XS depending on how they are priced.
Be aware that the Nikon D40 & D60 will only autofocus with lenses labled as AF-S. Don't buy into the bias comments where people favor one brand over the other. Canon and Nikon products are comparatively similar.