This is purely, totally, entirely up to the GM.
I say that very emphatically because, as far as I know, there is no such thing as bodily dismemberment in the rules. So you, or your GM, will have to figure out if it is permanent or temporary, and act accordingly.
My best guess: being bodily dismembered is a permanent condition. As such, I'd think Raise Dead wouldn't actually fix it. If I were the GM, I'd probably allow the players to combine Raise Dead with Remove Affliction (which removes permanent conditions) into one casting with the combined ritual component cost, and that the result is that the target's body is whole afterwards regardless of any previous damage that went beyond mere HP.
But if Remove Affliction didn't exist, I'd probably just say that Raise Dead fully restored the body anyway, because it's just not fun for a player to wander around with no legs.
EDIT: To answer your first question, you should be able to use Raise Dead on anything that was part of the corpse, and by RAW rules, get the whole body back, even if you started with some random hairs that you tore off your PC's head after he died. It's up to your group and your GM to figure out whether you want to create and use more detailed rules.
conditions, like Blinded or something like that. I don't think 4e has a "Legs ripped off" condition defined anywhere. Though I'd be sure to use that in my next session if you can find it :) – dpatchery Aug 25 '11 at 19:47