(function(a){a.fn.extend({firstnlast:function(){a(this).filter(":first-child:not(:last-child)").addClass("first").end().filter(":last-child:not(:first-child)").addClass("last")}})})(jQuery);(function(a){a.fn.tallest=function(f,d){return this.each(function(){var g=a(this),b=0;a(f,this).each(function(){var e=a(this);e.height()>b&&(b=e.height())});g.height(b+d)})}})(jQuery);
(function(a){function f(d,b,e,i){if(!b.busy){var c=d[0].parentNode,j=d[b.currSlide],h=d[b.nextSlide];if(c.cycleTimeout!==0||e){if(e||!c.cyclePause){b.before.length&&a.each(b.before,function(a,c){c.apply(h,[j,h,b,i])});e=function(){a.browser.msie&&this.style.removeAttribute("filter");a.each(b.after,function(a,c){c.apply(h,[j,h,b,i])})};if(b.nextSlide!=b.currSlide)b.busy=1,a.fn.cycle.custom(j,h,b,e);e=b.nextSlide+1==d.length;b.nextSlide=e?0:b.nextSlide+1;b.currSlide=e?d.length-1:b.nextSlide-1}if(b.timeout)c.cycleTimeout=
setTimeout(function(){f(d,b,0,!b.rev)},b.timeout)}}}function d(a,b,e){var d=a[0].parentNode,c=d.cycleTimeout;if(c)clearTimeout(c),d.cycleTimeout=0;b.nextSlide=b.currSlide+e;if(b.nextSlide<0)b.nextSlide=a.length-1;else if(b.nextSlide>=a.length)b.nextSlide=0;f(a,b,1,e>=0);return!1}a.fn.cycle=function(g){return this.each(function(){g=g||{};this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cyclePause=this.cycleTimeout=0;var b=a(this),e=g.slideExpr?a(g.slideExpr,this):b.children(),i=e.get();if(i.length<
2)window.console&&window.console.log&&window.console.log("terminating; too few slides: "+i.length);else{var c=a.extend({},a.fn.cycle.defaults,g||{},a.metadata?b.metadata():a.meta?b.data():{});c.before=c.before?[c.before]:[];c.after=c.after?[c.after]:[];c.after.unshift(function(){c.busy=0});var j=this.className;c.width=parseInt((j.match(/w:(\d+)/)||[])[1])||c.width;c.height=parseInt((j.match(/h:(\d+)/)||[])[1])||c.height;c.timeout=parseInt((j.match(/t:(\d+)/)||[])[1])||c.timeout;b.css("position")==
"static"&&b.css("position","relative");c.width&&b.width(c.width);c.height&&c.height!="auto"&&b.height(c.height);e.css({position:"absolute",top:0,left:0}).hide().each(function(b){a(this).css("z-index",i.length-b)});a(i[0]).css("opacity",1).show();a.browser.msie&&i[0].style.removeAttribute("filter");c.fit&&c.width&&e.width(c.width);c.fit&&c.height&&c.height!="auto"&&e.height(c.height);c.pause&&b.hover(function(){this.cyclePause=1},function(){this.cyclePause=0});a.fn.cycle.transitions.fade(b,e,c);e.each(function(){var b=
a(this);this.cycleH=c.fit&&c.height?c.height:b.height();this.cycleW=c.fit&&c.width?c.width:b.width()});e.not(":eq(0)").css({opacity:0});c.cssFirst&&a(e[0]).css(c.cssFirst);if(c.timeout){if(c.speed.constructor==String)c.speed={slow:600,fast:200}[c.speed]||400;for(c.sync||(c.speed/=2);c.timeout-c.speed<250;)c.timeout+=c.speed}c.speedIn=c.speed;c.speedOut=c.speed;c.slideCount=i.length;c.currSlide=0;c.nextSlide=1;b=e[0];c.before.length&&c.before[0].apply(b,[b,b,c,!0]);c.after.length>1&&c.after[1].apply(b,
[b,b,c,!0]);if(c.click&&!c.next)c.next=c.click;c.next&&a(c.next).bind("click",function(){return d(i,c,c.rev?-1:1)});c.prev&&a(c.prev).bind("click",function(){return d(i,c,c.rev?1:-1)});if(c.timeout)this.cycleTimeout=setTimeout(function(){f(i,c,0,!c.rev)},c.timeout+(c.delay||0))}})};a.fn.cycle.custom=function(d,b,e,i){var c=a(d),f=a(b);f.css({opacity:0});var h=function(){f.animate({opacity:1},e.speedIn,e.easeIn,i)};c.animate({opacity:0},e.speedOut,e.easeOut,function(){c.css({display:"none"});e.sync||
h()});e.sync&&h()};a.fn.cycle.transitions={fade:function(d,b,e){b.not(":eq(0)").css("opacity",0);e.before.push(function(){a(this).show()})}};a.fn.cycle.ver=function(){return"Lite-1.0"};a.fn.cycle.defaults={timeout:4E3,speed:1E3,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);
(function(a){function f(a){return typeof a=="object"?a:{top:a,left:a}}var d=a.scrollTo=function(d,b,e){a(window).scrollTo(d,b,e)};d.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1};d.window=function(){return a(window)._scrollable()};a.fn._scrollable=function(){return this.map(function(){if(this.nodeName&&a.inArray(this.nodeName.toLowerCase(),["iframe","#document","html","body"])==-1)return this;var d=(this.contentWindow||this).document||this.ownerDocument||this;return a.browser.safari||
d.compatMode=="BackCompat"?d.body:d.documentElement})};a.fn.scrollTo=function(g,b,e){typeof b=="object"&&(e=b,b=0);typeof e=="function"&&(e={onAfter:e});g=="max"&&(g=9E9);e=a.extend({},d.defaults,e);b=b||e.speed||e.duration;e.queue=e.queue&&e.axis.length>1;e.queue&&(b/=2);e.offset=f(e.offset);e.over=f(e.over);return this._scrollable().each(function(){function i(a){j.animate(k,b,e.easing,a&&function(){a.call(this,g,e)})}var c=this,j=a(c),h=g,m,k={},p=j.is("html,body");switch(typeof h){case "number":case "string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(h)){h=
f(h);break}h=a(h,this);case "object":if(h.is||h.style)m=(h=a(h)).offset()}a.each(e.axis.split(""),function(a,b){var f=b=="x"?"Left":"Top",g=f.toLowerCase(),l="scroll"+f,n=c[l],o=d.max(c,b);m?(k[l]=m[g]+(p?0:n-j.offset()[g]),e.margin&&(k[l]-=parseInt(h.css("margin"+f))||0,k[l]-=parseInt(h.css("border"+f+"Width"))||0),k[l]+=e.offset[g]||0,e.over[g]&&(k[l]+=h[b=="x"?"width":"height"]()*e.over[g])):(f=h[g],k[l]=f.slice&&f.slice(-1)=="%"?parseFloat(f)/100*o:f);/^\d+$/.test(k[l])&&(k[l]=k[l]<=0?0:Math.min(k[l],
o));!a&&e.queue&&(n!=k[l]&&i(e.onAfterFirst),delete k[l])});i(e.onAfter)}).end()};d.max=function(d,b){var e=b=="x"?"Width":"Height",f="scroll"+e;if(!a(d).is("html,body"))return d[f]-a(d)[e.toLowerCase()]();var e="client"+e,c=d.ownerDocument.documentElement,j=d.ownerDocument.body;return Math.max(c[f],j[f])-Math.min(c[e],j[e])}})(jQuery);
(function(a){function f(b,d,f){var c=d.hash.slice(1),g=document.getElementById(c)||document.getElementsByName(c)[0];if(g){b&&b.preventDefault();var h=a(f.target);if(!(f.lock&&h.is(":animated")||f.onBefore&&f.onBefore.call(f,b,g,h)===!1)){f.stop&&h.stop(!0);if(f.hash){var b=g.id==c?"id":"name",m=a("<a> </a>").attr(b,c).css({position:"absolute",top:a(window).scrollTop(),left:a(window).scrollLeft()});g[b]="";a("body").prepend(m);location=d.hash;m.remove();g[b]=c}h.scrollTo(g,f).trigger("notify.serialScroll",
[g])}}}var d=location.href.replace(/#.*/,""),g=a.localScroll=function(b){a("body").localScroll(b)};g.defaults={duration:1E3,axis:"y",event:"click",stop:!0,target:window,reset:!0};g.hash=function(b){if(location.hash){b=a.extend({},g.defaults,b);b.hash=!1;if(b.reset){var d=b.duration;delete b.duration;a(b.target).scrollTo(0,b);b.duration=d}f(0,location,b)}};a.fn.localScroll=function(b){function e(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,"")==d&&(!b.filter||a(this).is(b.filter))}
b=a.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(d){var c=a([d.target,d.target.parentNode]).filter(e)[0];c&&f(d,c,b)}):this.find("a,area").filter(e).bind(b.event,function(a){f(a,this,b)}).end().end()}})(jQuery);
(function(a){a.fn.lazyload=function(f){var d={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};f&&a.extend(d,f);var g=this;"scroll"==d.event&&a(d.container).bind("scroll",function(){var b=0;g.each(function(){if(!a.abovethetop(this,d)&&!a.leftofbegin(this,d))if(!a.belowthefold(this,d)&&!a.rightoffold(this,d))a(this).trigger("appear");else if(b++>d.failurelimit)return!1});var e=a.grep(g,function(a){return!a.loaded});g=a(e)});this.each(function(){var b=this;void 0==a(b).attr("original")&&
a(b).attr("original",a(b).attr("src"));"scroll"!=d.event||void 0==a(b).attr("src")||d.placeholder==a(b).attr("src")||a.abovethetop(b,d)||a.leftofbegin(b,d)||a.belowthefold(b,d)||a.rightoffold(b,d)?(d.placeholder?a(b).attr("src",d.placeholder):a(b).removeAttr("src"),b.loaded=!1):b.loaded=!0;a(b).one("appear",function(){this.loaded||a("<img />").bind("load",function(){a(b).hide().attr("src",a(b).attr("original"))[d.effect](d.effectspeed);b.loaded=!0}).attr("src",a(b).attr("original"))});"scroll"!=d.event&&
a(b).bind(d.event,function(){b.loaded||a(b).trigger("appear")})});a(d.container).trigger(d.event);return this};a.belowthefold=function(f,d){return(d.container===void 0||d.container===window?a(window).height()+a(window).scrollTop():a(d.container).offset().top+a(d.container).height())<=a(f).offset().top-d.threshold};a.rightoffold=function(f,d){return(d.container===void 0||d.container===window?a(window).width()+a(window).scrollLeft():a(d.container).offset().left+a(d.container).width())<=a(f).offset().left-
d.threshold};a.abovethetop=function(f,d){return(d.container===void 0||d.container===window?a(window).scrollTop():a(d.container).offset().top)>=a(f).offset().top+d.threshold+a(f).height()};a.leftofbegin=function(f,d){return(d.container===void 0||d.container===window?a(window).scrollLeft():a(d.container).offset().left)>=a(f).offset().left+d.threshold+a(f).width()};a.extend(a.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})",
"right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);

