Electronic structures and ferromagnetism of Cu- and Mn-doped ZnO