(a) When any minor or child against whom a petition has been filed seeking to commit the minor or child to the custody of the department is initially brought before the juvenile court, the juvenile court shall provide a copy of the petition and if requested, read the petition to the minor or child and to his or her parent, legal guardian, or legal custodian and counsel, and inform those persons verbally and in writing of the date, time, and place of the next hearing to be held in regard to the minor or child, the purpose of the hearing, the rights of the minor or child at the hearing, and the possible consequences of the hearing.
(b) The juvenile court shall appoint a child's attorney for the minor or child. The juvenile court may appoint a guardian ad litem in addition to the child's attorney. No statement made or act done by the minor or child in the presence of the juvenile court prior to the minor or child obtaining the services of a child's attorney, or a guardian ad litem, shall be considered by the juvenile court in determining if the minor or child should be committed to the custody of the department.
(c) Notice of the filing of a petition pursuant to this section and of the date of final hearing shall be given to the department by the juvenile court not less than 14 days prior to the hearing. The notice shall constitute an application for admission to a facility maintained or operated by, under contract with, or under the supervision and control of the department.
(d) Not less than 24 hours prior to the final hearing, the department shall notify the juvenile court whether adequate facilities are available for the minor or child and to which facility the minor or child should be sent if the juvenile court should determine that the minor or child is to be committed. The minor or child shall not be accepted if the facility does not have adequate facilities available or if acceptance of the minor or child would result in an overcrowded condition.