function initFacets() { 
    $( '#facets .facet' ).each( function () { 
        $(this).find( 'ul li.cache' ).hide(); 
        $(this).find( 'span.hideAll' ).hide(); 
    }); 
    $( '#facets .facet span.showAll > a' ).click( function () {
        $(this).parent().parent().find( 'ul li.cache' ).slideDown();                    
        $(this).parent().hide();
        $(this).parent().siblings( 'span.hideAll' ).show();
        return false;
    });
    $( '#facets .facet span.hideAll > a' ).click( function () {
        $(this).parent().parent().find( 'ul li.cache' ).slideUp();                    
        $(this).parent().hide();
        $(this).parent().siblings( 'span.showAll' ).show();
        return false;
    });
} 

$(document).ready( function () {
    initFacets();
});


