var Mozilla = document.getElementById && !document.all;
var Microsoft = document.all;
var infoBoxIsOn = false;
var xOffset = 5;
var yOffset = -30;

if (Microsoft || Mozilla)
    var InfoBox = document.all ? document.all["infoBox"] : document.getElementById ? document.getElementById("infoBox") : ""

function documentBody()
{
    return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
}

function infoBoxOn(text)
{
    if (Mozilla || Microsoft)
    {
        InfoBox.innerHTML = "<table border='0' bgcolor='#ffea96'><tr><td>" + text + "</td></tr></table>";
        infoBoxIsOn = true;
        InfoBox.style.visibility = "visible";
    }
}

function auswahl(text1, text2)
{
    var buf = text1;
    
    if (text2)
        buf = text2;
        
    return umlaut2html(buf);
}

function imageBoxOn(aPath, image, text)
{
    if (Mozilla || Microsoft)
    {
        InfoBox.innerHTML = "<img src=\"" + aPath + image + ".gif\" border=\"0\" alt=\"" + auswahl(image, text) + "\"><br><center><b>" + auswahl(image, text) + "</b></center>";
        infoBoxIsOn = true;
        InfoBox.style.visibility = "visible";
    }
}

function infoBoxOff()
{
    if (Mozilla || Microsoft)
    {
        infoBoxIsOn = false;
        InfoBox.style.visibility = "hidden";
    }
}

function moveInfoBox(e)
{
    if (infoBoxIsOn)
    {
        var xPos = (Mozilla) ? e.pageX : event.x + documentBody().scrollLeft;
        var yPos = (Mozilla) ? e.pageY : event.y + documentBody().scrollTop;
        InfoBox.style.left = xPos + xOffset + "px";
        InfoBox.style.top = yPos + yOffset + "px";
        InfoBox.style.visibility = "visible";
    }
}

document.onmousemove = moveInfoBox;

