function hookupTooltips () {
var tooltipAnimationTime = chartConfig.tooltipAnimationTime;
var tooltipMinimumWidth = chartConfig.tooltipMinimumWidth;
var tooltipClassname = chartConfig.tooltipClassname;
/* Called to build the box, containing tooltip html, at specified coords */
var renderTooltipBox = function (content, x, y) {
if ($('.' + tooltipClassname).length) return; /* Tooltip already exists. */
var style = { left: x + 'px', top: y + 'px', display: 'none', 'z-index': '10000' };
var box = $('
', { class: tooltipClassname })
.html(content)
.css(style);
if ($('#citation-report-display').css('display') === 'none') {
box.appendTo('.CitReportTotalRow1').fadeIn(tooltipAnimationTime);
} else {
box.appendTo('.citation-report-header').fadeIn(tooltipAnimationTime);
}
};
var grabTooltipContent = function (key) {
var elem = $('[tooltip-for="' + key + '"]');
return elem ? elem[0].innerHTML : null;
}
var removeTooltipBox = function () {
$('.' + tooltipClassname).fadeOut(tooltipAnimationTime, function () { $(this).remove(); });
};
var tooltipErrorMessage = function (key) {
var message = 'Tooltip missing: provide "$KEY" tooltip text using a