The judges of the several courts of this state, whenever they deem it proper or necessary, shall inquire and examine the parties, witnesses, jurors or third parties as to whether or not any of the provisions of Section 12-1-8 have been violated; and, if the judge shall ascertain and determine that any provision of Section 12-1-8 has been violated, he shall declare the persons offending guilty of contempt of court and punish them accordingly.
Ala. Code § 12-1-9 (1975)