function calculate_positions (what) {
	if (what==null) return new Array(0,0);
	var left_position = 0;
	var top_position = 0;
	var node = what;
	while (node.nodeName != 'HTML') {
		if (node.nodeName != 'TBODY') {
			if (node.nodeName != 'TD') {
				top_position += node.offsetTop;
			}
			if (node.nodeName != 'TR') {
				left_position += node.offsetLeft;
			}
		}
		node = node.parentNode;
	}
	var right_position = left_position + what.offsetWidth;
	var bottom_position = top_position + what.offsetHeight;
	return new Array(left_position,top_position,right_position,bottom_position);
}

