function xstooltip_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 xstooltip_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 xstooltip_show(tooltipId, containertooltipId, posX, posY)
{
    it = document.getElementById(tooltipId);
    tdit = document.getElementById(containertooltipId);

    if ((it.style.top == '' || it.style.top == 0) 
        && (it.style.left == '' || it.style.left == 0))
    {   
		it.style.top = it.offsetTop + posY + 'px';
		it.style.width = tdit.offsetWidth;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {		// IE
			it.style.width = tdit.offsetWidth + posX;
		}
		else {																		// others navigators
			it.style.width = tdit.offsetWidth - 15 + posX;
		}
	
	}
	    
    it.style.visibility = 'visible';
    
}

function xstooltip_hide(id)
{
    it = document.getElementById(id);
    if (it!=null)  it.style.visibility = 'hidden'; 
}