Pendulum theory of quake protection