$(function() {
    // Social Bar Hover Effect
    $('#social-bar a').hover(function() {
        $(this).stop().animate({'margin-left' : '0'}, 200);
    }, function(){
        $(this).stop().animate({'margin-left' : '-17px'}, 200);
    });
 
    // Social Bar Tooltips
    $("#social-bar a").hover(function(e) {
        var y = $(this).offset().top - $("#social-bar").offset().top;
        var content = $(this).attr('title');
        var id = $(this).attr('id');
 
        $(this).attr('title', '');
 
        $("#social-bar").append("<div id='tooltip'>" + content + "</div>");
        $("#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();
            $('#' + trigger).attr('title', content);
            $("#social-bar #tooltip").remove();
        }
    );
 
});
