function showstats (e,i,xoffset) {
	var o = document.getElementById(i);
	var y = 0;
	var maxW = 600;
	var maxH = 800;
	
	if (document.all) {
		y = event.clientY + document.body.scrollTop + 30;
		x = event.clientX + document.body.scrollLeft + 10;
	} else {
		y = e.pageY + 30;
		x = e.pageX + 10;
	}
	o.style.position="absolute";
	o.style.top = y + "px";
	o.style.left = x + "px";
	o.style.display = "block";
	w = o.offsetWidth - 8; // without the -8, the div grows wider after every mouseover. strange.
	o.style.width = w;
	h = o.offsetHeight - 8;
	L = h + y + 115;
	WH = x + w;
	/*
	if (L > maxH) {
		o.style.top = 0 + "px";
	}
	*/
	if (WH > maxW) {
		deltaW = (WH-maxW);
		o.style.left = deltaW + "px";
	}
	
	
	
	//alert("x:" + x + " Y:" + y + " W:" + w + " H:" + h + " WH:" + WH);
}

function clearstats (i) {
	var o = document.getElementById(i);
	o.style.display = 'none';
}

function togglevis (o) {
	if (o == "inv0") {
		return;
	}
	if (document.getElementById(o).style.display == "none") {
		document.getElementById(o).style.display = "block";
		document.getElementById(o).style.visibility = "visible";
		return;
	}
	if (document.getElementById(o).style.display == "block") {
		document.getElementById(o).style.display = "none";
		document.getElementById(o).style.visibility = "hidden";
		return;
	}
	if (document.getElementById(o).style.display == "") {
		document.getElementById(o).style.display = "none";
		document.getElementById(o).style.visibility = "hidden";
		return;
	}
}
