
function HideContent(d)
{
    document.getElementById(d).style.display = "none";
    if (document.getElementById)
    {
        document.getElementById(d).style.display = "none";
    }
    else
    {
        if (document.layers)
        {
            document.d.display= "none";
        }
        else
        {
            document.all.d.style.display = "none";
        }
    }
}


function ShowContent(d)
{
    if (document.getElementById)
    {
        document.getElementById(d).style.display = "block";
    }
    else
    {
        if (document.layers)
        {
            document.d.display= "block";
        }
        else
        {
            document.all.d.style.display = "block";
        }
    }
}

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;
}

function showtooltip(picture, id)
{
    //alert(findPosX(picture)+' '+findPosY(picture));
    var tooltipPosX = findPosX(picture) + 220;
    var tooltipPosY = findPosY(picture);
    //alert(tooltipPosX);
    $("#tooltip"+id).css({"left": tooltipPosX + "px", "top": tooltipPosY + "px"});
    //document.getElementById('tooltip'+id).style.top = tooltipPosY;
    //document.getElementById('tooltip'+id).style.left = tooltipPosX;
    //document.getElementById('tooltip'+id).style.bordercolor = 'red';
    ShowContent('tooltip'+id);
}

function hidetooltip(picture, id)
{
    HideContent('tooltip'+id);
}


