////////////////////////////
// http://adipalaz.awardspace.com/experiments/jquery/expand.html
// * When using this script, please keep the above url intact.
///////////////////////////
(function($) {
$.fn.expandAll = function(options) {
    var defaults = {
         trigger1 : '[Expand All]',
         trigger2 : '[Collapse All]',
         cllps : 'div.collapse',
         exp : 'a.expand',
         container : '#' + this.attr("id") + ' ',
         ref : 'div',
         showMethod : 'show',
         hideMethod : 'hide',
         speed : ''
    };
    var o = $.extend({}, defaults, options);   
    return this.each(function() {

        $(this).find('#switch a').click(function() {
        var $cllps = $(this).closest(o.container).find(o.cllps),
            $exp = $(this).closest(o.container).find(o.exp);
        if ($(this).text() == o.trigger1) {
          $(this).text(o.trigger2);
          $exp.addClass('open');
          $cllps[o.showMethod](o.speed);
        } else {
          $(this).text(o.trigger1);
          $exp.removeClass('open');
          $cllps[o.hideMethod](o.speed);
        }
        return false;
    });
});};
//http://www.learningjquery.com/2008/02/simple-effects-plugins:
$.fn.fadeToggle = function(speed, easing, callback) {
    return this.animate({opacity: 'toggle'}, speed, easing, callback);
};
$.fn.slideFadeToggle = function(speed, easing, callback) {
    return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
};
})(jQuery);
////////////////////////////
$(function() {
    $('#title-bar').expandAll().find('div.collapse').hide().end()

    $('.page-nav a.expand').click(function() {
        $(this).toggleClass('open')
        .next('div.collapse.slow').slideFadeToggle('fast','linear');
        return false;
    });
});
