Friction model for heavy-ion collisions and its application to heavy ion fusion and deep inelastic reactions