Periodic orbits of the generalized Friedmann-Robertson-Walker Hamiltonian systems