
function show_tooltip_posX(obj) {
	/*
	// find object posX
	*/
	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 show_tooltip_posY(obj) {
	/*
	// find object posY
	*/
	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 show_tooltip(imgId, parentId, posX, posY) {
	/*
	// display tooltip for imgId offset(posX,posY) from parentId
	*/
	it = document.getElementById(imgId);
	if ((it.style.top == '' || it.style.top == 0) && (it.style.left == '' || it.style.left == 0)) {
		/*
		//fixate default size (MSIE problem)
		*/
		it.style.width = it.offsetWidth + 'px';
		it.style.height = it.offsetHeight + 'px';

		/*
		// offset display from original
		*/
		img = document.getElementById(parentId);
		x = show_tooltip_posX(img) + posX;
		y = show_tooltip_posY(img) + posY;

		it.style.top = y + 'px';
		it.style.left = x + 'px';
		
	}
	it.style.visibility = 'visible'; 
}

function hide_tooltip(imgId) {
	/*
	// hide tooltip for imgId
	*/
	it = document.getElementById(imgId); 
	it.style.visibility = 'hidden'; 
}
