(function(b){b.fn.pager=function(e,a){var f={navId:"nav",navClass:"nav",navAttach:"append",highlightClass:"highlight",prevText:"",nextText:"",linkText:null,linkWrap:null,height:null,showBottom:true};if(a){b.extend(f,a)}return this.each(function(){var t=$j(this);var z;var v=0;var r="#"+f.navId;function d(){z=$j(e,t).not(r).size();if(f.height==null){f.height=c()}if(z>1){x();s();y()}i();if(f.linkWrap!=null){w()}}function x(){var g='<div id="'+f.navId+'" class="'+f.navClass+'">';g+='<a href="#" rel="prev">'+f.prevText+"</a>";for(var h=0;h<z;h++){var j=h+1;g+='<a href="#" rel="'+j+'">';g+=(f.linkText==null)?j:f.linkText[j-1];g+="</a>"}g+='<a href="#" rel="next">'+f.nextText+"</a>";g+="</div>";switch(f.navAttach){case"before":$j(t).before(g);if(f.showBottom){$j(t).after(g)}break;case"after":$j(t).after(g);break;case"prepend":$j(t).prepend(g);if(f.showBottom){$j(t).append(g)}break;default:$j(t).append(g);break}}function s(){$j(t).find(e).not("div."+f.navClass).hide();var g=$j(t).find(e).not("div."+f.navClass).get(v);$j(g).show()}function y(){$j("div."+f.navClass).find("a").removeClass(f.highlightClass);$j("div."+f.navClass).each(function(){var g=$j(this).find("a").get(v+1);$j(g).addClass(f.highlightClass)})}function i(){$j(t).find(e).not(r).css({minHeight:f.height})}function c(){var g=0;$j(t).find(e).not(r).each(function(){if(this.offsetHeight>g){g=this.offsetHeight}});g=g+"px";return g}function u(){var g=$j(r).get(0);return g.offsetHeight}function w(){$j("div."+f.navClass).find("a").wrap(f.linkWrap)}d();$j("div."+f.navClass).find("a").click(function(){if($j(this).attr("rel")=="next"){if(v+1<z){v=v+1}}else{if($j(this).attr("rel")=="prev"){if(v>0){v=v-1}}else{var g=$j(this).attr("rel");v=g-1}}s();y();window.scroll(0,0);return false})})}})(jQuery);