  We have analyzed numerically the localization length of light $\xi$ for
nearly periodic arrangements of homogeneous stacks (formed exclusively by
right-handed materials) and mixed stacks (with alternating right and
left-handed metamaterials). Layers with index of refraction $n_1$ and thickness
$L_1$ alternate with layers of index of refraction $n_2$ and thickness $L_2$.
Positional disorder has been considered by shifting randomly the positions of
the layer boundaries with respect to periodic values. For homogeneous stacks,
we have shown that the localization length is modulated by the corresponding
bands and that $\xi$ is enhanced at the center of each allowed band. In the
limit of long-wavelengths $\lambda$, the parabolic behavior previously found in
purely disordered systems is recovered, whereas for $\lambda \ll L_1 + L_2$ a
saturation is reached. In the case of nearly periodic mixed stacks with the
condition $|n_1 L_1|=|n_2 L_2|$, instead of bands there is a periodic
arrangement of Lorenztian resonances, which again reflects itself in the
behavior of the localization length. For wavelengths of several orders of
magnitude greater than $L_1 + L_2$, the localization length $\xi$ depends
linearly on $\lambda$ with a slope inversely proportional to the modulus of the
reflection amplitude between alternating layers. When the condition $|n_1
L_1|=|n_2 L_2|$ is no longer satisfied, the transmission spectrum is very
irregular and this considerably affects the localization length.
