//-----------------------------------
// positions.js ver.040901
//-----------------------------------
function RB(right, bottom)
{
	this.right = right;
	this.bottom = bottom;
}
//-----------------------------------
function getRightAndBottom(container, right, bottom)
{
	if (!container){
		return null;
	}
	var ar = container.all;	
	var maxbottom = 0, maxright = 0;
	var currel, currheight, currright;	
	for (var i=0 ; i < ar.length; i++)
	{
		currel = ar[i];
		if (currel.style.display == "none")
			continue;
		currheight = currel.offsetTop + currel.clientHeight;
		if ( currheight > maxbottom)
			maxbottom = currheight;
		currright = currel.clientWidth + currel.offsetLeft;
		if ( currright > maxright)
			maxright = currright;	
	}	
	return new RB(maxright, maxbottom);
}
//-----------------------------------
function getLeft(obj)
{
	var left = obj.offsetLeft;
	var parentobj = obj;
	while (parentobj = parentobj.offsetParent)
	{
		left += parentobj.offsetLeft;
	}
	return left;
}
//-----------------------------------
function getTop(obj)
{
	var top = obj.offsetTop;
	var parentobj = obj;
	while (parentobj = parentobj.offsetParent)
	{
		top += parentobj.offsetTop;
	}
	return top;
}
//-----------------------------------
function getHeight(obj)
{
	var top = getTop(obj);
	var right, bottom;
	var rb = getRightAndBottom(obj, right, bottom);
	return (rb.bottom);
}