Finding a counterfeit coin

[Ernie Cohen sent me this puzzle, and I also heard it from a student who got it from Ernie at Marktoberdorf.]

You have 12 coins, 11 of which are the same weight and one counterfeit coin which has a different weight from the others. You have a balance that in each weighing tells you whether the two sides are of equal weight, or which side weighs more. How many weighings do you need to determine: which is the counterfeit coin, and whether it weighs more or less than the other coins. How?