INTERGALACTIC PHOTON SPECTRA FROM THE FAR IR TO THE UV LYMAN LIMIT FOR 0 < Z < 6 AND THE OPTICAL DEPTH OF THE UNIVERSE TO HIGH ENERGY GAMMA-RAYS