Kinetics of precipitation of surfactants. I. Anionic surfactants with calcium and with cationic surfactants