// JavaScript Document
function showElem(toShowId,parentId) {
	var elemToShow = document.getElementById(toShowId);	
	var position = findPos(parentId);
	var offsetTop, offsetLeft, toShowWidth, toShowHeight;
	
	offsetTop = 54;
	offsetLeft = 0;
	if(toShowId == 'attorney-submenu') {
		toShowWidth = 138;
		toShowHeight = 140;
	} else if(toShowId == 'practices-submenu') {
		toShowWidth = 171;
		toShowHeight = 105;
	} else {
		toShowWidth = 150;
		toShowHeight = 150;
	}

	elemToShow.style.visibility = 'visible';
	elemToShow.style.height = toShowHeight + 'px';
	elemToShow.style.width = toShowWidth + 'px';
	elemToShow.style.display = 'block';
	elemToShow.style.top = position[1] + offsetTop + 'px';
	elemToShow.style.left = position[0] + offsetLeft + 'px';
	elemToShow.style.zIndex = 99;
}
function hideElem(toHideId) {
	var elemToHide = document.getElementById(toHideId);	
	elemToHide.style.visibility = 'hidden';
	elemToHide.style.height = 0 + 'px';
	elemToHide.style.width = 0 + 'px';
	elemToHide.style.display = 'none';	
}
function findPos(elemId) {
	var obj = document.getElementById(elemId);
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	return [curleft,curtop];
	}
}
function hideAllElems() {
	hideElem('attorney-submenu');
	hideElem('practices-submenu');
}