My endstops have 4 female plugs, but the examples on the RepRap Prusa i3 Site have 3; what are each of them for?
The website shows exactly what each wire is for.  Both middle wires are ground, the wire on the same side as the lever is the signal wire and the last wire is the power wire.