var shown = "";
var imgPath = "http://mit.edu/rsa/dontindex/sfs/images/";
var posX, posY, placeX, placeY;
var boxObj;
var line = 450;

function hilite (areaName) {
	hide();
	var boxObj = document.getElementById(areaName);
	boxObj.className = "sel";
	posX = findPosX (boxObj);
	posY = findPosY (boxObj);

	placeX = posX - 205;
	placeY = posY + 10;

	boxObj = document.getElementById(areaName + "P");			
	
	boxObj.style.display = "block";
	boxObj.style.left = placeX + "px";
	boxObj.style.top = placeY + "px";
	shown = areaName;
}

function hide () {
	if (shown) {
		var boxObj = document.getElementById(shown);
		boxObj.className = "unsel";
		boxObj = document.getElementById(shown + "P");
		boxObj.style.display = "none";
		shown = null;
	}
}

function findPosX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
		while(1) 
		{
		  curleft += obj.offsetLeft;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
		  curtop += obj.offsetTop;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
}



/*
function hilite (areaName) {
	var boxObj = document.getElementById(areaName);
	boxObj.className = "sel";
}

function unhilite (areaName) {
	var boxObj = document.getElementById(areaName);
	boxObj.className = "unsel";
}

*/