jQuery.fn.prettyGallery=function(a){a=jQuery.extend({itemsPerPage:2,animationSpeed:"normal",navigation:"top",of_label:" of ",previous_title_label:"Previous page",next_title_label:"Next page",previous_label:"Previous",next_label:"Next"},a);return this.each(function(){var g=1;var i=0;var d=0;var h=0;var c=0;var e=false;var j=$(this);var f=function(n){if(e||$(n).hasClass("disabled")){return}e=true;j.find("li:lt("+(g*a.itemsPerPage)+")").each(function(o){$(this).animate({left:parseFloat($(this).css("left"))+(h)},a.animationSpeed,function(){e=false})});j.find("li:gt("+((g*a.itemsPerPage)-1)+")").each(function(o){$(this).animate({left:parseFloat($(this).css("left"))+(h)},a.animationSpeed)});g--;k()};var b=function(n){if(e||$(n).hasClass("disabled")){return}e=true;j.find("li:lt("+(g*a.itemsPerPage)+")").each(function(o){$(this).animate({left:parseFloat($(this).css("left"))-(h)},a.animationSpeed,function(){e=false})});j.find("li:gt("+((g*a.itemsPerPage)-1)+")").each(function(o){$(this).animate({left:parseFloat($(this).css("left"))-(h)},a.animationSpeed)});g++;k()};var l=function(){i=120;itemMargin=10;d=90;h=(i+itemMargin)*a.itemsPerPage-parseFloat(j.find("li:first").css("margin-right"));h+=itemMargin;j.css({width:h,height:d,overflow:"hidden",position:"relative",clear:"left"});j.find("li").each(function(n){$(this).css({position:"absolute",top:0,left:n*(i+itemMargin)})});j.wrap('<div class="prettyGallery"></div>').addClass("prettyGallery")};var k=function(){$cg=j.parents("div.prettyGallery:first");$cg.find("ul.prettyNavigation span.current").text(g);$cg.find("ul.prettyNavigation span.total").text(c);$cg.find("ul.prettyNavigation li span").removeClass("disabled");if(g==1){$cg.find("ul.prettyNavigation li.prev span").addClass("disabled")}else{if(g==c){$cg.find("ul.prettyNavigation li.next span").addClass("disabled")}}};var m=function(){var n="";n+='<ul class="prettyNavigation">';n+='<li class="prev"><span href="#" title="'+a.previous_title_label+'">'+a.previous_label+"</span></li>";n+='<li class="next"><span href="#" title="'+a.next_title_label+'">'+a.next_label+"</span></li>";n+="</ul>";switch(a.navigation){case"top":j.before(n);break;case"bottom":j.after(n);break;case"both":j.before(n);j.after(n);break}$theNav=j.parent("div.prettyGallery:first").find("ul.prettyNavigation");galleryBorderWidth=parseFloat($theNav.css("border-left-width"))+parseFloat($theNav.css("border-right-width"));$theNav.width(20);$theNav.each(function(){$(this).find("li:eq(1)").width(20)});$theNav.find("li.prev span").bind("click",function(){f(this);return false});$theNav.find("li.next span").bind("click",function(){b(this);return false})};if($(this).find("li").size()>a.itemsPerPage){c=Math.ceil($(this).find("li").size()/a.itemsPerPage);l();m();k(this);g=1}})};