A. The county board of supervisors or the county jail district, if authorized pursuant to title 48, chapter 25, shall maintain a detention center that is separate and apart from a jail or lockup in which adults are confined and where juveniles who are alleged to be delinquent or children who are incorrigible and within the provisions of this article shall be detained when necessary before or after a hearing or as a condition of probation. A juvenile who is charged with an offense that is not a dangerous offense and that is listed in section 13-501 may be detained in a juvenile detention center if the detention is ordered by the court. The board may enter agreements with public or private entities to acquire land for, build, purchase, lease-purchase, lease or expand a detention center required by this section.
B. The board of supervisors or the county jail district, if authorized pursuant to title 48, chapter 25, may provide for the detention of juveniles who are accused or convicted of a criminal offense in a jail or lockup in which adults are confined. A juvenile who is confined in a jail or lockup in which adults are confined shall be kept in a physically separate section from any adult who is charged with or convicted of a criminal offense, and no sight or sound contact between the juvenile and any charged or convicted adult is permitted, except to the extent authorized under federal laws or regulations.
C. A juvenile, pending a juvenile hearing, shall not be confined with adults charged with or convicted of a crime, except that:
1. A juvenile who is accused of a criminal offense or who is alleged to be delinquent may be securely detained in such location for up to six hours until transportation to a juvenile detention center can be arranged if the juvenile is kept in a physically separate section from any adult who is charged with or convicted of a crime and no sight or sound contact between the juvenile and any charged or convicted adult is permitted, except to the extent authorized under federal laws or regulations.
2. A juvenile who is transferred as provided in section 8-327 to the criminal division of the superior court may be securely detained if the juvenile is kept in a physically separate section from any adult charged with or convicted of a crime, and no sight or sound contact with any charged or convicted adult is permitted, except to the extent authorized under federal laws or regulations.
3. A juvenile who is arrested for an offense listed in section 13-501 may be detained in a juvenile detention center until formally charged as an adult. After a juvenile has been formally charged as an adult the juvenile may be either of the following:
(a) Detained in a juvenile detention center if the offense is not a dangerous offense and the detention is ordered by the court.
(b) Securely detained in an adult facility if the juvenile is detained separately from any adult charged with or convicted of a crime, except to the extent authorized under federal laws or regulations.
D. In determining whether to order that a juvenile who is charged with an offense that is not a dangerous offense and that is listed in section 13-501 be detained in a juvenile detention center or an adult facility pursuant to subsection A or subsection C, paragraph 3, subdivision (a) of this section, the court shall consider all of the following:
1. The best interests of both the juvenile charged as an adult and the other juveniles detained in the juvenile detention center.
2. The severity of the charges against the juvenile charged as an adult.
3. The existing programs and facilities for juveniles at both the juvenile detention center and the adult facility.
4. Any other factor relevant to the determination of where to detain the juvenile.
E. A child who is alleged to be delinquent or who is alleged to be incorrigible shall not be securely detained in a jail or lockup in which adults charged with or convicted of a crime are detained. A child may be nonsecurely detained if necessary to obtain the child’s name, age, residence or other identifying information for up to six hours until arrangements for transportation to any shelter care facility, home or other appropriate place can be made. A child who is nonsecurely detained shall be detained separately from any adult charged with or convicted of a crime, and no sight or sound contact with any charged or convicted adult is permitted, except to the extent authorized under federal laws or regulations.
F. Any detained juvenile or child who, by the juvenile’s or child’s conduct, endangers or evidences that the juvenile or child may endanger the safety of other detained children shall not be allowed to intermingle with any other juvenile or child in the detention center.
G. Pursuant to section 8-322, the county board of supervisors, the county jail district board of directors or the administrative office of the courts on behalf of the juvenile court may enter into an agreement with public or private entities to provide the detention centers required by subsection A of this section.
H. For the purposes of this section, “dangerous offense” has the same meaning prescribed in section 13-105.