  We develop variation formulas on almost-product (e.g. foliated)
pseudo-Riemannian manifolds, and we consider variations of metric preserving
orthogonality of the distributions. These formulae are applied to
Einstein-Hilbert type actions: the total mixed scalar curvature and the total
extrinsic scalar curvature of a distribution. The obtained Euler-Lagrange
equations admit a number of solutions, e.g., twisted products, conformal
submersions and isoparametric foliations. The paper generalizes recent results
about the actions on codimension-one foliations for the case of arbitrary
(co)dimension.
