If the news about the national mortgage meltdown has you thinking that refinancing is a bad idea, think again. Interest rates for 15-year and 30-year fixed-rate loans still hover near historic lows. And although banks have tightened their restrictions, applications are still getting approved.

Whether you are facing payments that you can no longer afford or you want to take advantage of these low rates, refinancing may well be on your mind. Here's how to figure out if it is right for you.

Look at the Short-Term Savings

As with a regular mortgage, refinancing involves closing costs. Lenders are required to provide you with a good-faith estimate of those costs before closing. But it's common for a few last-minute changes to boost the overall tab. Don't forget about the prepayment penalties that may apply to your existing mortgage, particularly if you're holding an adjustable-rate mortgage . Although the use of prepayment penalties may eventually be abolished, or at least severely curtailed, they are still in effect for many borrowers.

To calculate how long it'll take for your monthly savings to pay off the costs you'll incur by refinancing, add up your closing costs and any additional penalties. Then divide that number by the savings from your new monthly mortgage payments. The resulting figure is the number of months before you break even. So if your closing would cost $2,500 and refinancing would lower your monthly payments by $85, you'd hit your break-even point in 29.4 months. In that case, if you think you might move in the next two-and-a-half years, then refinancing is probably not a good idea.

But, don't give up hope just because the first set of numbers doesn't work out. Ask your loan officer to run the numbers for different types of loans to see if you can find one that's right.

For example, if you know you will move in just a few years but the rates on your existing ARM are about to skyrocket, refinancing with a new ARM may very well make sense.

Think About the Long Term, Too

If you're planning to stay put for a while, then you need to take the long-term cost of refinancing into account, too. So be aware that refinancing with a mortgage whose term is much longer than what you've got left on your existing mortgage will cost you.

If you take out a new 30-year loan to replace the 15 years left on your existing mortgage, you'll significantly increase the number of payments you have to make on the loan -- instead of paying off your home over 30 years, you'll end up paying for it for 45 years. Even if your monthly payments are lower, you'll pay considerably more in the long term.

Say you've got 15 years left on a $200,000 mortgage you took out at 8%. Your monthly payments are $1,450, and you've got $153,000 in principal remaining. If you refinance the principal at 6% for 30 years, your monthly payments will drop to just $910 -- a savings of $540 a month. However, you'll tack on an additional 15 years of payments, so the new loan will cost a total of $327,600 over the full term. That amounts to a whopping $66,600 more in interest than if you had just finished out the remaining years on your original loan.

To avoid paying this extra interest, try to match the term of your new mortgage to the remaining years on your old mortgage. Instead of a 30-year loan in the example above, a new 15-year loan at 6% would drop monthly payments to $1,285. That's a savings of $165 a month. What's more, you would pay $30,000 less in interest over the remainder of your loan than if you'd stuck with your original mortgage. Assuming closing costs of about $4,000 and no prepayment penalties, your break-even point would be just 24 months away.

So whether you're stuck in an ARM and want out or you are hoping to take advantage of lower rates to reduce your monthly payments, make sure you crunch the numbers. If you do your homework, you may find the silver lining in an otherwise messy mortgage situation.
Peter McDougall is a freelance writer who lives in Freeport, Maine, with his wife and their dog.