Surface waves in an inhomogeneous elastic medium under the influence of gravity