A patient support or bed is disclosed having a frame, a mattress, and a plurality of siderails. A detector is disclosed that detects a position of a siderail relative to a portion of the bed.