  Destruction of the vortex lattice by random point pinning is considered as a
mechanism of the ``second peak'' transition observed experimentally in weakly
coupled layered high temperature superconductors. The transition field
separating the topologically ordered quasilattice from the amorphous vortex
configuration is strongly influenced by the layered structure and by the
nonlocal nature of the vortex tilt energy due to the magnetic interlayer
coupling. We found three different regimes of transition depending on the
relative strength of the Josephson and magnetic couplings. The regimes can be
distinguished by the dependence of the transition field
