Detonation In Spatially Inhomogeneous Media