Statistical mechanics of dense granular media