For the purposes of this part 2, any reference to custody, confinement, charged with, held for, convicted of, a felony, misdemeanor, or petty offense shall be deemed to include a juvenile who is detained or committed for the commission of an act which would constitute such a felony, misdemeanor, or petty offense if committed by an adult or who is the subject of a petition filed pursuant to article 2 of title 19, C.R.S., alleging the commission of such a delinquent act or a juvenile who has been adjudicated a juvenile delinquent as provided for in article 2 of title 19, C.R.S., for an act which would constitute a felony, misdemeanor, or petty offense if committed by an adult.