/* jQuery Cycle Plugin 2.97 (with Transition Definitions), Copyright: M. Alsup, Dual licensed under the MIT and GPL licenses., http://jquery.malsup.com/license.html */
(function(e){function o(a){e.fn.cycle.debug&&l(a)}function l(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function z(a,b,d){function g(c,i,h){if(!c&&i===true){c=e(h).data("cycle.opts");if(!c){l("options not found, can not resume");return false}if(h.cycleTimeout){clearTimeout(h.cycleTimeout);h.cycleTimeout=0}r(c.elements,c,1,!c.backwards)}}if(a.cycleStop==undefined)a.cycleStop=0;if(b===undefined||b===null)b={};if(b.constructor==String){switch(b){case "destroy":case "stop":d= e(a).data("cycle.opts");if(!d)return false;a.cycleStop++;a.cycleTimeout&&clearTimeout(a.cycleTimeout);a.cycleTimeout=0;e(a).removeData("cycle.opts");b=="destroy"&&A(d);return false;case "toggle":a.cyclePause=a.cyclePause===1?0:1;g(a.cyclePause,d,a);return false;case "pause":a.cyclePause=1;return false;case "resume":a.cyclePause=0;g(false,d,a);return false;case "prev":case "next":d=e(a).data("cycle.opts");if(!d){l('options not found, "prev/next" ignored');return false}e.fn.cycle[b](d);return false; default:b={fx:b}}return b}else if(b.constructor==Number){var f=b;b=e(a).data("cycle.opts");if(!b){l("options not found, can not advance slide");return false}if(f<0||f>=b.elements.length){l("invalid slide index: "+f);return false}b.nextSlide=f;if(a.cycleTimeout){clearTimeout(a.cycleTimeout);a.cycleTimeout=0}if(typeof d=="string")b.oneTimeFx=d;r(b.elements,b,1,f>=b.currSlide);return false}return b}function v(a,b){if(!e.support.opacity&&b.cleartype&&a.style.filter)try{a.style.removeAttribute("filter")}catch(d){}} function A(a){a.next&&e(a.next).unbind(a.prevNextEvent);a.prev&&e(a.prev).unbind(a.prevNextEvent);if(a.pager||a.pagerAnchorBuilder)e.each(a.pagerAnchors||[],function(){this.unbind().remove()});a.pagerAnchors=null;a.destroy&&a.destroy(a)}function B(a,b,d,g,f){var c=e.extend({},e.fn.cycle.defaults,g||{},e.metadata?a.metadata():e.meta?a.data():{});if(c.autostop)c.countdown=c.autostopCount||d.length;var i=a[0];a.data("cycle.opts",c);c.$cont=a;c.stopCount=i.cycleStop;c.elements=d;c.before=c.before?[c.before]: [];c.after=c.after?[c.after]:[];!e.support.opacity&&c.cleartype&&c.after.push(function(){v(this,c)});c.continuous&&c.after.push(function(){r(d,c,0,!c.backwards)});C(c);!e.support.opacity&&c.cleartype&&!c.cleartypeNoBg&&w(b);a.css("position")=="static"&&a.css("position","relative");c.width&&a.width(c.width);c.height&&c.height!="auto"&&a.height(c.height);if(c.startingSlide)c.startingSlide=parseInt(c.startingSlide);else if(c.backwards)c.startingSlide=d.length-1;if(c.random){c.randomMap=[];for(i=0;i< d.length;i++)c.randomMap.push(i);c.randomMap.sort(function(){return Math.random()-0.5});c.randomIndex=1;c.startingSlide=c.randomMap[1]}else if(c.startingSlide>=d.length)c.startingSlide=0;c.currSlide=c.startingSlide||0;var h=c.startingSlide;b.css({position:"absolute",top:0,left:0}).hide().each(function(j){j=c.backwards?h?j<=h?d.length+(j-h):h-j:d.length-j:h?j>=h?d.length-(j-h):h-j:d.length-j;e(this).css("z-index",j)});e(d[h]).css("opacity",1).show();v(d[h],c);c.fit&&c.width&&b.width(c.width);c.fit&& c.height&&c.height!="auto"&&b.height(c.height);if(c.containerResize&&!a.innerHeight()){for(var k=i=0,m=0;m<d.length;m++){var n=e(d[m]),q=n[0],s=n.outerWidth(),t=n.outerHeight();s||(s=q.offsetWidth||q.width||n.attr("width"));t||(t=q.offsetHeight||q.height||n.attr("height"));i=s>i?s:i;k=t>k?t:k}i>0&&k>0&&a.css({width:i+"px",height:k+"px"})}c.pause&&a.hover(function(){this.cyclePause++},function(){this.cyclePause--});if(D(c)===false)return false;var x=false;g.requeueAttempts=g.requeueAttempts||0;b.each(function(){var j= e(this);this.cycleH=c.fit&&c.height?c.height:j.height()||this.offsetHeight||this.height||j.attr("height")||0;this.cycleW=c.fit&&c.width?c.width:j.width()||this.offsetWidth||this.width||j.attr("width")||0;if(j.is("img")){j=e.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var E=e.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,F=this.cycleH==0&&this.cycleW==0&&!this.complete;if(e.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete|| j||E||F)if(f.s&&c.requeueOnImageNotLoaded&&++g.requeueAttempts<100){l(g.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){e(f.s,f.c).cycle(g)},c.requeueTimeout);x=true;return false}else l("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}return true});if(x)return false;c.cssBefore=c.cssBefore||{};c.cssAfter=c.cssAfter||{};c.cssFirst=c.cssFirst||{};c.animIn=c.animIn||{};c.animOut=c.animOut||{};b.not(":eq("+ h+")").css(c.cssBefore);e(b[h]).css(c.cssFirst);if(c.timeout){c.timeout=parseInt(c.timeout);if(c.speed.constructor==String)c.speed=e.fx.speeds[c.speed]||parseInt(c.speed);c.sync||(c.speed/=2);for(i=c.fx=="none"?0:c.fx=="shuffle"?500:250;c.timeout-c.speed<i;)c.timeout+=c.speed}if(c.easing)c.easeIn=c.easeOut=c.easing;if(!c.speedIn)c.speedIn=c.speed;if(!c.speedOut)c.speedOut=c.speed;c.slideCount=d.length;c.currSlide=c.lastSlide=h;if(c.random){if(++c.randomIndex==d.length)c.randomIndex=0;c.nextSlide= c.randomMap[c.randomIndex]}else c.nextSlide=c.backwards?c.startingSlide==0?d.length-1:c.startingSlide-1:c.startingSlide>=d.length-1?0:c.startingSlide+1;if(!c.multiFx){i=e.fn.cycle.transitions[c.fx];if(e.isFunction(i))i(a,b,c);else if(c.fx!="custom"&&!c.multiFx){l("unknown transition: "+c.fx,"; slideshow terminating");return false}}a=b[h];c.before.length&&c.before[0].apply(a,[a,a,c,true]);c.after.length>1&&c.after[1].apply(a,[a,a,c,true]);c.next&&e(c.next).bind(c.prevNextEvent,function(){return u(c, 1)});c.prev&&e(c.prev).bind(c.prevNextEvent,function(){return u(c,0)});if(c.pager||c.pagerAnchorBuilder)G(d,c);H(c,d);return c}function C(a){a.original={before:[],after:[]};a.original.cssBefore=e.extend({},a.cssBefore);a.original.cssAfter=e.extend({},a.cssAfter);a.original.animIn=e.extend({},a.animIn);a.original.animOut=e.extend({},a.animOut);e.each(a.before,function(){a.original.before.push(this)});e.each(a.after,function(){a.original.after.push(this)})}function D(a){var b,d,g=e.fn.cycle.transitions; if(a.fx.indexOf(",")>0){a.multiFx=true;a.fxs=a.fx.replace(/\s*/g,"").split(",");for(b=0;b<a.fxs.length;b++){var f=a.fxs[b];d=g[f];if(!d||!g.hasOwnProperty(f)||!e.isFunction(d)){l("discarding unknown transition: ",f);a.fxs.splice(b,1);b--}}if(!a.fxs.length){l("No valid transitions named; slideshow terminating.");return false}}else if(a.fx=="all"){a.multiFx=true;a.fxs=[];for(p in g){d=g[p];g.hasOwnProperty(p)&&e.isFunction(d)&&a.fxs.push(p)}}if(a.multiFx&&a.randomizeEffects){d=Math.floor(Math.random()* 20)+30;for(b=0;b<d;b++)a.fxs.push(a.fxs.splice(Math.floor(Math.random()*a.fxs.length),1)[0]);o("randomized fx sequence: ",a.fxs)}return true}function H(a,b){a.addSlide=function(d,g){var f=e(d),c=f[0];a.autostopCount||a.countdown++;b[g?"unshift":"push"](c);if(a.els)a.els[g?"unshift":"push"](c);a.slideCount=b.length;f.css("position","absolute");f[g?"prependTo":"appendTo"](a.$cont);if(g){a.currSlide++;a.nextSlide++}!e.support.opacity&&a.cleartype&&!a.cleartypeNoBg&&w(f);a.fit&&a.width&&f.width(a.width); a.fit&&a.height&&a.height!="auto"&&f.height(a.height);c.cycleH=a.fit&&a.height?a.height:f.height();c.cycleW=a.fit&&a.width?a.width:f.width();f.css(a.cssBefore);if(a.pager||a.pagerAnchorBuilder)e.fn.cycle.createPagerAnchor(b.length-1,c,e(a.pager),b,a);e.isFunction(a.onAddSlide)?a.onAddSlide(f):f.hide()}}function r(a,b,d,g){if(d&&b.busy&&b.manualTrump){o("manualTrump in go(), stopping active transition");e(a).stop(true,true);b.busy=0}if(b.busy)o("transition active, ignoring new tx request");else{var f= b.$cont[0],c=a[b.currSlide],i=a[b.nextSlide];if(!(f.cycleStop!=b.stopCount||f.cycleTimeout===0&&!d))if(!d&&!f.cyclePause&&!b.bounce&&(b.autostop&&--b.countdown<=0||b.nowrap&&!b.random&&b.nextSlide<b.currSlide))b.end&&b.end(b);else{var h=false;if((d||!f.cyclePause)&&b.nextSlide!=b.currSlide){h=true;var k=b.fx;c.cycleH=c.cycleH||e(c).height();c.cycleW=c.cycleW||e(c).width();i.cycleH=i.cycleH||e(i).height();i.cycleW=i.cycleW||e(i).width();if(b.multiFx){if(b.lastFx==undefined||++b.lastFx>=b.fxs.length)b.lastFx= 0;k=b.fxs[b.lastFx];b.currFx=k}if(b.oneTimeFx){k=b.oneTimeFx;b.oneTimeFx=null}e.fn.cycle.resetState(b,k);b.before.length&&e.each(b.before,function(n,q){f.cycleStop==b.stopCount&&q.apply(i,[c,i,b,g])});var m=function(){b.busy=0;e.each(b.after,function(n,q){f.cycleStop==b.stopCount&&q.apply(i,[c,i,b,g])})};o("tx firing("+k+"); currSlide: "+b.currSlide+"; nextSlide: "+b.nextSlide);b.busy=1;if(b.fxFn)b.fxFn(c,i,b,m,g,d&&b.fastOnEvent);else e.isFunction(e.fn.cycle[b.fx])?e.fn.cycle[b.fx](c,i,b,m,g,d&& b.fastOnEvent):e.fn.cycle.custom(c,i,b,m,g,d&&b.fastOnEvent)}if(h||b.nextSlide==b.currSlide){b.lastSlide=b.currSlide;if(b.random){b.currSlide=b.nextSlide;if(++b.randomIndex==a.length)b.randomIndex=0;b.nextSlide=b.randomMap[b.randomIndex];if(b.nextSlide==b.currSlide)b.nextSlide=b.currSlide==b.slideCount-1?0:b.currSlide+1}else if(b.backwards)if((d=b.nextSlide-1<0)&&b.bounce){b.backwards=!b.backwards;b.nextSlide=1;b.currSlide=0}else{b.nextSlide=d?a.length-1:b.nextSlide-1;b.currSlide=d?0:b.nextSlide+ 1}else if((d=b.nextSlide+1==a.length)&&b.bounce){b.backwards=!b.backwards;b.nextSlide=a.length-2;b.currSlide=a.length-1}else{b.nextSlide=d?0:b.nextSlide+1;b.currSlide=d?a.length-1:b.nextSlide-1}}h&&b.pager&&b.updateActivePagerLink(b.pager,b.currSlide,b.activePagerClass);h=0;if(b.timeout&&!b.continuous)h=y(a[b.currSlide],a[b.nextSlide],b,g);else if(b.continuous&&f.cyclePause)h=10;if(h>0)f.cycleTimeout=setTimeout(function(){r(a,b,0,!b.backwards)},h)}}}function y(a,b,d,g){if(d.timeoutFn){for(a=d.timeoutFn.call(a, a,b,d,g);d.fx!="none"&&a-d.speed<250;)a+=d.speed;o("calculated timeout: "+a+"; speed: "+d.speed);if(a!==false)return a}return d.timeout}function u(a,b){var d=b?1:-1,g=a.elements,f=a.$cont[0],c=f.cycleTimeout;if(c){clearTimeout(c);f.cycleTimeout=0}if(a.random&&d<0){a.randomIndex--;if(--a.randomIndex==-2)a.randomIndex=g.length-2;else if(a.randomIndex==-1)a.randomIndex=g.length-1;a.nextSlide=a.randomMap[a.randomIndex]}else if(a.random)a.nextSlide=a.randomMap[a.randomIndex];else{a.nextSlide=a.currSlide+ d;if(a.nextSlide<0){if(a.nowrap)return false;a.nextSlide=g.length-1}else if(a.nextSlide>=g.length){if(a.nowrap)return false;a.nextSlide=0}}f=a.onPrevNextEvent||a.prevNextClick;e.isFunction(f)&&f(d>0,a.nextSlide,g[a.nextSlide]);r(g,a,1,b);return false}function G(a,b){var d=e(b.pager);e.each(a,function(g,f){e.fn.cycle.createPagerAnchor(g,f,d,a,b)});b.updateActivePagerLink(b.pager,b.startingSlide,b.activePagerClass)}function w(a){function b(g){g=parseInt(g).toString(16);return g.length<2?"0"+g:g}function d(g){for(;g&& g.nodeName.toLowerCase()!="html";g=g.parentNode){var f=e.css(g,"background-color");if(f.indexOf("rgb")>=0){g=f.match(/\d+/g);return"#"+b(g[0])+b(g[1])+b(g[2])}if(f&&f!="transparent")return f}return"#ffffff"}o("applying clearType background-color hack");a.each(function(){e(this).css("background-color",d(this))})}if(e.support==undefined)e.support={opacity:!e.browser.msie};e.expr[":"].paused=function(a){return a.cyclePause};e.fn.cycle=function(a,b){var d={s:this.selector,c:this.context};if(this.length=== 0&&a!="stop"){if(!e.isReady&&d.s){l("DOM not ready, queuing slideshow");e(function(){e(d.s,d.c).cycle(a,b)});return this}l("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var g=z(this,a,b);if(g!==false){g.updateActivePagerLink=g.updateActivePagerLink||e.fn.cycle.updateActivePagerLink;this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var f=e(this),c=g.slideExpr?e(g.slideExpr,this):f.children(), i=c.get();if(i.length<2)l("terminating; too few slides: "+i.length);else{var h=B(f,c,i,g,d);if(h!==false)if(f=h.continuous?10:y(i[h.currSlide],i[h.nextSlide],h,!h.backwards)){f+=h.delay||0;if(f<10)f=10;o("first timeout: "+f);this.cycleTimeout=setTimeout(function(){r(i,h,0,!g.backwards)},f)}}}})};e.fn.cycle.resetState=function(a,b){b=b||a.fx;a.before=[];a.after=[];a.cssBefore=e.extend({},a.original.cssBefore);a.cssAfter=e.extend({},a.original.cssAfter);a.animIn=e.extend({},a.original.animIn);a.animOut= e.extend({},a.original.animOut);a.fxFn=null;e.each(a.original.before,function(){a.before.push(this)});e.each(a.original.after,function(){a.after.push(this)});var d=e.fn.cycle.transitions[b];e.isFunction(d)&&d(a.$cont,e(a.elements),a)};e.fn.cycle.updateActivePagerLink=function(a,b,d){e(a).each(function(){e(this).children().removeClass(d).eq(b).addClass(d)})};e.fn.cycle.next=function(a){u(a,1)};e.fn.cycle.prev=function(a){u(a,0)};e.fn.cycle.createPagerAnchor=function(a,b,d,g,f){if(e.isFunction(f.pagerAnchorBuilder)){b= f.pagerAnchorBuilder(a,b);o("pagerAnchorBuilder("+a+", el) returned: "+b)}else b='<a href="#">'+(a+1)+"</a>";if(b){var c=e(b);if(c.parents("body").length===0){var i=[];if(d.length>1){d.each(function(){var h=c.clone(true);e(this).append(h);i.push(h[0])});c=e(i)}else c.appendTo(d)}f.pagerAnchors=f.pagerAnchors||[];f.pagerAnchors.push(c);c.bind(f.pagerEvent,function(h){h.preventDefault();f.nextSlide=a;h=f.$cont[0];var k=h.cycleTimeout;if(k){clearTimeout(k);h.cycleTimeout=0}h=f.onPagerEvent||f.pagerClick; e.isFunction(h)&&h(f.nextSlide,g[f.nextSlide]);r(g,f,1,f.currSlide<a)});!/^click/.test(f.pagerEvent)&&!f.allowPagerClickBubble&&c.bind("click.cycle",function(){return false});f.pauseOnPagerHover&&c.hover(function(){f.$cont[0].cyclePause++},function(){f.$cont[0].cyclePause--})}};e.fn.cycle.hopsFromLast=function(a,b){var d=a.lastSlide,g=a.currSlide;return b?g>d?g-d:a.slideCount-d:g<d?d-g:d+a.slideCount-g};e.fn.cycle.commonReset=function(a,b,d,g,f,c){e(d.elements).not(a).hide();if(typeof d.cssBefore.opacity== "undefined")d.cssBefore.opacity=1;d.cssBefore.display="block";if(d.slideResize&&g!==false&&b.cycleW>0)d.cssBefore.width=b.cycleW;if(d.slideResize&&f!==false&&b.cycleH>0)d.cssBefore.height=b.cycleH;d.cssAfter=d.cssAfter||{};d.cssAfter.display="none";e(a).css("zIndex",d.slideCount+(c===true?1:0));e(b).css("zIndex",d.slideCount+(c===true?0:1))};e.fn.cycle.custom=function(a,b,d,g,f,c){var i=e(a),h=e(b),k=d.speedIn;a=d.speedOut;var m=d.easeIn;b=d.easeOut;h.css(d.cssBefore);if(c){k=typeof c=="number"?a= c:a=1;m=b=null}var n=function(){h.animate(d.animIn,k,m,function(){g()})};i.animate(d.animOut,a,b,function(){i.css(d.cssAfter);d.sync||n()});d.sync&&n()};e.fn.cycle.transitions={fade:function(a,b,d){b.not(":eq("+d.currSlide+")").css("opacity",0);d.before.push(function(g,f,c){e.fn.cycle.commonReset(g,f,c);c.cssBefore.opacity=0});d.animIn={opacity:1};d.animOut={opacity:0};d.cssBefore={top:0,left:0}}};e.fn.cycle.ver=function(){return"2.97"};e.fn.cycle.defaults={activePagerClass:"activeSlide",after:null, allowPagerClickBubble:false,animIn:null,animOut:null,autostop:0,autostopCount:0,backwards:false,before:null,cleartype:!e.support.opacity,cleartypeNoBg:false,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle", random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,slideExpr:null,slideResize:1,speed:1E3,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4E3,timeoutFn:null,updateActivePagerLink:null}})(jQuery);
$("#s2").cycle({fx:"fade",speed:"2000",timeout:0,next:"#next",prev:"#prev",after:onAfter});function onAfter(a,c,b){a=""+(b.currSlide+1)+"/"+b.slideCount;$("#counter").html(a)};

