;(function(a){a.fn.sliderplay=function(b){var c={btnbox:'btnbox',btncurclassname:'cur',direction:'left',mouseevent:'click',speed:600,timeout:5000};var b=a.extend(c,b),d=a(this),e=d.find('ul'),f=e.find('li').first(),g=a('#'+b.btnbox).children(),h=e.find('img'),i=h.length,j=h.first().outerwidth(),k=h.first().outerheight(),l=null,m=0,n=0,o=true;var p={init:function(){this.move();this.setcss();l=setinterval(p.tabchange,b.timeout);p.addevent(b.mouseevent);this.pause()},setcss:function(){switch(b.direction){case'left':e.css('width',j*i+'px');break;case'top':e.css('height',i*k+'px');break}},move:function(){e.stop(true);g.removeclass(b.btncurclassname).eq(n).addclass(b.btncurclassname);if(b.direction=='left'){e.animate({left:-j*m+'px'},b.speed,function(){if(!o){f.css({position:'static',left:0});e.css('left',0);m=0;o=true}})}else{e.animate({top:-k*m+'px'},b.speed,function(){if(!o){f.css({position:'static',top:0});e.css('top',0);m=0;o=true}})}},tabchange:function(){m++;n++;if(m==i){n=0;(b.direction=='left')?f.css({position:'relative',left:i*j}):f.css({position:'relative',top:i*k});o=false};p.move()},addevent:function(q){switch(q){case'click':g.click(function(){if(m==a(this).index()){return};m=n=a(this).index();clearinterval(l);p.move();l=setinterval(p.tabchange,b.timeout)});break;case'hover':g.hover(function(){m=n=a(this).index();clearinterval(l);p.move()},function(){l=setinterval(p.tabchange,b.timeout)});break}},pause:function(){e.hover(function(){clearinterval(l)},function(){l=setinterval(p.tabchange,b.timeout)})}};p.init()}})(jquery);