3d texturing

Hi
I just wanted to know how to do a gradient mapping.
I mean I have for example 3 textures that I combine in function of the height of the map.
For example sand at the bottom, rock in the middle and snow at the top.

Thanks