﻿// JScript File
var tooltip = null;

//Po kazdym ruchu myszki wywoluj funkcje Odswiez 
document.onmousemove = Odswiez;

function Odswiez(e) {

    //Okresl aktualne polozenie kursora 

    x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
    y = (document.all) ? window.event.y + getScrollHeight() : e.pageY;

    if (tooltip != null) {
        //Ustaw miejsce w ktorym ma sie pojawic tooltip 
        tooltip.style.left = (x + 15) + "px";
        tooltip.style.top = (y - 15) + "px";
    }
}

function getScrollHeight() {
    var h = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;

    return h ? h : 0;
}

function Pokaz(id) //Wyswietl tooltip 
{
    tooltip = document.getElementById(id);
    tooltip.style.display = "block";
}
function Ukryj() //Ukryj tooltip 
{
    tooltip.style.display = "none";
} 

