﻿function getX(obj)
{
    return( obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft+getX(obj.offsetParent) );
}

function getY(obj)
{
    return( obj.offsetParent==null ? obj.offsetTop : obj.offsetTop+getY(obj.offsetParent) );
}

function DisplayInlineHelp(sender, term, description)
{
    // Get the faq element.
    help = document.getElementById("InlineHelp");

    // Create the html for the faq.
    
    help.innerHTML = "<iframe id='InlineHelpFrame' style='width:400px;  margin-right:-22px; height:45px; border-width:0px;' src='../HelpWindow.aspx?Header="+ term +"&Text="+ description +"'></iframe>";
    
    // Update the left offset.
    help.style.left = (getX(sender) - 200) + 'px';
    
    // Update the top offset.
    help.style.top = (getY(sender) + 24) + 'px';

    // Display the faq.
    help.style.visibility = "visible";
}

function HideInlineHelp()
{
    // Get the help element.
    help = document.getElementById("InlineHelp");
    
    help.style.left = "-400px";
    help.style.top = "0px";
    

    // Hide the faq.
    help.style.visibility = "hidden";
}
