Surface acoustic waves in inhomogeneous media