Toroidal bubbles with circulation in ideal hydrodynamics. A variational approach