On the theory of superconducting intercalated layer compounds