Matching of separatrix map and resonant dynamics, with application to global chaos onset between separatrices