You're not alone if you're confused by the new capital-gains rules. The Internal Revenue Service initially couldn't figure out what lawmakers had in mind either, forcing the agency to steam ahead while waiting for Congress to pass retroactive technical corrections in 1998.

Perhaps the biggest area of confusion centers on what to do if you suffer losses. The basic rule remains the same. Capital losses offset your capital gains. If your capital losses exceed your capital gains, you can erase up to $3,000 of ordinary income, then carry over any leftover losses to future years.But under the new rules, it's possible to have short-, mid- and long-term losses at rates potentially ranging from 39.6 percent to 20 percent. Although a dollar lost is still a dollar gone from your pocket, not all losses are equal where taxes are concerned. If you have a $1 loss, it's to your advantage to use it to erase $1 of gain taxed at 39.6 percent rather than $1 of gain taxed at 20 percent.

The good news is you can do just that. But before we dive into the details, it's important to understand how to calculate capital gains on investments (collectibles and real estate have their own rules):

- Sales before May 7: Treat transactions during this period the same as you have in the past few years. If you held the investment less than 12 months, it's taxed as a short-term gain at your ordinary income bracket (from 15 percent to 39.6 percent). If you held it more than a year, the top rate is 28 percent. (Note: Use the date of the trade, not the settlement date.)

- Sales May 7 through July 28: If you held the asset less than a year, it's still a short-term gain taxed at your ordinary income rate. But if you held it more than a year, it's a long-term gain taxed at a maximum of 20 percent.

- Sales on or after July 29: Selling before a year passes still triggers a short-term gain taxed at your ordinary rate. The concept of "midterm gains" is part of this new era in capital gains. If you held an asset 12 to 18 months, it's a midterm gain taxed at a maximum of 28 percent. But now it takes 18 months to qualify for long-term gains, which are taxed at a maximum of 20 percent.

Of course, even investors weaned during a bull market suffer losses from time to time. Under the new rules, your gains and losses drip into three different buckets: short-, mid- and long-term.

Total the gains and losses in each bucket separately. If you have a loss in any bucket, use it to erase gains in the bucket facing the highest tax rate first.

"You might think this is unusual, but the IRS has basically allowed you to save some money," said Kevin P. McAuliffe, a personal finance partner in Ernst & Young's Palo Alto, Calif., office.