Orthogonal photoswitching in a multifunctional molecular system