$.fn.pager=function(b,c){var a={navId:"nav",navClass:"nav",navAttach:"append",highlightClass:"highlight",prevText:"&laquo;",nextText:"&raquo;",linkText:null,linkWrap:null,height:null};if(c){$.extend(a,c)}return this.each(function(){var k=$(this);var d;var g=0;var m="#"+a.navId;function o(){d=$(b,k).not(m).size();if(a.height==null){a.height=p()}if(d>1){f();l();e()}n();if(a.linkWrap!=null){h()}}function f(){var q='<div id="'+a.navId+'" style="clear: both;" class="'+a.navClass+'">';q+='<a href="#pager-jump" rel="prev">'+a.prevText+"</a>";for(var i=0;i<d;i++){var r=i+1;q+='<a href="#pager-jump" rel="'+r+'">';q+=(a.linkText==null)?r:a.linkText[r-1];q+="</a>"}q+='<a href="#pager-jump" rel="next">'+a.nextText+"</a>";q+="</div>";switch(a.navAttach){case"before":$(k).before(q);break;case"after":$(k).after(q);break;case"prepend":$(k).prepend(q);break;default:$(k).append(q);break}}function l(){$(k).find(b).not(m).hide();var i=$(k).find(b).not(m).get(g);$(i).show()}function e(){$(k).find(m).find("a").removeClass(a.highlightClass);var i=$(k).find(m).find("a").get(g+1);$(i).addClass(a.highlightClass)}function n(){if($.browser.msie){$(k).find(b).not(m).css({height:a.height})}else{$(k).find(b).not(m).css({minHeight:a.height})}}function p(){var i=0;$(k).find(b).not(m).each(function(){if(this.offsetHeight>i){i=this.offsetHeight}});i=i+"px";return i}function j(){var i=$(m).get(0);return i.offsetHeight}function h(){$(k).find(m).find("a").wrap(a.linkWrap)}o();$(this).find(m).find("a").click(function(){if($(this).attr("rel")=="next"){if(g+1<d){g=g+1}}else{if($(this).attr("rel")=="prev"){if(g>0){g=g-1}}else{var i=$(this).attr("rel");g=i-1}}l();e()})})};jQuery(document).ready(function(){jQuery("option.cookbook_sort_choosen").attr("selected","selected");jQuery(".cookbook-sort-options select").change(function(){var d=jQuery(".cookbook-sort-options select option:selected").attr("name");jQuery(".cookbook-sort-options select option:selected").val(1);jQuery(".cookbook-sort-options select").attr("name",d);jQuery("form").trigger("submit")});var a=Math.floor(parseInt(jQuery(".num-recipes").text(),10)/20)+1;var c=new Array();for(var b=0;b<a;b++){c.push(b+1)}jQuery("#recipts").pager("div.cb-pagination",{navId:"cb_list_pager",prevText:'<img class="search-arrow" src="fileadmin/templates/es2/images/suchergebnisse_pfeil_links.gif" /> Zur&uuml;ck',nextText:'Vorw&auml;rts <img class="search-arrow" src="fileadmin/templates/es2/images/suchergebnisse_pfeil_rechts.gif" />',linkText:c,linkWrap:"<div></div>",height:"1px"});jQuery("div#cb_list_pager a[rel=prev]").parent().css("visibility","hidden");jQuery("div#cb_list_pager a[rel=prev]").attr("class","search-prev");jQuery("div#cb_list_pager a[rel=next]").attr("class","search-next");jQuery("div#cb_list_pager a").click(function(){if(jQuery(this).attr("rel")==1){jQuery("div#cb_list_pager a[rel=prev]").parent().css("visibility","hidden")}else{jQuery("div#cb_list_pager a[rel=prev]").parent().css("visibility","visible")}if(jQuery(this).parent().next().children().attr("rel")=="next"){jQuery("div#cb_list_pager a[rel=next]").parent().css("visibility","hidden")}else{jQuery("div#cb_list_pager a[rel=next]").parent().css("visibility","visible")}return false});jQuery("div#cb_list_pager a[rel=prev]").click(function(){if(jQuery("div#cb_list_pager a[rel=1]").attr("class")=="highlight"){jQuery(this).parent().css("visibility","hidden")}return false});jQuery("div#cb_list_pager a[rel=next]").click(function(){if(jQuery(this).parent().prev().children().attr("class")=="highlight"){jQuery(this).parent().css("visibility","hidden")}return false});jQuery("a.toggle-list-view").click(function(){jQuery(".list-view-hide").toggle();return false})});