(function(a){a.smallslider=function(d,b){var c=this;c.elm=d;c.$elm=a(d);c.opts=a.extend({},a.smallslider.defaults,b);c.sliderTimer=null;c.init=function(){c.$ul=c.$elm.find(">ul");c.$lis=c.$elm.find("li");c.$ims=c.$elm.find("img");c.itemNums=c.$lis.length;c.width=c.$elm.width();c.height=c.$elm.height();c.current=0;if(c.itemNums>1){if(c.opts.switchEffect=="ease"){c.$ul.css({position:"absolute",left:0,top:0});if(c.opts.switchPath=="left"){var f=c.itemNums*c.width;c.$lis.css({"float":"left"});c.$ul.css({width:f})}else{if(c.opts.switchPath=="up"){var e=c.itemNums*c.height;c.$ul.css({height:e})}}}else{if(c.opts.switchEffect=="fadeOut"){c.$ul.css({position:"relative"});c.$lis.css({position:"absolute",zIndex:1}).eq(0).css({zIndex:2})}}if(c.opts.showButtons){c.createButtons()}if(c.opts.showText){c.createText()}if(c.opts.autoStart){c.startSlider(1)}if(c.opts.onImageStop){c.onImage()}}};c.createButtons=function(){var j="";for(var h=1;h<=c.itemNums;h++){j+="<span>"+h+"</span>"}j='<div class="smallslider-btns">'+j+"</div>";var l=0,g=0,k=0,e=0;var f={};switch(c.opts.buttonPosition){case"leftTop":l=c.opts.buttonOffsetX;k=c.opts.buttonOffsetY;f={left:l+"px",top:k+"px"};break;case"rightTop":g=c.opts.buttonOffsetX;k=c.opts.buttonOffsetY;f={right:g+"px",top:k+"px"};break;case"rightBottom":g=c.opts.buttonOffsetX;e=c.opts.buttonOffsetY;f={right:g+"px",bottom:e+"px"};break;case"leftBottom":l=c.opts.buttonOffsetX;e=c.opts.buttonOffsetY;f={left:l+"px",bottom:e+"px"};break}a(j).css(f).appendTo(c.$elm);c.$btns=c.$elm.find("span");c.$elm.find("span:not(:first)").css({marginLeft:c.opts.buttonSpace+"px"});c.$btns.removeClass("current-btn");c.$btns.eq(0).addClass("current-btn");if(c.opts.switchMode=="click"){c.$btns.click(function(){var i=c.$btns.index(a(this));c.slideTo(i)})}else{if(c.opts.switchMode=="hover"){c.$btns.hover(function(){var i=c.$btns.index(a(this));c.slideTo(i)})}}};c.createText=function(){var f={};switch(c.opts.buttonPosition){case"leftTop":f={left:0,top:0,textAlign:"right"};c.textPosition="top";break;case"rightTop":f={left:0,top:0,textAlign:"left"};c.textPosition="top";break;case"rightBottom":f={left:0,bottom:0,textAlign:"left"};c.textPosition="bottom";break;case"leftBottom":f={left:0,bottom:0,textAlign:"right"};c.textPosition="bottom";break}if(c.opts.textPosition){switch(c.opts.textPosition){case"top":f.left=0;f.top=0;break;case"bottom":f.left=0;f.bottom=0;break}c.textPosition=c.opts.textPosition}if(c.opts.textAlign){f.textAlign=c.opts.textAlign}a('<div class="smallslider-tex smallslider-lay"></div>').css(f).css({opacity:0.39}).appendTo(c.$elm);var e=c.$ims.eq(0).attr("alt");if(c.opts.textLink){e='<a href="'+c.$ims.eq(0).parent("a").attr("href")+'">'+e+"</a>"}a('<h3 class="smallslider-tex"></h3>').css(f).html(e).appendTo(c.$elm);c.$h3=c.$elm.find("h3");c.$lay=c.$elm.find("div.smallslider-lay");c.$tex=c.$elm.find(".smallslider-tex")};c.onImage=function(){c.$ims.hover(function(){c.stopSlider()},function(){c.slideTo(c.current+1)})};c.slideTo=function(f){c.stopSlider();if(f>c.itemNums-1){f=0}if(f<0){f=c.itemNums-1}c.$lis.removeClass("current-li").eq(f).addClass("current-li");if(c.opts.showButtons){c.$btns.removeClass("current-btn");c.$btns.eq(f).addClass("current-btn")}c.slideText(f);var g="";var i=0;switch(c.opts.switchPath){case"left":g="left";i=c.width;break;case"up":default:g="top";i=c.height;break}var e=-1*f*i;var h=c.opts.switchEase;switch(c.opts.switchEffect){case"fadeOut":c.$lis.stop(true,false);c.$lis.css({zIndex:1,opacity:1}).hide();c.$lis.eq(c.current).css({zIndex:3}).show();c.$lis.eq(f).css({zIndex:2}).show();if(c.current!=f){c.$lis.eq(c.current).fadeOut(c.opts.switchTime,function(){c.$lis.css({zIndex:1});c.$lis.eq(f).css({zIndex:3,opacity:1}).show()})}break;case"ease":c.$ul.stop(true,false);if(g=="top"){c.$ul.animate({top:e},{duration:c.opts.switchTime,easing:h,complete:function(){}})}else{if(g=="left"){c.$ul.animate({left:e},{duration:c.opts.switchTime,easing:h,complete:function(){}})}}break;case"none":default:c.$lis.eq(c.current).hide();c.$lis.eq(f).show();break}c.current=f;c.startSlider(f+1)};c.slideText=function(g){if(c.opts.showText){var f=c.$ims.eq(g).attr("alt");if(c.opts.textLink){f='<a href="'+c.$ims.eq(g).parent("a").attr("href")+'">'+f+"</a>"}c.$h3.html(f);if(c.opts.textSwitch>0){var e=c.$h3.height();var i={},h={};if(c.textPosition=="top"){i={top:-1*e};h={top:0}}else{if(c.textPosition=="bottom"){i={bottom:-1*e};h={bottom:0}}}if(c.opts.textSwitch==1){c.$h3.stop(true,false).animate(i,{duration:200,easing:"easeOutQuad"}).animate(h,{duration:200,easing:"easeOutQuad"})}else{if(c.opts.textSwitch==2){c.$tex.stop(true,false).animate(i,{duration:200,easing:"easeOutQuad"}).animate(h,{duration:200,easing:"easeOutQuad"})}}}}};c.startSlider=function(f){var e=setTimeout(function(){c.slideTo(f)},c.opts.time);c.sliderTimer=e};c.stopSlider=function(){if(c.sliderTimer){clearTimeout(c.sliderTimer)}c.sliderTimer=null};c.init()};a.smallslider.defaults={time:3000,autoStart:true,onImageStop:false,switchMode:"hover",switchEffect:"fadeOut",switchPath:"left",switchEase:"easeOutQuart",switchTime:600,buttonPosition:"rightBottom",buttonOffsetX:10,buttonOffsetY:4,buttonSpace:4,showText:true,showButtons:true,textLink:true,textSwitch:0,textPosition:"",textAlign:""};a.fn.smallslider=function(b){return this.each(function(c){(new a.smallslider(this,b))})}})(jQuery);$.smallslider.switchEases=["easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce"];jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;i=j/4}else{i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;i=j/4}else{i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;i=j/4}else{i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});

