Theory of electric currents in ionospheric E-layers