function litmenu() {
	if (skip && skip != "") {
		document.getElementById("xpand"+skip).className = "menuon";
	}
}

function swapbg(o) {
	//o.className = o.className!="menuoff"?"menuoff":"menuon";
	if(navigator.appName.indexOf("Netscape")!=-1) {o.style.cursor='pointer';};
	if (o.id == "xpand"+skip)
		return;
	o.className = "menuon";
}
function setcolor(o) {
	if(navigator.appName.indexOf("Netscape")!=-1) {o.style.cursor='pointer';}
	o.style.filter = o.style.filter == "alpha(opacity=100);" || o.style.filter == ""?"alpha(opacity=60);":"alpha(opacity=100);";
}

function lit(o) {if(navigator.appName.indexOf("Netscape")!=-1) {o.style.cursor='pointer';};o.style.fontWeight = "bold";}

function unlit(o) {o.style.fontWeight = "normal";}

var axisX, axisY;
var cols = new Array();
var reverse = false;

currentcol = "";
cols[0] = 0;
cols[1] = 0;
cols[2] = 0;
cols[3] = 0;
cols[4] = 0;

function xcheckposition () {return;}
function tracekeeper(colnum,singlecolheight) {
	cols[colnum] = singlecolheight;
	var cumulativeheight = 0;
	if (!reverse) {
		for (var j=2; j<=colnum; j++) {
			cumulativeheight += (1*cols[j])-1;
		}
	}
	else if(reverse) {
		for (var j=2; j>=colnum; j--) {
			cumulativeheight += (1*cols[j])-1;
		}
	}
	return cumulativeheight;
}

function checkposition(o,layer,col) {
	hideall('layer1');hideall('layer2');hideall('layer3');hideall('layer4');
	document.getElementById("xpand"+layer).className = "menuon";
	currentcol = col.substring(0,4);

	reverse = !(currentcol=="cola" || currentcol=="colb");

	var somemore = reverse?(layer.substring(5)-3)*195:(layer.substring(5)-1)*195;

	axisX = o.parentNode.parentNode.parentNode.offsetLeft+somemore;
	axisY = o.parentNode.parentNode.parentNode.parentNode.offsetTop;

	var actuallayer = document.getElementById(layer);
	display(col,'indent_'+col.substring(3,4),false);
	actuallayer.style.left = axisX-20;
	actuallayer.style.top = 1*axisY-20;
	actuallayer.style.display="";
}

function hide(col) {
	if(!reverse) {
		for(var i=col.substring(4); i<=3; i++) {
			document.getElementById(currentcol+i).style.visibility="hidden";
		}
	}
	else if (reverse) {
		for(var i=col.substring(4); i>0; i--) {
			document.getElementById(currentcol+i).style.visibility="hidden";
		}
	}
}

function hideall(lyr) {
	document.getElementById(lyr).style.display="none";
	if (skip != lyr) {document.getElementById("xpand"+lyr).className = "menuoff";}
	if (currentcol!="") {
		for (var i=1; i<4; i++) {
			hide(currentcol+i);
		}
	}
}


function display(col,lyr,pad) {
	document.getElementById(col).style.visibility = "visible";
	if (pad) {
		var height = tracekeeper(col.substring(4),pad);
		document.getElementById(col+"_0").style.height = 1*height*30;
	}
	document.getElementById(col+"group").innerHTML = document.getElementById(lyr).innerHTML;
}

function manina(o) {
	o.style.cursor = navigator.appName.indexOf("Netscape")!=-1?'pointer':'hand';
}
