//--------------------------------------------------
// zobrazení doprovodného textu k určitému elementu
//--------------------------------------------------

document.write("<div id='ElementDetail'></div>");

var obj;
function ShowElementDetail(e,text)
{
    obj = document.getElementById("ElementDetail");

    data = "<div align=left style=\"margin:5px;\">"+text+"</div>";

    info = document.getElementById("ElementDetail");
    info.innerHTML = data;
    
    obj.style.visibility = 'visible';
    
    
    if(document.documentElement.clientHeight > (e.clientY + obj.offsetHeight))
    {
        obj.style.top  = e.clientY + "px";
        obj.style.bottom = "auto";
    }
    else
    {
        obj.style.top  = "auto"
        obj.style.bottom = "0px";
    }
    
    

    if(document.documentElement.clientWidth > (e.clientX + obj.offsetWidth + 15))
    {
        obj.style.left = e.clientX + 15 + "px";
    }
    else
    {
        obj.style.left = (e.clientX - 15 - obj.offsetWidth) + "px";
    }


}

function RefreshElementDetail(e)
{
    obj = document.getElementById("ElementDetail");
    
    if(document.documentElement.clientHeight > (e.clientY + obj.offsetHeight))
    {
        obj.style.top  = e.clientY + "px";
        obj.style.bottom = "auto";
    }
    else
    {
        obj.style.top  = "auto"
        obj.style.bottom = "0px";
    }



    if(document.documentElement.clientWidth > (e.clientX + obj.offsetWidth + 15))
    {
        obj.style.left = e.clientX + 15 + "px";
    }
    else
    {
        obj.style.left = (e.clientX - 15 - obj.offsetWidth) + "px";
    }
}

function HideElementDetail()
{
    obj.style.visibility = 'hidden';
}


//--------------------------------------------------
// zobrazení a skrytí určitého elementu
//--------------------------------------------------
function ShowHide(element)
{
    if(document.getElementById(element).style.display == "none")
        document.getElementById(element).style.display = "block";
    else
        document.getElementById(element).style.display = "none";
}

function ShowElement(element)
{
    document.getElementById(element).style.visibility='visible';
}

function HideElement(element)
{
    document.getElementById(element).style.visibility='hidden';
}

//--------------------------------------------------
// zvýraznění hledaných výrazů
//--------------------------------------------------
function Search(search)
{
    $('#SearchArea').removeHighlight();
    $('#SearchArea').highlight(search);
}

