NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;
expanded = false;

if (ver4) {
	with (document) {
		write("<STYLE TYPE='text/css'>");
		if (NS4) {
			write(".parent {position:absolute; visibility:visible}");
			write(".child {position:absolute; visibility:hidden}");
			write(".regular {position:absolute; visibility:visible}")
		}
		else {
			write(".child {display: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 arrange() {
        firstEl = "elOneParent";
        firstInd = getIndex(firstEl);
        restEl = "elRest";
        restInd = getIndex(restEl);
        realbodyEl = "elRealBody";
        realbodyInd = getIndex(realbodyEl);

        nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
        for (i=firstInd+1; i<=restInd; i++) {
                whichEl = document.layers[i];
                if (whichEl.visibility != "hide") {
                        whichEl.pageY = nextY;
                        nextY += whichEl.document.height;
                }
        }
        restHeight = document.layers[realbodyInd].pageY + document.layers[realbodyInd].document.height - whichEl.pageY;
        if (restHeight < 25) { restHeight = 25; }
        whichEl.resizeTo(whichEl.document.width, restHeight);
}

function expandIt(el) {
        if (!ver4) return;
        if (IE4) {
                whichEl = eval(el + "Child");
                whichIm = event.srcElement;
                if (whichEl.style.display == "none") {
                        whichEl.style.display = "block";
                }
                else {
                        whichEl.style.display = "none";
                }
        }
        else {
                whichEl = eval("document." + el + "Child");
                whichIm = eval("document." + el + "Parent.document.images['imEx']");
                if (whichEl.visibility == "hide") {
                        whichEl.visibility = "show";
                }
                else {
                        whichEl.visibility = "hide";
                }
                arrange();
        }
}

function init(which1, which2){
 if (document.layers){
   expandIt('elOne');
   expandIt('elTwo');
 }
 else {
   if (which1 == 1) elOneChild.style.display = "block";
   else elOneChild.style.display = "none";
   if (which2 == 1) elTwoChild.style.display = "block";
   else elTwoChild.style.display = "none";
 }
}
