function tooltip(c, a) {
    var b = $("#" + c);
    if (a) {
        b.removeClass("hidden")
    } else {
        b.addClass("hidden")
    }
}

var currentTooltip = null;

function show_tooltip(c, g) {
    function b() {
        return (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop)
    }
    if (currentTooltip) {
        currentTooltip.remove();
        currentTooltip = null
    } else {
        if (g == "close") {
            return
        }
        var l = $("i:last", c).clone(),
            j = $("img, .icon-container", c);
        if (!j.length) {
            j = $(c)
        }
        var e = j.height();
        l.css({
            display: "block",
            visibility: "hidden"
        });
        $("body").append(l);
        currentTooltip = l;
        var h = $(j).offset().left,
            f = $(j).offset().top;
        var k = currentTooltip.width(),
            d = currentTooltip.outerHeight();
        openPositionX = h;
        if ((h - k) > 0) {
            openPositionX = h - k
        }
        var a = 3;
        openPositionY = f - d - a;
        if ($(window).height() > (f + e + a + d - b())) {
            openPositionY = f + e + a
        }
        $(currentTooltip).css({
            left: openPositionX + "px",
            top: openPositionY + "px",
            visibility: "visible"
        })
    }
}
