////////////////////////////
// 
///////////////////////////
(function($) {
$.fn.orphans = function(){
    var txt = [];
    this.each(function(){$.each(this.childNodes, function() {
        if (this.nodeType == 3 && $.trim(this.nodeValue)) txt.push(this)
    })}); 
    return $(txt);
};

$.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() {
    $('.collapse').hide(); 
    $('.expand').orphans().wrap('<a href="#expand/collapse" title="expand/collapse"></a>');
    
    $('div.accordion .expand').click(function() {
        $(this).toggleClass('open').siblings().removeClass('open').end()
        .next('.collapse').toggle('slow').siblings('.collapse:visible').toggle('slow');
    });
});
