$(document).ready(function(){
    $("[data-hide]").on("click", function(){
        $(this).closest("." + $(this).attr("data-hide")).hide(200);
    });

    // Change hash for page-reload 
    $('.nav-tabs a').on('shown.bs.tab', function (e) {
        window.location.hash = e.target.hash;
    });

    // Use the hash to select the correct tab (if available)
    var url = document.location.toString();
    if (url.match('#')) {
        $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
    }
});

InitSelectMultipleUsersOrGroups = function(path_elt, place_holder)
{
    $(path_elt).fSelect({
        placeholder: place_holder,
        numDisplayed: 500,
        overflowText: '{n} selected',
        searchText: 'Search',
        showSearch: true
    });
};
