$(document).ready(function ($) {




  

    


    

    /*
     * Team Page Events
    **/
    if ($('body').length > 0) {
        // Tags Meta Filter
        var employeeLIs = $("#employees > li"),
            tagFilters  = $("#tag-filter a");

        tagFilters.click(function () {
            // If already active, remove the filter
            if ($(this).hasClass("active")) {
                tagFilters.removeClass("active");

                employeeLIs.addClass("active");
            }
            // Otherwise, only show matching tags
            else {
                var tagName = "." + $(this).attr("id");

                tagFilters.removeClass("active");

                employeeLIs.removeClass("active");

                $(this).addClass("active");

                employeeLIs.find(tagName).parents(".employee").addClass("active");
            }
        });

        // Staff Headshot Rollovers
        employeeLIs.find(".headshot").mouseenter(
            function () {
                var thisEmployee = $(this).parent();

                employeeLIs.find('.infoBubble').hide();

                thisEmployee.find('.infoBubble').fadeIn("fast");

                if (thisEmployee.find('.infoBubble h4').text() === "Robert Petro") {
                    var robsId = "#" + thisEmployee.attr('id');

                    $("#employees > li:not(" + robsId + "), #tag-filter").animate({
                        opacity: 0.1
                    }, 600);
                }
            }
        ).mouseleave(
            function () {
                var thisEmployee = $(this).parent();

                employeeLIs.find(".infoBubble").hide();

                $("#employees > li, #tag-filter").animate({
                    opacity: 1
                }, 400);
            }
        );
    }

}); // End Document.ready
