i don't know the exact coding or if its even possible, but i'm gueesing you could code all of your layers into a string like this:
var layers
layers = ';layer1;layer2;layer3;layer4;'
then do a count for each bit of text between the ;'s soemthing like (here is where the code IS wrong, but you get the gist)
var countoflayers
countoflayers = count(';',';')
then do a loop a number of times equal to countoflayers where you sub in the part between the ;'s for the layer name in the code i wrote above.
don't know if that is possible, probably easier (more likely to be doable) in asp, which is where i spend most of my time...
alternately you could just do this:
getallxindex(layername,startindex,endindex){
var tempindex
tempindex = document.layername.zIndex
if startindex < tempindex < endindex{
//do the visibilty change thingy
}
}
and call that function for each layer... maybe make it quicker to type in by hardcoding the startindex and endindex where possible...
either that or i could stop pretending i know what i'm talking about...

