(function(c){function p(e){if("string"===typeof e){var a=e.indexOf("_");-1!=a&&(e=e.substr(a+1))}return e}function s(e){e.preventDefault();e=p(c(this).attr("data-id"));var a=k[e];c(this).off();a.prev.off();c.fn.als("next",e)}function t(e){e.preventDefault();e=p(c(this).attr("data-id"));var a=k[e];c(this).off();a.next.off();c.fn.als("prev",e)}var k=[],q=0,v={init:function(e){this.each(function(){var a=c(this),b=a.data("als"),d=c(),b=c(),l=c(),f=c(),g=c(),h=c(),m=0,n=0,p=0,w=0,z=0,x=0,y=0,A=0,v=0,d= c.extend({visible_items:3,scrolling_items:1,orientation:"horizontal",circular:"no",autoscroll:"no",interval:4E3,direction:"left",start_from:0},e);"no"==d.circular&&"yes"==d.autoscroll&&(d.circular="yes");a.attr("id")&&""!=a.attr("id")||a.attr("id","als-container_"+q);f=a.find(".als-viewport").attr("id","als-viewport_"+q);l=a.find(".als-wrapper").attr("id","als-wrapper_"+q);b=a.find(".als-item");m=b.size();d.visible_items>m&&(d.visible_items=m-1);d.scrolling_items>d.visible_items&&(d.scrolling_items= d.visible_items-1);d.start_from>m-d.visible_items&&(d.start_from=0);g=a.find(".als-prev").attr("data-id","als-prev_"+q);h=a.find(".als-next").attr("data-id","als-next_"+q);switch(d.orientation){default:b.each(function(a){c(this).attr("id","als-item_"+q+"_"+a);p+=c(this).outerWidth(!0);y=d.start_from&&(n+=c(this).outerWidth(!0),y++));0!=d.start_from&&(A=d.start_from&&(w+=c(this).outerHeight(!0),y++));0!=d.start_from&&(A< d.start_from&&(x+=c(this).outerHeight(!0),A++),v=d.start_from)}),l.css("height",z),b.css("top",-x),f.css("height",w),l.css("width",b.outerWidth(!0)),f.css("width",b.outerWidth(!0)),"yes"==d.circular&&0!=d.start_from)for(r=0;r=a.num_items&&a.next.hide();break;case "yes":for(var f=0,g=[],b=a.current;b=a.num_items&&(h=b-a.num_items);d+=a.item.eq(h).outerWidth(!0);g[f]=h;f++}a.current+=a.options.scrolling_items;a.current>=a.num_items&&(a.current-=a.num_items);for(b=a.current;b=a.num_items&&(f=b-a.num_items),c+=a.item.eq(f).outerWidth(!0);a.viewport.animate({width:c},600);a.item.animate({left:"-="+d},600);a.item.promise().done(function(){var b=a.item.last().position(),b=b.left+a.item.last().outerWidth(!0);for(k5=0;k5=a.num_items&&a.next.hide();break;case "yes":f=0;g=[];for(b=a.current;b=a.num_items&&(h=b-a.num_items),d+=a.item.eq(h).outerHeight(!0),g[f]=h,f++;a.current+=a.options.scrolling_items;a.current>=a.num_items&&(a.current-=a.num_items);for(b=a.current;b=a.num_items&&(f=b-a.num_items),c+=a.item.eq(f).outerHeight(!0);a.viewport.animate({height:c}); a.item.animate({top:"-="+d});a.item.promise().done(function(){var b=a.item.last().position(),b=b.top+a.item.last().outerHeight(!0);for(k5=0;k5=a.current&&a.prev.hide();a.current+a.options.visible_itemsa.current&&(a.current+=a.num_items);for(b=a.current;b< a.current+a.options.scrolling_items;b++){var h=b;b>=a.num_items&&(h=b-a.num_items);d+=a.item.eq(h).outerWidth(!0);g[f]=h;f++}for(b=a.current;b=a.num_items&&(f=b-a.num_items),l+=a.item.eq(f).outerWidth(!0);b=a.item.first().position();b=b.left-a.wrapper_width;for(k5=0;k5=a.current&&a.prev.hide();a.current+a.options.visible_itemsa.current&&(a.current+=a.num_items);for(b=a.current;b=a.num_items&&(h=b-a.num_items),m+=a.item.eq(h).outerHeight(!0),g[f]=h,f++;for(b=a.current;b=a.num_items&&(f=b-a.num_items),n+=a.item.eq(f).outerHeight(!0);b=a.item.first().position(); b=b.top-a.wrapper_height;for(k5=0;k5