Cohomology of symplectomorphism groups and critical values of hamiltonians