It all depends. You do have the option to keep your house, but you have to reaffirm your loan.
Here's a pdf I found that explains bankruptcy pretty well, and what you can do in the midst of it.
http://www.consumerlaw.org/initiativ...gal_rights.pdf
Hope it gives you the information you need.