Electronic and optical properties of ternary alloys ZnxCd1−xS, ZnxCd1−xSe, ZnSxSe1−x, MgxZn1xSe