(function(c){function d(g,h){var e=c(h);return e.length<2?e:g.parent().find(h)}function b(u,v){var w=this,n=u.add(w),t=u.children(),q=0,j=v.vertical;a||(a=w);if(t.length>1){t=c(v.items,u)}c.extend(w,{getConf:function(){return v},getIndex:function(){return q},getSize:function(){return w.getItems().size()},getNaviButtons:function(){return i.add(h)},getRoot:function(){return u},getItemWrap:function(){return t},getItems:function(){return t.children(v.item).not("."+v.clonedClass)},move:function(f,g){return w.seekTo(q+f,g)},next:function(f){return w.move(1,f)},prev:function(f){return w.move(-1,f)},begin:function(f){return w.seekTo(0,f)},end:function(f){return w.seekTo(w.getSize()-1,f)},focus:function(){return a=w},addItem:function(f){f=c(f);if(v.circular){c(".cloned:last").before(f);c(".cloned:first").replaceWith(f.clone().addClass(v.clonedClass))}else{t.append(f)}n.trigger("onAddItem",[f]);return w},seekTo:function(f,m,k){if(v.circular&&f===0&&q==-1&&m!==0){return w}if(!v.circular&&f<0||f>w.getSize()||f<-1){return w}var g=f;if(f.jquery){f=w.getItems().index(f)}else{g=w.getItems().eq(f)}var l=c.Event("onBeforeSeek");if(!k){n.trigger(l,[f,m]);if(l.isDefaultPrevented()||!g.length){return w}}g=j?{top:-g.position().top}:{left:-g.position().left};q=f;a=w;if(m===undefined){m=v.speed}t.animate(g,m,v.easing,k||function(){n.trigger("onSeek",[f])});return w}});c.each(["onBeforeSeek","onSeek","onAddItem"],function(f,g){c.isFunction(v[g])&&c(w).bind(g,v[g]);w[g]=function(k){c(w).bind(g,k);return w}});if(v.circular){var e=w.getItems().slice(-1).clone().prependTo(t),x=w.getItems().eq(1).clone().appendTo(t);e.add(x).addClass(v.clonedClass);w.onBeforeSeek(function(f,k,g){if(!f.isDefaultPrevented()){if(k==-1){w.seekTo(e,g,function(){w.end(0)});return f.preventDefault()}else{k==w.getSize()&&w.seekTo(x,g,function(){w.begin(0)})}}});w.seekTo(0,0)}var i=d(u,v.prev).click(function(){w.prev()}),h=d(u,v.next).click(function(){w.next()});!v.circular&&w.getSize()>1&&w.onBeforeSeek(function(f,g){setTimeout(function(){if(!f.isDefaultPrevented()){i.toggleClass(v.disabledClass,g<=0);h.toggleClass(v.disabledClass,g>=w.getSize()-1)}},1)});v.mousewheel&&c.fn.mousewheel&&u.mousewheel(function(f,g){if(v.mousewheel){w.move(g<0?1:-1,v.wheelSpeed||50);return false}});v.keyboard&&c(document).bind("keydown.scrollable",function(f){if(!(!v.keyboard||f.altKey||f.ctrlKey||c(f.target).is(":input"))){if(!(v.keyboard!="static"&&a!=w)){var g=f.keyCode;if(j&&(g==38||g==40)){w.move(g==38?-1:1);return f.preventDefault()}if(!j&&(g==37||g==39)){w.move(g==37?-1:1);return f.preventDefault()}}}});c(w).trigger("onBeforeSeek",[v.initialIndex])}c.tools=c.tools||{version:"1.2.3"};c.tools.scrollable={conf:{activeClass:"active",circular:false,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:true,mousewheel:false,next:".next",prev:".prev",speed:400,vertical:false,wheelSpeed:0}};var a;c.fn.scrollable=function(e){var g=this.data("scrollable");if(g){return g}e=c.extend({},c.tools.scrollable.conf,e);this.each(function(){g=new b(c(this),e);c(this).data("scrollable",g)});return e.api?g:this}})(jQuery);(function(b){var a=b.tools.scrollable;a.autoscroll={conf:{autoplay:true,interval:3000,autopause:true}};b.fn.autoscroll=function(f){if(typeof f=="number"){f={interval:f}}var c=b.extend({},a.autoscroll.conf,f),e;this.each(function(){var d=b(this).data("scrollable");if(d){e=d}var j,g,h=true;d.play=function(){if(!j){h=false;j=setInterval(function(){d.next()},c.interval);d.next()}};d.pause=function(){j=clearInterval(j)};d.stop=function(){d.pause();h=true};c.autopause&&d.getRoot().add(d.getNaviButtons()).hover(function(){d.pause();clearInterval(g)},function(){h||(g=setTimeout(d.play,c.interval))});c.autoplay&&setTimeout(d.play,c.interval)});return c.api?e:this}})(jQuery);(function(c){function b(f,e){var d=c(e);return d.length<2?d:f.parent().find(e)}var a=c.tools.scrollable;a.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,idPrefix:null,history:false}};c.fn.navigator=function(e){if(typeof e=="string"){e={navi:e}}e=c.extend({},a.navigator.conf,e);var d;this.each(function(){function t(h,f,j){v.seekTo(f);if(s){if(location.hash){location.hash=h.attr("href").replace("#","")}}else{return j.preventDefault()}}function u(){return r.find(e.naviItem||"> *")}function m(h){var f=c("<"+(e.naviItem||"a")+"/>").click(function(j){t(c(this),h,j)}).attr("href","#"+h);h===0&&f.addClass(p);e.indexed&&f.text(h+1);e.idPrefix&&f.attr("id",e.idPrefix+h);return f.appendTo(r)}function i(h,f){h=u().eq(f.replace("#",""));h.length||(h=u().filter("[href="+f+"]"));h.click()}var v=c(this).data("scrollable"),r=b(v.getRoot(),e.navi),g=v.getNaviButtons(),p=e.activeClass,s=e.history&&c.fn.history;if(v){d=v}v.getNaviButtons=function(){return g.add(r)};u().length?u().each(function(f){c(this).click(function(h){t(c(this),f,h)})}):c.each(v.getItems(),function(f){m(f)});v.onBeforeSeek(function(h,f){setTimeout(function(){if(!h.isDefaultPrevented()){var j=u().eq(f);!h.isDefaultPrevented()&&j.length&&u().removeClass(p).eq(f).addClass(p)}},1)});v.onAddItem(function(h,f){f=m(v.getItems().index(f));s&&f.history(i)});s&&u().history(i)});return e.api?d:this}})(jQuery);