  The averaging method is a classical powerful tool in perturbation theory of
dynamical systems. There are two major obstacles to applying the averaging
method, resonances and separatrices. In this paper we obtain realistic
asymptotic estimates that justify the use of averaging method in a generic
situation where both these obstacles are present at the same time, passage
through a separatrix for time-periodic perturbations of one-frequency
Hamiltonian systems. As a general phenomenon, resonances accumulate at
separatrices. The Hamiltonian depends on a parameter that slowly changes for
the perturbed system (so slow-fast Hamiltonian systems with two and a half
degrees of freedom are included in our class). Our results can also be applied
to perturbations of generic two-frequency integrable systems near separatrices,
as they can be reduced to periodic perturbations of one-frequency systems.
