In today's tough housing market, homebuyers are often so grateful to find a house they can afford that their thinking stops right there. But just as important as the financing package, especially with a newly built house, is the warranty package. If the foundation shifts after you move in and the roof starts to leak, what will the builder do for you? And what if the problems show up in your second year of occupancy rather than the first? Not a few homebuyers find themselves stuck with massive repair costs after they've bought the home of their dreams.

An older house has at least had its shakedown cruise. Any structural defects should have shown up already. But you can't count on the seller to tell you about them, and the warranties occasionally offered on older homes don't amount to much. Only a thoroughly professional inspection can tell you what shape the house is in.

Buyers of newly built houses get the best protection in New Jersey and Minnesota, where the law requires 10-year warranty protection against certain structural defects and more comprehensive protection in the first two years after purchase. If a builder fails to comply with the law, the state can put him out of business. This doesn't mean it's easy to enforce a claim in these two states, only that you have far better chance of success than in other states where buyers lack the leverage of good law.

You usually have the protection of an "implied warranty" (unless your contract with the builder expressly eliminates it). This gives you the right to sue if your new house is uninhabitable for some reason. But that can be hard to prove and expensive to prosecute. Your protection rarely lasts longer than one year.

The best available private warranty is offered by the Home Owners Warranty Corp., and its imitators. During the first two years, the 11,000 builders who belong to HOW agree to make specified repairs in the houses they build after you pay a $250 deductible. During the third through 10th years, you continue to be insured against structural defects. If your builder goes broke, the repair may be covered by an insurance company. There's a dispute process for adjudicating arguments--not perfect, but better than most.

More than half of the 23,609 claims processed by now have been for structural defects in years three through 10--years when buyers otherwise would have had to pay these costs themselves. (But the words "structural defect" are interpreted tightly, and cover less than the buyer might like.)

In January, HOW started a five-year warranty for remodeling jobs if you're adding a room or enlarging the kitchen. Ask your builder if he carries this guarantee.

Many builders offer their own warranties, which rarely last longer than one year. A good builder will honor it. A bad one will ignore it. Lacking dispute-handling procedures, you have little recourse but to sue. A local builders association sometimes can intervene on your behalf. Large numbers of builders offer no warranty at all--although anyone who has an FHA-VA mortgage automatically receives a certain amount of protection.

Without the backing of a law or an insurance company, a warranty is only as good as the builder himself. A buyer should ask for references or "visit areas where he has already built and ask people if they have any complaints," Louise Yung of the Federal Trade Commission told my associate, Virginia Wilson.

Occasionally, builders will agree to put the final $2,000 to $3,000 of your payment into escrow, to be received only when final warranty repairs are made. Failing that, have the house checked by an inspection service before you sign the settlement papers, and make your own list of things yet to be done. The builder should agree in writing to make all the specified repairs. Otherwise, he may walk away claiming that you bought the house "as is." Some companies offer warranties on older homes. You pay for an inspector to visit the house and give you a report on its condition. The service then may warrant certain structures and systems in the house for a certain period of time.

A growing number of real estate agents throw in a seller-financed warranty when you buy a house--but this guarantee isn't worth very much. The warranty is sharply limited and is granted without inspection, so you haven't the faintest idea whether the house and its systems are in good condition. When you make an offer on a house, it always should be "subject to" an acceptable report by a home-inspection engineer--otherwise, you're buying a pig in a poke. Most real-estate agents can give you the names of engineers, or help you look for one in the yellow pages.