(function(b){var r="colorbox",w="hover",h=true,c=false,d,x=!b.support.opacity,H=x&&!window.XMLHttpRequest,D="click.colorbox",N="cbox_open",M="cbox_load",K="cbox_complete",I="cbox_cleanup",L="cbox_closed",B="resize.cbox_resize",k,g,o,e,C,A,z,y,O,i,f,u,t,v,p,q,m,n,j,Q,a,s,G,E,F={transition:"elastic",speed:350,width:c,height:c,innerWidth:c,innerHeight:c,initialWidth:"400",initialHeight:"400",maxWidth:c,maxHeight:c,scalePhotos:h,scrolling:h,inline:c,html:c,iframe:c,photo:c,href:c,title:c,rel:c,opacity:.9,preloading:h,close:"Close",open:c,overlayClose:h,preloadIMG:c,imgW:"783",imgH:"542"};function l(a,b){b=b==="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return typeof a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function J(){for(var b in a)if(typeof a[b]==="function")a[b]=a[b].call(j)}d=b.fn.colorbox=function(e,f){if(this.length)this.each(function(){var a=b(this).data(r)?b.extend({},b(this).data(r),e):b.extend({},F,e);b(this).data(r,a).addClass("cboxelement")});else b(this).data(r,b.extend({},F,e));b(this).unbind(D).bind(D,function(e){j=this;a=b(j).data(r);J();E=f||c;var g=a.rel||j.rel;if(!s){s=h;G=h;b().bind("keydown.cbox_close",function(a){if(a.keyCode===27){a.preventDefault();d.close()}});a.overlayClose&&k.css({cursor:"pointer"}).one("click",d.close);j.blur();b.event.trigger(N);v.html(a.close);k.css({opacity:a.opacity}).show();a.w=l(a.initialWidth,"x");a.h=l(a.initialHeight,"y");d.position(0);H&&i.bind("resize.cboxie6 scroll.cboxie6",function(){k.css({width:i.width(),height:i.height(),top:i.scrollTop(),left:i.scrollLeft()})}).trigger("scroll.cboxie6")}d.load();e.preventDefault()});e&&e.open&&b(this).triggerHandler(D);return this};d.init=function(){function a(a){return b('<div id="cbox'+a+'"/>')}i=b(window);g=b('<div id="colorbox"/>');k=a("Overlay").hide();o=a("Wrapper");e=a("Content").append(f=a("LoadedContent").css({width:0,height:0}),u=a("LoadingOverlay"),t=a("LoadingGraphic"),v=a("Close"));o.append(b("<div/>").append(a("TopLeft"),C=a("TopCenter"),a("TopRight")),b("<div/>").append(A=a("MiddleLeft"),e,z=a("MiddleRight")),b("<div/>").append(a("BottomLeft"),y=a("BottomCenter"),a("BottomRight"))).children().children().css({"float":"left"});b("body").prepend(k,g.append(o));if(x){g.addClass("cboxIE");H&&k.css("position","absolute")}e.children().addClass(w).mouseover(function(){b(this).addClass(w)}).mouseout(function(){b(this).removeClass(w)}).hide();p=C.height()+y.height()+e.outerHeight(h)-e.height();q=A.width()+z.width()+e.outerWidth(h)-e.width();m=f.outerHeight(h);n=f.outerWidth(h);g.css({"padding-bottom":p,"padding-right":q}).hide();v.click(d.close);e.children().removeClass(w)};d.position=function(l,d){var f,h=document.documentElement.clientHeight,k=Math.max(h-a.h-m-p,0)/2+i.scrollTop(),j=Math.max(document.documentElement.clientWidth-a.w-n-q,0)/2+i.scrollLeft();f=g.width()===a.w+n&&g.height()===a.h+m?0:l;o[0].style.width=o[0].style.height="9999px";function b(a){C[0].style.width=y[0].style.width=e[0].style.width=a.style.width;t[0].style.height=u[0].style.height=e[0].style.height=A[0].style.height=z[0].style.height=a.style.height}g.dequeue().animate({width:a.w+n,height:a.h+m,top:k,left:j},{duration:f,complete:function(){b(this);G=c;o[0].style.width=a.w+n+q+"px";o[0].style.height=a.h+m+p+"px";d&&d()},step:function(){b(this)}})};d.resize=function(l){if(!s)return;var q,p,o,c=a.transition==="none"?0:a.speed;i.unbind(B);if(!l){o=setTimeout(function(){var b=f.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();f.css({height:a.h});b.replaceWith(b.children());d.position(c)},1);return}f.remove();f=b('<div id="cboxLoadedContent"/>').html(l);function n(){a.w=a.w||f.width();return a.w}function m(){a.h=a.h||f.height();return a.h}f.hide().appendTo(k).css({width:n(),overflow:a.scrolling?"auto":"hidden"}).css({height:m()}).prependTo(e);b("#cboxPhoto").css({cssFloat:"none"});H&&b("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(I,function(){this.style.visibility="inherit"});function h(h){d.position(h,function(){if(!s)return;if(x){p&&f.fadeIn(100);g[0].style.removeAttribute("filter")}e.children().show();a.iframe&&f.append("<iframe id='cboxIframe'"+(a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new Date).getTime()+"' frameborder=0 src='"+(a.href||j.href)+"' />");u.hide();t.hide();b.event.trigger(K);E&&E.call(j);a.transition==="fade"&&g.fadeTo(c,1,function(){x&&g[0].style.removeAttribute("filter")});i.bind(B,function(){d.position(0)})})}if(a.transition==="fade"&&g.fadeTo(c,0,function(){h(0)})||h(c));};d.load=function(){var f,k,e,g=d.resize;G=h;function i(i){var h=b(i),d=h.find("img"),c=d.length;function f(){var i=new Image;c=c-1;if(c>=0&&a.preloadIMG){i.onload=function(){var g;i.onload=null;if(a.scalePhotos){e=function(){i.height-=i.height*g;i.width-=i.width*g;b(d[c]).css({width:i.width,height:i.height})};if(i.width>a.imgW){g=(i.width-a.imgW)/i.width;e()}if(i.height>a.imgH){g=(i.height-a.imgH)/i.height;e()}}f()};i.src=d[c].src}else g(h)}f()}a=b(j).data(r);J();b.event.trigger(M);a.h=a.height?l(a.height,"y")-m-p:a.innerHeight?l(a.innerHeight,"y"):c;a.w=a.width?l(a.width,"x")-n-q:a.innerWidth?l(a.innerWidth,"x"):c;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=l(a.maxWidth,"x")-n-q;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=l(a.maxHeight,"y")-m-p;a.mh=a.h&&a.h<a.mh?a.h:a.mh}f=a.href||b(j).attr("href")+"/1";u.show();t.show();v.show();b("<div />").load(f,function(c,a){if(a==="success"){pageTracker._trackPageview(f);i(this)}else g(b("<p>Request unsuccessful.</p>"))})};d.close=function(){b.event.trigger(I);s=c;b().unbind("keydown.cbox_close keydown.cbox_arrows");i.unbind(B+" resize.cboxie6 scroll.cboxie6");k.css({cursor:"auto"}).fadeOut("fast");g.stop(h,c).fadeOut("fast",function(){f.remove();g.css({opacity:1});e.children().hide();b.event.trigger(L)})};d.element=function(){return b(j)};d.settings=F;b(d.init)})(jQuery);function loadImages(){var b=$(".jflow_container").find("img"),a=b.length,e="783",d="542";function c(){var f=new Image;a=a-1;if(a>=0){f.onload=function(){var g;f.onload=null;setResize=function(){f.height-=f.height*g;f.width-=f.width*g;$(b[a]).css({width:f.width,height:f.height})};if(f.width>e){g=(f.width-e)/f.width;setResize()}if(f.height>d){g=(f.height-d)/f.height;setResize()}c()};f.src=b[a].src}}c()}(function(a){a.fn.karmicFlow=function(b){b=a.extend({container:"jflow_container",slider:"jflow_slider",slides:"jflow_slides",sliding:"jflow_sliding",slide_selected:"jflow_slide_selected",slide_overflow:"jflow_slide_overflow",controller:"jflow_controller",controller_selected:"jflow_controller_selected",next:"jflow_next_controller",prev:"jflow_prev_controller",info:"jflow_info_controller",close:"jflow_close_controller",description:"jflow_info",duration:400},b||{});this.data("opts",b);this.data("cur_index",this.data("cur_index")||0);var f=function(p){var j=a(p),n=j.attr("target"),g=a("#"+n),f=g.find("."+b.slide_selected),i=f.parent(),d=f.parent().children(),c=d.index(f),e=d.length,l=g.data("cur_index"),o=g.data("opts").duration,k=1;if(c==-1)return false;if(j.hasClass(b.next))c=c+1==e?0:c+1;else if(j.hasClass(b.prev))c=c==0?e-1:c-1;g.data("cur_index",c);d.removeClass(b.slide_selected);d.eq(c).addClass(b.slide_selected);var h=a("[href*=#"+d.eq(c).attr("id")+"]"),m=a("[target="+h.attr("target")+"]");m.removeClass(b.controller_selected);h.addClass(b.controller_selected);i.addClass(b.sliding);if(c==0&&l==e-1||c==e-1&&l==0)k=e;i.stop().animate({marginLeft:-1*f.width()*c},o*k,function(){i.removeClass(b.sliding)});return h[0]};a("."+b.description).hide();for(var c=0;c<this.length;c++)a(this[c]).find("."+b.slides).each(function(){var c=a("<div></div>");c.append(this.childNodes).appendTo(this).addClass(b.slide_overflow).css("height",a(this).parent().parent().height())});var e=a();if(!e.data("jflow_init")){e.data("jflow_init",1);e.bind("keydown.colorbox.karmicFlow",function(c){if(c.keyCode===37){var d=a().find("[class="+b.prev+"]");f(d);c.preventDefault()}else if(c.keyCode===39){var d=a().find("[class="+b.next+"]");f(d);c.preventDefault()}});e.bind("click",function(j){var i=j.target,c=a(i),k=c.attr("target");if(c.hasClass(b.controller)){var e=a("#"+k),d=e.find("[id="+i.hash.substring(1,i.hash.length)+"]"),h=d.parent().children().index(d[0]),g=d.parent(),m=e.data("cur_index"),n=e.data("opts").duration;a("[target="+k+"]").removeClass(b.controller_selected);c.addClass(b.controller_selected);g.children().removeClass(b.slide_selected);d.addClass(b.slide_selected);g.addClass(b.sliding);e.data("cur_index",h);var o=-1*d.width()*h;g.stop().animate({marginLeft:-1*d.width()*h},n*Math.abs(h-m),function(){g.removeClass(b.sliding)});j.preventDefault()}else if(c.hasClass(b.next)||c.hasClass(b.prev)){f(i);j.preventDefault()}else if(c.hasClass(b.info)||c.hasClass(b.close)){var e=a("#"+k),l=a("."+b.description);if(l.css("display")=="none")l.animate({opacity:.95,height:"toggle"},250);else l.animate({opacity:1,height:"toggle"},250);j.preventDefault()}})}for(var c=0;c<this.length;c++){var d=a(this[c]),g=d.children(),h=g.height(d.height()).children();g.width(h.length*d.width());h.width(d.width())}loadImages();return this}})(this.jQuery);(function(a){a.fn.lazyload=function(d){var b={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};d&&a.extend(b,d);var c=this;"scroll"==b.event&&a(b.container).bind("scroll",function(){var d=0;c.each(function(){if(!(a.abovethetop(this,b)||a.leftofbegin(this,b)))if(!a.belowthefold(this,b)&&!a.rightoffold(this,b))a(this).trigger("appear");else if(d++>b.failurelimit)return false});var e=a.grep(c,function(a){return !a.loaded});c=a(e)});return this.each(function(){var c=this;a(c).data("original",a(c).attr("src"));if("scroll"!=b.event||(a.abovethetop(c,b)||a.leftofbegin(c,b)||a.belowthefold(c,b)||a.rightoffold(c,b))){if(b.placeholder)a(c).attr("src",b.placeholder);else a(c).removeAttr("src");c.loaded=false}else c.loaded=true;a(c).one("appear",function(){!this.loaded&&a("<img />").bind("load",function(){a(c).hide().attr("src",a(c).data("original"))[b.effect](b.effectspeed);c.loaded=true}).attr("src",a(c).data("original"))});"scroll"!=b.event&&a(c).bind(b.event,function(){!c.loaded&&a(c).trigger("appear")})})};a.belowthefold=function(c,b){if(b.container===undefined||b.container===window)var d=a(window).height()+a(window).scrollTop();else var d=a(b.container).offset().top+a(b.container).height();return d<=a(c).offset().top-b.threshold};a.rightoffold=function(c,b){if(b.container===undefined||b.container===window)var d=a(window).width()+a(window).scrollLeft();else var d=a(b.container).offset().left+a(b.container).width();return d<=a(c).offset().left-b.threshold};a.abovethetop=function(c,b){if(b.container===undefined||b.container===window)var d=a(window).scrollTop();else var d=a(b.container).offset().top;return d>=a(c).offset().top+b.threshold+a(c).height()};a.leftofbegin=function(c,b){if(b.container===undefined||b.container===window)var d=a(window).scrollLeft();else var d=a(b.container).offset().left;return d>=a(c).offset().left+b.threshold+a(c).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)
