The chameleon-like properties of magnesium in commercial glass