Ab initio molecular orbital calculations of the ground and excited states of the permanganate and chromate ions