The Gravitational-Electromagnetic Analogy: A Possible Solution to the Vacuum-Energy and Dark-Energy Problems