$(document).ready(function(){
    // http://bassistance.de/jquery-plugins/jquery-plugin-tooltip
    $('a.tooltip').tooltip({ 
        track: true, 
        delay: 0, 
        showURL: false, 
        showBody: " - ", 
        fade: 250 
    });
    
    // TODO: we should be able to grab the title attribute using jQuery and
    // parse it for display instead of duplicating the content from
    // 'include/tooltips.php
    
    $('span.tooltip').tooltip({
        bodyHandler: function() {           
            // jquery.tooltip.js is removing the title attribute so that the
            // browser doesn't also render the tooltip
            // unfortunately then, we can't grab the title to parse it
            // and add html markup
            // if we could add a custom attribute could solve the problem,
            // but then the page doesn't validate
                        
            var string = $(this).attr('class');
            var string = string.replace('tooltip ', '');
            var text = string.split(': ');
            var out = '<strong>' + text[0] + '</strong><br/>' + text[1];
            return out;
        },
        track: true,
        delay: 0, 
        showURL: false, 
        showBody: " - ", 
        fade: 250 
    });   
});
