////////////////////////////
// http://adipalaz.awardspace.com/experiments/jquery/expandSlide.html
// * When using this script, please keep the above url intact.
///////////////////////////
(function($) {
$.fn.expandSlideAll = function(options) {
    var defaults = {
         trigger1 : '[expandSlide All]',
         trigger2 : '[collapseSlide All]',
         cllps : 'div.collapseSlide',
         exp : 'h4.expandSlide',
         container : '#' + this.attr("id") + ' ',
         ref : 'div',
         showMethod : 'show',
         hideMethod : 'hide',
         speed : ''
    };
    var o = $.extend({}, defaults, options);   
    return this.each(function() {
        $(o.container + o.ref + ':first').before('<p id="switch"><a href="#expandSlide-all/collapseSlide-all">' + o.trigger1 + '</a></p>');     
        $(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);
        }
    });
});};
//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() {
    $('#outer').expandSlideAll().find('div.collapseSlide').hide().end()
    .find('h4.expandSlide').wrapInner('<a style="display:block" href="#expandSlide/collapseSlide" title="expandSlide/collapseSlide" />');0
    // 2. div.demoSlide:eq(1):
    $('#outer div.demoSlide:eq(0) h4.expandSlide').click(function() {
        $(this).toggleClass('open')
        .next('div.collapseSlide.normal').slideToggle().end()
        .next('div.collapseSlide.slow').slideToggle('slow','linear');
    });0
});
