function findPosX( obj ) {
	var curleft = 0;

	if( obj.offsetParent ) {
		while( obj.offsetParent ) {
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	} else if( obj.x ) {
		curleft += obj.x;
	}

	return curleft;
}

function findPosY( obj ) {
	var curtop = 0;

	if( obj.offsetParent ) {
		while( obj.offsetParent ) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	} else if( obj.y ) {
		curtop += obj.y;
	}

	return curtop;
}

function showMenu( parent, child ) {
	var parentX		= findPosX( parent );
	var parentY		= findPosY( parent );
	if( document.getElementById( child ) ) {
		var childRef	= document.getElementById( child );
	
		if( childRef ) {
			childRef.style.left			= parentX;
			childRef.style.top			= parentY + 15;
			childRef.style.visibility	= 'visible';
		}
	}
}

function keepMenu( child ) {
	child.style.visibility	= 'visible';
}

function hideMenu( child ) {
	child.style.visibility	= 'hidden';
}
