I had the Nikon Fisheye for quite a while and it's a fantastic lens for cropped DX sensors. It is not strictly compatible with the D40/X however since it uses the AF motor from the camera to focus, which the D40/X doesn't have. So on that camera it will be a manual focus lens.
I don't think there is any fisheye that fits the Nikon mount that has in-built motor at this time?
The nikon 10.5 is awesome - but you can also get some fairly cheap alternatives, russian made manual focus things that aren't maybe as nice as the nikon but a lot cheaper and still give the effect you're after. I've not looked into them for a long time so I can't advise. You're probably looking for a diagonal (square) fisheye instead of a circular (round)
I use the 10.5 nikon fisheye on full frame (d3) - to get a proper (circular) photo you have to cut away the lens hood, which isn't fun on an expensive lens like this but it was cheaper than selling and trying to find an old 16mm full frame nikon fish.
Preparing to cut: