/**
 * These Days jQuery Slideshow Plugin v1.0.1
 * @link http://playground.thesedays.com/tdslideshow/
 * @author Keegan Street
 */
(function(f){var g,b,d,e,a,c=window.Modernizr&&window.Modernizr.csstransitions;g=function(h){var i={timeout:2000,speed:1000,fastSpeed:100,beforeTransition:null,currentClass:"current"};return this.each(function(){var j=f(this),k=j.data("tdslideshow");if(!k){k={};k.animating=false;k.stopped=false;k.options=f.extend(i,h);k.$children=j.children();k.currentIndex=0;k.$current=k.$children.eq(0).addClass(k.options.currentClass);k.timeoutId=setTimeout(function(){e(j);},k.options.timeout);if(c){k.$current.siblings().css({opacity:0});}else{k.$current.siblings().hide();}j.data("tdslideshow",k);}});};b=function(h){return this.each(function(){e(f(this),h);});};d=function(){return this.each(function(){var h=f(this),i=h.data("tdslideshow");if(!i||!i.timeoutId){return;}i.stopped=true;clearTimeout(i.timeoutId);h.data("tdslideshow",i);});};e=function(k,i){var m=k.data("tdslideshow"),j,l,h;if(!m){return;}if(m.animating){return;}m.animating=true;if(typeof i==="number"){if(m.currentIndex===i){m.animating=false;return;}m.currentIndex=i;l=m.options.fastSpeed;k.addClass("fastSpeed");}else{m.currentIndex=m.$current.index()+1;l=m.options.speed;k.removeClass("fastSpeed");}if(m.currentIndex>=m.$children.length){m.currentIndex=0;}j=m.$children.eq(m.currentIndex);clearTimeout(m.timeoutId);if(typeof m.options.beforeTransition==="function"){m.options.beforeTransition.apply(this,[m.currentIndex]);}m.$current.removeClass(m.options.currentClass);j.addClass(m.options.currentClass);if(c){j.bind("transitionend oTransitionEnd webkitTransitionEnd",function(){j.unbind("transitionend oTransitionEnd webkitTransitionEnd");h();});j.css({opacity:1});}else{j.fadeIn(l,function(){h();});}h=function(){if(c){m.$current.css({opacity:0});}else{m.$current.hide();}m.$current=j;if(m.stopped){delete m.timeoutId;}else{m.timeoutId=setTimeout(function(){e(k);},m.options.timeout);}m.animating=false;k.data("tdslideshow",m);};};a={init:g,gotoSlide:b,stop:d};f.fn.tdslideshow=function(h){if(a[h]){return a[h].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof h==="object"||!h){return a.init.apply(this,arguments);}else{f.error("Method "+h+" does not exist on jQuery.tdslideshow");}}};}(jQuery));


