Theoretical study of Cr(+) and Co(+) bound to H2 and N2