1if(typeof Object.create!=='function'){Object.create=function(o){function F(){} 2F.prototype=o;return new F();};} 3(function($){var headache=$.browser.msie&&$.browser.version.substr(0,1)<9;var Carousel={settings:{itemsPerPage:1,itemsPerTransition:1,noOfRows:1,pagination:true,nextPrevLinks:true,speed:'normal',easing:'swing'},init:function(el,options){if(!el.length){return false;} 4this.options=$.extend({},this.settings,options);this.itemIndex=0;this.container=el;this.runner=this.container.find('ul');this.items=this.runner.children('li');this.noOfItems=this.items.length;this.setRunnerWidth();if(this.noOfItems<=this.options.itemsPerPage){return false;} 5this.insertMask();this.noOfPages=Math.ceil((this.noOfItems- this.options.itemsPerPage)/ this.options.itemsPerTransition) + 1; 6if(this.options.pagination){this.insertPagination();} 7if(this.options.nextPrevLinks){this.insertNextPrevLinks();} 8this.updateBtnStyles();},insertMask:function(){this.runner.wrap('<div class="mask" />');this.mask=this.container.find('div.mask');var maskHeight=this.runner.outerHeight(true);this.mask=this.container.find('div.mask');this.mask.height(maskHeight);},setRunnerWidth:function(){this.noOfItems=Math.round(this.noOfItems/this.options.noOfRows);var width=this.items.outerWidth(true)*this.noOfItems;this.runner.width(width);},insertPagination:function(){var i,links=[];this.paginationLinks=$('<ol class="pagination-links" />');for(i=0;i<this.noOfPages;i++){links[i]='<li><a href="#item-'+ i+'">'+(i+ 1)+'</a></li>';} 9this.paginationLinks.append(links.join('')).appendTo(this.container).find('a').bind('click.carousel',$.proxy(this,'paginationHandler'));},paginationHandler:function(e){this.itemIndex=e.target.hash.substr(1).split('-')[1]*this.options.itemsPerTransition;this.animate();return false;},insertNextPrevLinks:function(){this.prevLink=$('<a href="#" class="prev">Prev</a>').bind('click.carousel',$.proxy(this,'prevItem')).appendTo(this.container);this.nextLink=$('<a href="#" class="next">Next</a>').bind('click.carousel',$.proxy(this,'nextItem')).appendTo(this.container);},nextItem:function(){this.itemIndex=this.itemIndex+ this.options.itemsPerTransition;this.animate();return false;},prevItem:function(){this.itemIndex=this.itemIndex- this.options.itemsPerTransition;this.animate();return false;},updateBtnStyles:function(){if(this.options.pagination){this.paginationLinks.children('li').removeClass('current').eq(Math.ceil(this.itemIndex/this.options.itemsPerTransition)).addClass('current');} 10if(this.options.nextPrevLinks){this.nextLink.add(this.prevLink).removeClass('disabled');if(this.itemIndex===(this.noOfItems- this.options.itemsPerPage)){this.nextLink.addClass('disabled');} 11else if(this.itemIndex===0){this.prevLink.addClass('disabled');}}},animate:function(){var nextItem,pos;if(this.itemIndex>(this.noOfItems- this.options.itemsPerPage)){this.itemIndex=this.noOfItems- this.options.itemsPerPage;} 12if(this.itemIndex<0){this.itemIndex=0;} 13nextItem=this.items.eq(this.itemIndex);pos=nextItem.position();if(headache){this.runner.stop().animate({left:-pos.left},this.options.speed,this.options.easing);} 14else{this.mask.stop().animate({scrollLeft:pos.left},this.options.speed,this.options.easing);} 15this.updateBtnStyles();}};$.fn.carousel=function(options){return this.each(function(){var obj=Object.create(Carousel);obj.init($(this),options);$.data(this,'carousel',obj);});};})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.