Scattering of seismic waves by cracks in multi-layered geological regions: I. Mechanical model