var bV=parseInt(navigator.appVersion);
NS4=(document.layers)?true:false;
IE4=(document.all)?true:false;
ver4=(NS4 || IE4)?true: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(".parent {cursor:arrow}");
		}
		write("</STYLE>");
	}
}

function initIt(){
	if (!ver4) return;
	if (NS4) {
		for (i=0; 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 getIndex(el) {
	if(NS4) {
		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() {
	if(NS4) {
		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 expandIt(el) {
	if(!ver4) return;
	if (IE4) {expandIE(el)} else {expandNS(el)}
}

function expandIE(el) { 
	whichEl=eval(el + "Child");
	for (i=0; i<divColl.length; i++) {
		forEl = divColl(i);
		if(forEl.className == "child") {			
			if(forEl.id == whichEl.id) {
				if(forEl.style.display=="none") {
					forEl.style.display="block";
				}
				else {
					forEl.style.display="none";
				}
			}
			else {
				forEl.style.display="none";
			}
		}
	}
}

function expandNS(el) {
	whichEl=eval("document." + el + "Child");
	for (i=0; i<document.layers.length; i++) {
		forEl = document.layers[i];
		if (forEl.id.indexOf("Child") != -1) {
			if(forEl.id == whichEl.id) {
				if(forEl.visibility=="hide") {
					forEl.visibility="show";
				}
				else {
					forEl.visibility="hide"	
				}
			}
			else {
				forEl.visibility="hide"
			}
		}
	}
	arrange();
}

function ReloadNav(el) {
	if(!ver4) {
		var NewLoc = '';
		NewLocIndex = self.location.href.indexOf('?');
		if(NewLocIndex == -1) {
			NewLoc = self.location.href;
		}
		else {
			NewLoc = '';
			for(i=0;i<NewLocIndex;i++) {
				NewLoc += self.location.href.charAt(i);
			}
		}
		self.location.href = NewLoc + "?el=" + el;
	}
	else {
		expandIt("el"+el);
	}
	// --  This is where we will redirect the main frame
}

window.onload=initIt;
