An extension of the Csörgo-Horva´th functional limit theorem and its applications to changepoint problems