tooltip = null;

function showTooltip(text, element) {
    if (text != null && text != '') {
        try {
            tooltip = $get('tooltipSprechblase');
            tooltip.style.display = 'block';
            $get('tooltipSprechblaseTeil1').innerHTML = text;
            tooltipPosition = position;
        } catch (e) { }

        tooltip.style.left = (findPosX(element) + element.offsetWidth - 30) + 'px';
        tooltip.style.top = (findPosY(element) + (element.offsetHeight / 2) - 80) + 'px';
    }
}


function hideTooltip() {
    if (tooltip != null) tooltip.style.display = 'none';
}


function findPosX(obj) {
    var curleft = 0;
    if (obj.offsetParent)
        while (1) {
        curleft += obj.offsetLeft;
        if (!obj.offsetParent)
            break;
        obj = obj.offsetParent;
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function findPosY(obj) {
    var curtop = 0;
    if (obj.offsetParent)
        while (1) {
        curtop += obj.offsetTop;
        if (!obj.offsetParent)
            break;
        obj = obj.offsetParent;
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}