(function($){$.fn.expandAll=function(options){var defaults={expTxt:'[Expand All]',cllpsTxt:'[Collapse All]',cllpsEl:'.collapse',trigger:'.expand',ref:'.expand',showMethod:'show',hideMethod:'hide',state:'hidden',speed:0};var o=$.extend({},defaults,options);var toggleTxt=o.expTxt;if(o.state=='hidden'){$(this).find(o.cllpsEl).hide();}else{toggleTxt=o.cllpsTxt;}
return this.each(function(index){var container;if(this.id.length){container='#'+this.id;}else if(this.className.length){container=this.tagName.toLowerCase()+'.'+this.className.split(' ').join('.');}else{container=this.tagName.toLowerCase();}
$(this).find(o.ref+':first').before('<p class="switch"><a href="#">'+toggleTxt+'</a></p>');$(this).find('p.switch a').click(function(){var $cllps=$(this).closest(container).find(o.cllpsEl),$tr=$(this).closest(container).find(o.trigger);if($(this).text()==o.expTxt){$(this).text(o.cllpsTxt);$tr.addClass('open');$cllps[o.showMethod](o.speed);}else{$(this).text(o.expTxt);$tr.removeClass('open');$cllps[o.hideMethod](o.speed);}
return false;});});};$.fn.toggler=function(options){var defaults={cllpsEl:'div.collapse',method:'slideToggle',speed:'slow',container:'',initShow:'.shown'};var o=$.extend({},defaults,options);$(this).wrapInner('<a style="display:block" href="#" title="Expand/Collapse" />');return this.each(function(){var container;(o.container)?container=o.container:container='div';if(o.initShow){$(this).closest(container).find(o.initShow).show().prev().addClass('open');}
$(this).click(function(){$(this).toggleClass('open').next(o.cllpsEl)[o.method](o.speed);return false;});});};$.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);

