if(document.all) {
IE = true;
} else {
IE = false;
}

if(document.layers){
NS = true;
} else {
NS = false;
}

if (NS) {
 origWidth = innerWidth;
 origHeight = innerHeight;
}

if (IE || NS) {
    with (document) {
        write("<STYLE TYPE='text/css'>");
        if (NS) {
            write(".parent {position:absolute; visibility:hidden}");
            write(".child {position:absolute; visibility:hidden}");
            write(".regular {position:absolute; visibility:hidden}")
            write("A {text-decoration: none}")
        }
        else {
            write(".child {display:none}")
            write("A {text-decoration: none}")

        }
        write("</STYLE>");
    }
}

function getIndex(el) {
 ind = null;
 for (i=0; i<document.layers.length; i++) {
  whichEl = document.layers[i];
  if (whichEl.id == el) {
   ind = i;
   break;
  }
 }
 return ind;
}

function showAll() {
 for (i=firstInd; i<document.layers.length; i++) {
  whichEl = document.layers[i];
  whichEl.visibility = "show";
 }
}

function arrange() {
 nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
 for (i=firstInd+1; i<document.layers.length; i++) {
  whichEl = document.layers[i];
  if (whichEl.visibility != "hide") {
   whichEl.pageY = nextY;
   nextY += whichEl.document.height;
  }
 }
}

function initIt(){
    if (!(IE || NS)) return;
    if (NS) {
        for (i=firstInd+1; i<document.layers.length; i++) {
            whichEl = document.layers[i];
            if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
        }
        arrange();
    }
    else {
        divColl = document.all.tags("DIV");
        for (i=0; i<divColl.length; i++) {
            whichEl = divColl(i);
            if (whichEl.className == "child") whichEl.style.display = "none";
        }
    }
}

function expandIt(el,j) {
    if (!(IE || NS)) return;
    if (IE) {
        whichEl = eval(el + "Child");
        whichIm = document.images[j+1];
        if (whichEl.style.display == "none") {
            whichEl.style.display = "block";        
        }
        else {
            whichEl.style.display = "none";
        }
    }

    if (NS) {
        whichEl = eval("document." + el + "Child");
        whichIm = eval("document." + el + "Parent.document.images['imEx']");
        if (whichEl.visibility == "hide") {
            whichEl.visibility = "show";
            whichIm.src = "triUp.gif";
        }
        else {
            whichEl.visibility = "hide";
            whichIm.src = "triDown.gif";
        }
        arrange();
    }
}


function reDo() {
 if (innerWidth != origWidth || innerHeight != origHeight) {
 origWidth = innerWidth;
 origHeight = innerHeight;
 document.location.reload();
 }
}

onload = initIt;

if (NS) onresize = reDo;