I suggest that you post your question again with some more specific information and then the attorneys on AVVO, many of whom know bankruptcy law, can give you better advice.
Generally speaking, if you are overwhelmed by unsecured debt like credit cards, then you can have that debt discharged and free up cash to concentrate on the mortgage company if you qualify for a chapter 7. To qualify, your income needs to be below the average monthly income level established by the U.S. Census Bureau for your state. In addition, in a chapter 7, you need to assure yourself that all of your assets are covered by allowable exemptions. If you are upside down on your mortgage you may be all set.
Again, this is a broad generalization and if you post more specifics, I'll bet you will get a better answer.
Also, you owe it to yourself under your circumstances to obtain an consultation from an experienced bankruptcy attorney.
This answer is provided for informational purposes only. Actual legal advice can only be provided in an office consultation by an attorney licensed in your jurisdiction, with experience in the area of law in which your concern lies.
Sadly, you can never keep a house that you cannot afford to pay for. You might try looking at the government HAMP site to see if your lender is involved in a loan modification program. Try to pay your first mortgage on time each month before you pay anything else. See a local bankruptcy attorney to see if there is some way you can adjust your monthly expenses. Unfortuanately, with an adjustable rate mortgage they tend to go up as interest rates go up and we are, historically, at a low point in terms of interest rates.