//built by Keith Hoffmann @ E&E
(function(h){var g=function(c,g){var d=this,a=0,e=0,f,b=h.extend({page_size:5,load_more_after:20,scroll_speed:300,image_width:c.children().first().outerWidth(),load_more:function(){}},g);this.got_images=function(a,c){a<b.load_more_after&&(f=Math.ceil(c/b.page_size)-1)};this.next=function(){a>=f||(a+=1,0==(a+1)*b.page_size%b.load_more_after&&!f&&(e+=1,b.load_more(e,d.got_images)),d.animate("+"))};this.prev=function(){0>=a||(a-=1,d.animate("-"))};this.animate=function(a){var d=b.page_size*b.image_width;
c.parent().animate({scrollLeft:a+"="+d},b.scroll_speed)}};h.fn.infinatescroll=function(c){return new g(this,c)}})(jQuery);
