$(document).ready(function() {
    // Activate the nav block accordion
    $("#nav").accordion({
        collapsible: true,
        header: 'h3',
        animated: false,
        fillSpace: true
    });

    // Activate the blog-list accordion
    $("#list").accordion({
        collapsible: true,
        header: 'h3',
        fillSpace: false
    });

    $('p:first', 'body')
        .andSelf()
        .contents()
        .filter(function(){
        return this.nodeType === 3;
    })

    .filter(function(){
        // Only match when contains 'Portfolio' in a <p> tag
        return this.nodeValue.indexOf('Portfolio:') != -1;
    })

    .each(function(){
        $("#nav").accordion({
            active: 1
        });
    });
});