function get_element_loc(obj)
{
	var xx=0, yy=0, ww=0, hh=0, obj1;
	obj1 = obj;
	if(obj1)
	{
		do
		{
			xx += parseInt(obj1.offsetLeft, 10);
			yy += parseInt(obj1.offsetTop, 10);
			obj1 = obj1.offsetParent;
			if(!obj1)
				break;
		}while(obj1.tagName != "body");
		ww = obj.width? obj.width:obj.style.width;
		hh = obj.height? obj.height:obj.style.height;
	}
	return {x:xx, y:yy, w:ww, h:hh};
}

function element_move(obj, obj1, x, y)
{
	var objPos = get_element_loc(obj1);
	obj.style.left = objPos.x + x - parseInt(obj.style.width, 10);
	obj.style.top = objPos.y + y - parseInt(obj.style.height, 10);
}

function remove_element(obj)
{
	while(obj.children.length)
	{
		remove_element(obj.lastChild);
		obj.removeChild(obj.lastChild);
	}
}
