(function(b){var a={init:function(c){var e={nextBtn:"#nextBtn",prevBtn:"#prevBtn",width:"100%",height:"100%",hideNav:true,speed:500};var d=b.extend({},e,c);return this.each(function(){obj=b(this);obj.width(100000).css("position","absolute");liCol=b("li",obj);liCol.css({width:d.width,height:d.height,position:"relative","float":"left"});liCol.first().addClass("current");if(liCol.size()<=1&&d.hideNav){b(d.nextBtn).hide();b(d.prevBtn).hide()}else{b(d.nextBtn).show();b(d.prevBtn).show();currIndex=0;totalIndex=liCol.size()-1;b(d.nextBtn).bind("click",a.next).data("speed",d.speed);b(d.prevBtn).bind("click",a.previous).data("speed",d.speed)}})},destroy:function(){return this.each(function(){obj=b(this);obj.css("left","0px");b("li.current",obj).removeClass("current")})},next:function(c){c.preventDefault();c.stopPropagation();speed=b(this).data("speed");liCol=b("li",obj);currLi=b("li.current",obj);currIndex=currLi.index();currLi.removeClass("current");if(currIndex==totalIndex){newLi=liCol.first().clone();newLi.appendTo(obj);oldPos=liCol.eq(currIndex-1).position().left;obj.css("left","-"+oldPos+"px");liCol.first().remove()}else{newLi=liCol.eq(currIndex+1)}newLi.addClass("current");obj.stop(true,false).animate({left:"-"+newLi.position().left+"px"},{duration:speed})},previous:function(c){c.preventDefault();c.stopPropagation();speed=b(this).data("speed");liCol=b("li",obj);currLi=b("li.current",obj);currIndex=currLi.index();if(currIndex==0){currLi.removeClass("current");obj.css("left","-"+currLi.width()+"px");liCol.last().clone().addClass("current").prependTo(obj);liCol.last().remove();obj.stop(true,false).animate({left:"0px"},{duration:speed})}else{newLi=liCol.eq(currIndex-1);currLi.removeClass("current");newLi.addClass("current");obj.stop(true,false).animate({left:"-"+newLi.position().left+"px"},{duration:speed})}}};b.fn.oSlideShow=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments)}else{b.error("Method "+c+" does not exist on jQuery.tooltip")}}}})(jQuery);
