What is a Bailiff?

I was in court recently and the judge asked a man he called the "bailiff" to hand a witness a piece of paper.  What is a bailiff?

A bailiff is a court employee who provides security for the judge and helps the judge maintain order in the courtroom.  He or she also may hand papers from a lawyer to a witness or from a witness to the jury.

The bailiff is also the person usually entrusted with the job of escorting the jury from the courtroom to the jury deliberation room and for passing questions from the jury to the judge.