Until judgment is given on a petition, the judge before whom any party may be brought on the petition may:
1. Commit the party to the custody of the sheriff of the county; or
2. Place the party in such care or under such custody as the party’s age or circumstances may require.