If I Had a Quarter Million Dollars - S5-E22
Continuity mistake: After Barney makes his way around town spreading The Rumor that he has loads of money, when Barney walks into the courthouse he removes his jacket and hat then hangs them on the coat tree, and the hat keeps moving under and over the jacket between shots.
Answer: Those "boxes" are valences that used to be very common, before air conditioning. They allow for windows to be open during rain storms. They permit air circulation, without letting the rain in.