(1) Whenever a juvenile or juvenile offender is placed by the court in custody other than that of his or her parents or custodian, after due notice to the parent or other persons legally obligated to care for and support the juvenile or juvenile offender, and after a hearing, the court may order and decree that the parent or other legally obligated person shall pay in such a manner as the court may direct a reasonable sum that will cover in whole or in part the support and treatment of the juvenile or juvenile offender. If the parent or other legally obligated person willfully fails or refuses to pay such sum, the court may proceed against him for contempt, or the order may be filed and shall have the effect of a civil judgment.
(2)  If the juvenile or juvenile offender is detained, the court may order that the parents of the juvenile or juvenile offender or other legally obligated person contribute to the costs of detention in an amount to be set by the court. The order may be filed and shall have the effect of a civil judgment. It is the intent of the legislature that foster parents or a parent or legal guardian receiving public assistance relating to that juvenile or juvenile offender should not benefit from the continued receipt of payments or public assistance from any state or federal agency while the juvenile or juvenile offender is detained. The department of health and welfare is directed to promulgate a rule implementing this intent.