Generalization of the effective index design approach to the diffracting surface relief photonic structures