Virial properties of groups of galaxies