(function($){$.fn.simpleshow=function(b){var c=$.extend({},$.fn.simpleshow.defaults,b);var d=this;var e=null;d.css({position:'relative'});d.children().each(function(){$(this).hide();$(this).css({position:'absolute',top:0,left:0})});var f=d.children('.active');if(f.length==0){f=d.children(':first');f.addClass('active')}if(c.pagination!=null){$(c.pagination).children(':first').addClass('active')}f.fadeIn(0);$.extend(this,{start:function(){if(e==null){e=setInterval(function(){_switchSlide(d,c)},c.speed)}},pause:function(a){clearInterval(e);e=null},next:function(){this.pause();_switchSlide(d,c);this.start()},prev:function(){this.pause();_switchSlide(d,c,'prev');this.start()},goTo:function(a){this.pause();_switchSlide(d,c,null,a);this.start()}});return this};function _switchSlide(a,b,c,d){var c=(c==null)?"next":c;if(b.pagination!=null){var e=$(b.pagination);var f=e.children('.active');if(d!=null){$nextPagi=e.children().eq(d)}else{if(c=='next'){$nextPagi=f.next().length?f.next():e.children(':first')}else if(c=='prev'){$nextPagi=f.prev().length?f.prev():e.children(':last')}}f.removeClass('active');$nextPagi.addClass('active')}var g=a.children('.active');var h=null;if(d!=null){h=a.children().eq(d)}else{if(c=='next'){h=g.next().length?g.next():a.children(':first')}else if(c=='prev'){h=g.prev().length?g.prev():a.children(':last')}}g.fadeOut(b.fadeSpeed,function(){g.removeClass('active')});h.fadeIn(b.fadeSpeed,function(){h.addClass('active')})}$.fn.simpleshow.defaults={speed:5000,childType:'img',fadeSpeed:1000,pagination:null}})(jQuery);

