Complete potential energy curves for excited states of chlorine and bromine