(a) A person commits the crime of loitering if he or she does any of the following:
(1) Loiters, remains, or wanders about in a public place for the purpose of begging.
(2) Loiters or remains in a public place for the purpose of gambling.
(3) Loiters or remains in a public place for the purpose of engaging or soliciting another person to engage in prostitution or sodomy.
(4) Being masked, loiters, remains, or congregates in a public place.
(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 the school, college, or university, 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.
(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.
(7) Loiters or remains in any place with one or more persons for the purpose of unlawfully using or possessing a dangerous drug.
(b) A person does not commit a crime under subdivision (a)(4) if he or she 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 Section 13A-11-140.
(c) Sodomy in subdivision (a)(3) is defined as in Section 13A-6-60.
(d) Dangerous drug in subdivision (a)(7) means any narcotic, drug, or controlled substance as defined in Chapter 2 of Title 20 and any schedule incorporated therein.
(e) Loitering is a violation.