(a)
No employer shall demand or require any applicant for employment or prospective employment or any employee to submit to or take a polygraph, lie detector or similar test or examination as a condition of employment or continued employment. The prohibition of this section does not apply to the federal government or any agency thereof or the state government or any agency or local subdivision thereof, including, but not limited to, counties, cities and counties, cities, districts, authorities, and agencies.
(b)
No employer shall request any person to take such a test, or administer such a test, without first advising the person in writing at the time the test is to be administered of the rights guaranteed by this section.