The construction, acquisition and maintenance of juvenile detention facilities for dependent, wayward and delinquent children, separate and apart from the detention facilities for adults, is hereby declared to be a mandatory function of the several counties of the state.[ 1945 c 188 s 2; Rem. Supp. 1945 s 2004-2.]