jQuery(function() {

    // Social Bar Hover Effect
    jQuery('#social-bar a').hover(function() {
        jQuery(this).stop().animate({'margin-left' : '0'}, 200);
    }, function(){
        jQuery(this).stop().animate({'margin-left' : '-17px'}, 200);
    });

    // Social Bar Tooltips
    jQuery("#social-bar a").hover(function(e) {
        var y = $(this).offset().top - jQuery("#social-bar").offset().top;
        var content = $(this).attr('title');
        var id = $(this).attr('id');

        $(this).attr('title', '');

        jQuery("#social-bar").append("<div id='tooltip'>" + content + "</div>");
        jQuery("#social-bar #tooltip").css('opacity', 0.7).css('top', y + 8).css("left", 50).data('trigger', id).fadeIn();
    },
        function() {
            var trigger = $("#social-bar #tooltip").data('trigger');
            var content = $("#social-bar #tooltip").html();
            jQuery('#' + trigger).attr('title', content);
            jQuery("#social-bar #tooltip").remove();
        }
    );

});

