Magnetoresistance of layered structures with alternating in-plane and perpendicular anisotropies