Nothing in this Act prevents the county board of any county maintaining a county shelter care or detention home from making a binding agreement with the county board of any other county to accept and place in its shelter care or detention home any minor in need of shelter care or detention from that other county after the needs of the county maintaining the home have been met. Such agreements may run for any period of time and upon such terms of defraying the costs of shelter care or detention as the respective county boards may conclude. Such counties maintaining a county shelter care or detention home may also make agreements for any term of years and upon such terms as they may conclude with the authorities of any city government within the county or any other unit of government to share facilities for shelter care or detention, psychiatric and psychological testing and rehabilitative services related to shelter care or detention, together with space for the administration of juvenile services which fall within the powers of any participating governmental unit.
55 ILCS 75/9