2. Party walls are generally regulated by acts of the local legislatures. The principles of these acts generally are, that the wall shall be built equally on the lands of the adjoining owners, at their joint expense, but when only one owner wishes to use such wall, it is built at his expense, and when the other wishes to make use of it, he pays one half of its value; each owner has a right to place his joists in it, and use it for the support of his roof. When the party wall has been built, and the adjoining owner is desirous of having a deeper foundation, he has a right to undermine such wall, using due care and diligence to prevent any injury to his neighbor, and having done so, he is not answerable for any consequential damages which may ensue. 17 Jobn. R. 92; 12 Mass. 220; 2 N. H. Rep. 534. Vide 1 Dall. 346; 5 S . & R. 1.
3. When such wall exists between two buildings, belonging to different persons, and one of them takes it down with his buildings, he is required to erect another in its place in a reasonable time, and with the least inconvenience; the other owner must contribute to the expense, if the wall required repairs, but such expense will be limited to the costs of the old wall. 3 Kent, Com. 436. When the wall is taken down, it must be done with care; but it is not the duty of the person taking it down to shore up or prop the.,house of his neighbor, to prevent it from falling; if, however, the work be done with negligence, by which injury accrues to the neighboring house, an action will lie. 1 Moody & M. 362. Vide 4 C. & P. 161; 9 B. & C. 725; 12 Mass. R. 220; 4 Paige's R. 169; 1 C. & J. 20; 1 Pick. 434; 12 Mass. 220; 2 Roll., Ab. 564; 3 B. & Ad. 874; 2 Ad. &-Ell. 493 Crabb on R. P. §500. In the excellent treatise of M. Lepage, entitled "Lois des Batimens," part 1, c. 3, s. 2, art. l, will be found a very minute examination of the subject of party walls, with many cases well calculated to illustrate our law. See also Poth. Contr. de Societe, prem. app. n. 207; 2 Hill.: Ab. 119; Toull. liv. 2, t. 2, c. 3.