/*
 *	soChange 1.4 - simple gallery with jQuery
 *	made by bujichong 2009-12-14
 *	作者：不羁虫  2009-12-14
 * Download by http://sc.xueit.com
 * http://hi.baidu.com/bujichong/
 */
(function(c){c.fn.soChange=function(d){return new a(this,d)};var b={thumbObj:null,botPrev:null,botNext:null,thumbNowClass:"now",thumbOverEvent:true,slideTime:1000,autoChange:true,clickFalse:true,overStop:true,changeTime:5000,delayTime:300};c.soChangeLong=function(k,f){this.options=c.extend({},b,f||{});var l=c(k);var m=this.options;var n;var q=l.size();var h=0;var j;var d;var i;l.hide();l.eq(0).show();function g(){if(h!=j){if(m.thumbObj!=null){c(m.thumbObj).removeClass(m.thumbNowClass).eq(j).addClass(m.thumbNowClass)}if(m.slideTime<=0){l.eq(h).hide();l.eq(j).show()}else{l.eq(h).fadeOut(m.slideTime);l.eq(j).fadeIn(m.slideTime)}h=j;if(m.autoChange==true){clearInterval(d);d=setInterval(p,m.changeTime)}}}function p(){j=(h+1)%q;g()}if(m.thumbObj!=null){n=c(m.thumbObj);n.removeClass(m.thumbNowClass).eq(0).addClass(m.thumbNowClass);n.click(function(){j=n.index(c(this));g();if(m.clickFalse==true){return false}});if(m.thumbOverEvent==true){n.mouseenter(function(){j=n.index(c(this));i=setTimeout(g,m.delayTime)});n.mouseleave(function(){clearTimeout(i)})}}if(m.botNext!=null){c(m.botNext).click(function(){if(l.queue().length<1){p()}return false})}if(m.botPrev!=null){c(m.botPrev).click(function(){if(l.queue().length<1){j=(h+q-1)%q;g()}return false})}if(m.autoChange==true){d=setInterval(p,m.changeTime);if(m.overStop==true){l.mouseenter(function(){clearInterval(d)});l.mouseleave(function(){d=setInterval(p,m.changeTime)})}}};var a=c.soChangeLong})(jQuery);
