(function(a){a.fn.expander=function(d){var e=a.extend({},a.fn.expander.defaults,d);var c;return this.each(function(){var q=a(this);var h=a.meta?a.extend({},e,q.data()):e;var t,w,l;var p=q.html();var u=p.slice(0,h.slicePoint).replace(/(\w)$/,"");w=u.match(/<\w[^>]*>/g);if(w){u=p.slice(0,h.slicePoint+w.join("").length).replace(/\w+$/,"")}if(u.lastIndexOf("<")>u.lastIndexOf(">")){u=u.slice(0,u.lastIndexOf("<"))}var k=p.slice(u.length);if(!a("span.details",this).length){if(k.replace(/\s+$/,"").split(" ").length<h.widow){return}if(k.indexOf("</")>-1){l=k.match(/<(\/)?[^>]*>/g);for(var n=0;n<l.length;n++){if(l[n].indexOf("</")>-1){var v,r=false;for(var m=0;m<n;m++){v=l[m].slice(0,l[m].indexOf(" ")).replace(/(\w)$/,"$1>");if(v==f(l[n])){r=true}}if(!r){u=u+l[n];var g=false;for(var x=w.length-1;x>=0;x--){if(w[x].slice(0,w[x].indexOf(" ")).replace(/(\w)$/,"$1>")==f(l[n])&&g==false){t=t?w[x]+t:w[x];g=true}}}}}k=t+k}q.html([u,'<a href="#" class="read-more">',h.expandText,"</a>",'<span class="details">',k,"</span>"].join(""))}q.find("span.details").hide().end().find("a.read-more").click(function(){a(this).hide().next("span.details")[h.expandEffect](h.expandSpeed,function(){var i=a(this);i.css({zoom:""});if(h.collapseTimer){c=setTimeout(function(){b(i)},h.collapseTimer)}});return false});if(h.userCollapse){q.find("span.details").append(' <a class="re-collapse" href="#">'+h.userCollapseText+"</a>").find("a.re-collapse").click(function(){clearTimeout(c);var i=a(this).parent();b(i);return false})}});function b(g){g.hide().prev("a.read-more").show()}function f(g){return g.replace(/\//,"")}};a.fn.expander.defaults={slicePoint:100,widow:4,expandText:"read more...",collapseTimer:0,expandEffect:"fadeIn",expandSpeed:"",userCollapse:true,userCollapseText:"[collapse expanded text]"}})(jQuery);