(a) Following the filing of a juvenile petition, unless a preliminary hearing has previously been held in conjunction with a detention hearing with respect to the same charge contained in the petition, the circuit court or referee shall hold a preliminary hearing. In the event that the juvenile is being detained, the hearing shall be held within ten days of the time the juvenile is placed in detention unless good cause is shown for a continuance. If no preliminary hearing is held within ten days of the time the juvenile is placed in detention, the juvenile shall be released on recognizance unless the hearing has been continued for good cause. If the judge is in another county in the circuit, the hearing may be conducted in that other county. The preliminary hearing may be waived by the juvenile, upon advice of counsel. At the hearing, the court or referee shall:
(1) If the juvenile is not represented by counsel, inform the juvenile and his or her parents, guardian or custodian or any other person standing in loco parentis to him or her of the juvenile's right to be represented at all stages of proceedings under this article and the right to have counsel appointed;
(2) Appoint counsel by order entered of record, if counsel has not already been retained, appointed or knowingly waived;
(3) Determine after hearing if there is probable cause to believe that the juvenile is a status offender or a juvenile delinquent. If probable cause is not found, the juvenile, if in detention, shall be released and the proceedings dismissed. If probable cause is found, the case shall proceed to adjudication. At this hearing or as soon thereafter as is practicable, the date for the adjudicatory hearing shall be set to give the juvenile and the juvenile's parents and attorney at least ten days' notice unless notice is waived by all parties;
(4) In lieu of placing the juvenile in a detention facility, the court may place the juvenile in the temporary legal and/or physical custody of the department. If the juvenile is detained, the detention may not continue longer than thirty days without commencement of the adjudicatory hearing unless good cause for a continuance is shown by either party or, if a jury trial is demanded, no longer than the next regular term of the court: Provided, That a juvenile who is alleged to be a status offender may not be placed in a secure detention facility; and
(5) Inform the juvenile of the right to demand a jury trial.
(b) The juvenile may move to be allowed an improvement period for a period not to exceed one year. If the court is satisfied that the best interest of the juvenile is likely to be served by an improvement period, the court may delay the adjudicatory hearing and allow an improvement period upon terms calculated to serve the rehabilitative needs of the juvenile. At the conclusion of the improvement period, the court shall dismiss the proceeding if the terms have been fulfilled; otherwise, the court shall proceed to the adjudicatory stage. A motion for an improvement period may not be construed as an admission or be used as evidence. Improvement periods authorized by this subsection may be, in the court's discretion, either custodial or noncustodial.