jQuery.fn.orphans = function(){
  var ret = [];
  this.each(function(){jQuery.each(this.childNodes, function() {
    if (this.nodeType == 3 && jQuery.trim(this.nodeValue)) ret.push(this)
    })}); 
   return jQuery(ret);
}
//http://www.learningjquery.com/2008/02/simple-effects-plugins
jQuery.fn.blindToggle = function(speed, easing, callback) {
  var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
  return this.animate({marginTop: parseInt(this.css('marginTop')) < 0 ? 0 : -h}, speed, easing, callback); 
};
jQuery.fn.fadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
};
jQuery(document).ready(function() {
//s/jq/a
    jQuery('.expand').css('cursor','pointer').orphans().wrap('<a href="#expand/collapse" title="expand/collapse"></a>');
    jQuery('.collapse').hide(); 
    
    jQuery('#slide .expand').click(function() {
        jQuery(this).toggleClass("arrow-up");
        jQuery(this).next('.normal').slideToggle();
        jQuery(this).next('.slow').slideToggle('slow');
    });
	
	jQuery('#slide2 .expand').click(function() {
        jQuery(this).toggleClass("arrow-up");
        jQuery(this).next('.normal').slideToggle();
        jQuery(this).next('.slow').slideToggle('slow');
    });
    
});

