﻿// JavaScript File

function ShowCantMissTooltip(tooltipElemID, refElem, text)
{
    if (text && !Get("tooltipElemID")) { 
        var container = Elem("div")
        container.id = tooltipElemID;
        container.className = "InYourFaceTooltip";
        container.style.textAlign = "left";
        var textContainer = Elem("div");
        textContainer.className = "TooltipText";
        textContainer.appendChild(Text(text, true));
        container.appendChild(textContainer);
        var bottomContainer = Elem("div");
        var bottomImage = Elem("img");
        bottomImage.src = "/images/tooltip_top.gif";
        bottomImage.width = 250;
        bottomImage.height = 8;
        bottomContainer.appendChild(bottomImage);
        container.appendChild(bottomContainer);
        Get("ElementDropBox").appendChild(container);
    }
    
    if (tooltipElemID) {
        var tooltipElem = Get(tooltipElemID);

        tooltipElem.style.display = "block";
        tooltipElem.style.zIndex = 10000;
        
        tooltipElem.style.top = (Pliner.Util.Display.FindYPosition(refElem) - tooltipElem.offsetHeight) + "px";
        tooltipElem.style.left = (Pliner.Util.Display.FindXPosition(refElem) + Math.round(refElem.offsetWidth / 2) - tooltipElem.offsetWidth + 1) + "px";
    }
}

function HideCantMissTooltip(tooltipElemID)
{
    var tooltipElem = Get(tooltipElemID);

    tooltipElem.style.display = "none";
    tooltipElem.style.top = 0;
    tooltipElem.style.left = 0;
}

