(a) A child in need of supervision or neglected or dependent who must be taken from his home shall be given temporary care in a shelter facility and shall not be placed in detention.

(b) When a child is placed in a detention facility or in a shelter facility, the law enforcement official taking the child into custody shall promptly notify the Court and its designee. He shall also notify a parent or legal guardian or, if a parent or legal guardian cannot be located within the Territory, the person with whom the child has been residing and inform him of the right to a prompt hearing to determine whether the child is to be detained further. The Court shall hold the detention hearing with 48 hours, excluding Saturdays, Sundays, and court holidays, unless waived in writing by the child’s attorney, parent, guardian, or an adult person with whom the child has been residing.

(c) (1) No child shall be held in a detention or shelter facility longer than 48 hours, excluding Saturdays, Sundays, and Court holidays, unless a petition has been filed or the Court determines that it would be contrary to the welfare of the child or of the community to release the child from detention. The Court shall make provisions so that either a judge or referee is available to set bond 7 days a week.

(2) No child taken to a detention or shelter facility under 45.0202 through 45.0207 as the result of an allegedly delinquent act which would constitute a felony if committed by an adult shall be released from the facility if a law enforcement agency has requested that a detention hearing be held to determine whether the child’s immediate welfare or the protection of the community requires that he be detained. The child may not afterward be released from detention except after a hearing, reasonable advance notice of which has been given to the Attorney General, alleging new circumstances concerning the further detention of the child.

(3) When, following a detention hearing as provided for by paragraph (2), the Court orders further detention of a child, a petition alleging the child to be delinquent shall be filed with the Court without unnecessary delay if one has not been previously filed, and the child shall be held in detention pending a hearing on the petition.

(d) The Court may at any time order the release of any child, except children being held under paragraph (c)(2) and (c)(3), from detention or shelter care without holding a hearing, either without restriction or upon written promise of the parent, guardian, or legal custodian to bring the child to the Court at a time set or to be set by the Court.

(e)(1) After making a reasonable effort to obtain the consent of the parent, guardian, or other legal custodian, the Court may authorize or consent to medical, surgical, or dental treatment or care for a child placed in detention or shelter care.

(2) When the Court finds that emergency medical, surgical, or dental treatment is required for a child placed in detention or shelter care, it may authorize such treatment or care if the parents, guardian, or legal custodian are not immediately available.

(f)(1) No child under 18 years of age may be detained in jail, lockup, or other place used for the confinement of adult offenders or persons charged with crime.

(2) The official in charge of a jail or other facility for the detention of adult offenders or persons charged with crime shall inform the Court immediately when a child who is or appears to be under 18 years of age is received at the facility.

(g) Nothing in this section shall be construed as denying a child the right to bail.