(a) A person commits the crime of loitering if he:
(1) Loiters, remains or wanders about in a public place for the purpose of begging; or
(2) Loiters or remains in a public place for the purpose of gambling; or
(3) Loiters or remains in a public place for the purpose of engaging or soliciting another person to engage in prostitution or deviate sexual intercourse; or
(4) Being masked, loiters, remains or congregates in a public place; or
(5) Loiters or remains in or about a school, college or university building or grounds after having been told to leave by any authorized official of such school, college or university, and not having any reason or relationship involving custody of or responsibility for a pupil or any other specific, legitimate reason for being there, and not having written permission from a school, college or university administrator; or
(6) Loiters or remains in any transportation facility, unless specifically authorized to do so, for the purpose of soliciting or engaging in any business, trade or commercial transactions involving the sale of merchandise or services; or
(7) Loiters or remains in any place with one or more persons for purpose of unlawfully using or possessing a dangerous drug.
(b) A person does not commit a crime under subdivision (a)(4) of this section if he is going to or from or staying at a masquerade party, or is participating in a public parade or presentation of an educational, religious, or historical character or in an event as defined in subdivision (1) of Section 13A-11-140.
(c) "Deviate sexual intercourse" in subdivision (a)(3) of this section is defined as in subdivision (2) of Section 13A-6-60.
(d) "Dangerous drug" in subdivision (a)(7) of this section means any narcotic, drug or controlled substance as defined in Chapter 2 of Title 20 of this Code and any schedule incorporated therein.
(e) Loitering is a violation.