All costs and expenses necessary to reasonably carry out the provisions of this article, touching the care, custody, detention, and treatment of persons coming within the purview of its provisions, shall be a general charge against the municipalities or counties, as the case may be, unless special arrangements have been made to defray such expenses. Where conditions and locations are such that more economical results may be secured, one or more municipalities, or counties and municipalities, may join together and establish one or more places for treatment and detention, as may be arranged by the several parties concerned, and to be supported upon a basis to be determined between them, and when this agreement has been made a matter of record by each party thereto, funds may be levied and expended by the several parties in pursuance of such agreement.
W. Va. Code § 16-4-23