Bifurcation of periodic orbits of nonpositive definite Hamiltonian systems