(function(b,kb){var N="none",jb="LoadedContent",c=false,W="resize.",C="y",I="auto",j=true,ib="nofollow",M="on",z="x";function e(a,c){a=a?' id="'+i+a+'"':"";c=c?' style="'+c+'"':"";return b("<div"+a+c+"/>")}function n(a,b){b=b===z?l.width():l.height();return typeof a==="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function U(b){return a.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(b)}function bb(a){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!==M)a[c]=a[c].call(m);a.rel=a.rel||m.rel||ib;a.href=a.href||b(m).attr("href");a.title=a.title||m.title;return a}function s(c,a){a&&a.call(m);b.event.trigger(c)}function lb(){var c,b=i+"Slideshow_",e="click."+i,j,k;if(a.slideshow&&g[1]){j=function(){A.text(a.slideshowStop).unbind(e).bind(V,function(){if(f<g.length-1||a.loop)c=setTimeout(d.next,a.slideshowSpeed)}).bind(X,function(){clearTimeout(c)}).one(e,k);h.removeClass(b+"off").addClass(b+M);c=setTimeout(d.next,a.slideshowSpeed)};k=function(){clearTimeout(c);A.text(a.slideshowStart).unbind(V+" "+X+" "+e).one(e,j);h.removeClass(b+M).addClass(b+"off")};A.bind(cb,function(){clearTimeout(c)});h.hasClass(b+M)||a.slideshowAuto&&!h.hasClass(b+"off")?j():k()}}function db(c){if(!J){m=c;a=bb(b.extend({},b.data(m,o)));g=b(m);f=0;if(a.rel!==ib){g=b("."+D).filter(function(){return(b.data(this,o).rel||this.rel)===a.rel});f=g.index(m);if(f===-1){g=g.add(m);f=g.length-1}}if(!q){q=B=j;h.show();Y=m;try{Y.blur()}catch(e){}t.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":I}).show();a.w=n(a.initialWidth,z);a.h=n(a.initialHeight,C);d.position(0);Z&&l.bind(W+K+" scroll."+K,function(){t.css({width:l.width(),height:l.height(),top:l.scrollTop(),left:l.scrollLeft()})}).trigger("scroll."+K);s(eb,a.onOpen);ab.add(E).add(F).add(A).add(O).hide();P.html(a.close).show()}d.load(j)}}var fb={transition:"elastic",speed:300,width:c,initialWidth:"600",innerWidth:c,maxWidth:c,height:c,initialHeight:"450",innerHeight:c,maxHeight:c,scalePhotos:j,scrolling:j,inline:c,html:c,iframe:c,photo:c,href:c,title:c,rel:c,opacity:.9,preloading:j,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:c,loop:j,slideshow:c,slideshowAuto:j,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:c,onLoad:c,onComplete:c,onCleanup:c,onClosed:c,overlayClose:j,escKey:j,arrowKey:j},o="colorbox",i="cbox",eb=i+"_open",X=i+"_load",V=i+"_complete",gb=i+"_cleanup",cb=i+"_closed",L=i+"_purge",hb=i+"_loaded",v=b.browser.msie&&!b.support.opacity,Z=v&&b.browser.version<7,K=i+"_IE6",t,h,w,p,Q,T,R,S,g,l,k,G,H,O,ab,A,F,E,P,x,y,u,r,m,Y,f,a,q,B,J=c,d,D=i+"Element";d=b.fn[o]=b[o]=function(c,e){var a=this,d;if(!a[0]&&a.selector)return a;c=c||{};if(e)c.onComplete=e;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=j}a.each(function(){b.data(this,o,b.extend({},b.data(this,o)||fb,c));b(this).addClass(D)});d=c.open;if(b.isFunction(d))d=d.call(a);d&&db(a[0]);return a};d.init=function(){var m="hover",n="clear:left";l=b(kb);h=e().attr({id:o,"class":v?i+"IE":""});t=e("Overlay",Z?"position:absolute":"").hide();w=e("Wrapper");p=e("Content").append(k=e(jb,"width:0; height:0; overflow:hidden"),H=e("LoadingOverlay").add(e("LoadingGraphic")),O=e("Title"),ab=e("Current"),F=e("Next"),E=e("Previous"),A=e("Slideshow").bind(eb,lb),P=e("Close"));w.append(e().append(e("TopLeft"),Q=e("TopCenter"),e("TopRight")),e(c,n).append(T=e("MiddleLeft"),p,R=e("MiddleRight")),e(c,n).append(e("BottomLeft"),S=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});G=e(c,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(t,h.append(w,G));p.children().hover(function(){b(this).addClass(m)},function(){b(this).removeClass(m)}).addClass(m);x=Q.height()+S.height()+p.outerHeight(j)-p.height();y=T.width()+R.width()+p.outerWidth(j)-p.width();u=k.outerHeight(j);r=k.outerWidth(j);h.css({"padding-bottom":x,"padding-right":y}).hide();F.click(d.next);E.click(d.prev);P.click(d.close);p.children().removeClass(m);b("."+D).live("click",function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();db(this)}});t.click(function(){a.overlayClose&&d.close()});b(document).bind("keydown",function(b){if(q&&a.escKey&&b.keyCode===27){b.preventDefault();d.close()}if(q&&a.arrowKey&&!B&&g[1])if(b.keyCode===37&&(f||a.loop)){b.preventDefault();E.click()}else if(b.keyCode===39&&(f<g.length-1||a.loop)){b.preventDefault();F.click()}})};d.remove=function(){h.add(t).remove();b("."+D).die("click").removeData(o).removeClass(D)};d.position=function(f,d){function b(a){Q[0].style.width=S[0].style.width=p[0].style.width=a.style.width;H[0].style.height=H[1].style.height=p[0].style.height=T[0].style.height=R[0].style.height=a.style.height}var e,i=Math.max(document.documentElement.clientHeight-a.h-u-x,0)/2+l.scrollTop(),g=Math.max(l.width()-a.w-r-y,0)/2+l.scrollLeft();e=h.width()===a.w+r&&h.height()===a.h+u?0:f;w[0].style.width=w[0].style.height="9999px";h.dequeue().animate({width:a.w+r,height:a.h+u,top:i,left:g},{duration:e,complete:function(){b(this);B=c;w[0].style.width=a.w+r+y+"px";w[0].style.height=a.h+u+x+"px";d&&d()},step:function(){b(this)}})};d.resize=function(b){if(q){b=b||{};if(b.width)a.w=n(b.width,z)-r-y;if(b.innerWidth)a.w=n(b.innerWidth,z);k.css({width:a.w});if(b.height)a.h=n(b.height,C)-u-x;if(b.innerHeight)a.h=n(b.innerHeight,C);if(!b.innerHeight&&!b.height){b=k.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}k.css({height:a.h});d.position(a.transition===N?0:a.speed)}};d.prep=function(r){var j="hidden";function n(w){var r,j,p,e,n=g.length,u=a.loop;d.position(w,function(){if(q){v&&t&&k.fadeIn(100);k.show();s(hb);O.show().html(a.title);if(n>1){typeof a.current=="string"&&ab.html(a.current.replace(/\{current\}/,f+1).replace(/\{total\}/,n)).show();F[u||f<n-1?"show":"hide"]().html(a.next);E[u||f?"show":"hide"]().html(a.previous);r=f?g[f-1]:g[n-1];p=f<n-1?g[f+1]:g[0];a.slideshow&&A.show();if(a.preloading){e=b.data(p,o).href||p.href;j=b.data(r,o).href||r.href;e=b.isFunction(e)?e.call(p):e;j=b.isFunction(j)?j.call(r):j;if(U(e))b("<img/>")[0].src=e;if(U(j))b("<img/>")[0].src=j}}H.hide();if(a.transition==="fade")h.fadeTo(m,1,function(){if(v)h[0].style.filter=c});else if(v)h[0].style.filter=c;l.bind(W+i,function(){d.position(0)});s(V,a.onComplete)}})}if(q){var t,m=a.transition===N?0:a.speed;l.unbind(W+i);k.remove();k=e(jb).html(r);k.hide().appendTo(G.show()).css({width:function(){a.w=a.w||k.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?I:j}).css({height:function(){a.h=a.h||k.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(p);G.hide();b("#"+i+"Photo").css({cssFloat:N,marginLeft:I,marginRight:I});Z&&b("select").not(h.find("select")).filter(function(){return this.style.visibility!==j}).css({visibility:j}).one(gb,function(){this.style.visibility="inherit"});a.transition==="fade"?h.fadeTo(m,0,function(){n(0)}):n(m)}};d.load=function(t){var l,c,q,p=d.prep;B=j;m=g[f];t||(a=bb(b.extend({},b.data(m,o))));s(L);s(X,a.onLoad);a.h=a.height?n(a.height,C)-u-x:a.innerHeight&&n(a.innerHeight,C);a.w=a.width?n(a.width,z)-r-y:a.innerWidth&&n(a.innerWidth,z);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=n(a.maxWidth,z)-r-y;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=n(a.maxHeight,C)-u-x;a.mh=a.h&&a.h<a.mh?a.h:a.mh}l=a.href;H.show();if(a.inline){e().hide().insertBefore(b(l)[0]).one(L,function(){b(this).replaceWith(k.children())});p(b(l))}else if(a.iframe){h.one(hb,function(){var c=b("<iframe name='"+(new Date).getTime()+"' frameborder=0"+(a.scrolling?"":" scrolling='no'")+(v?" allowtransparency='true'":"")+" style='width:100%; height:100%; border:0; display:block;'/>");c[0].src=a.href;c.appendTo(k).one(L,function(){c[0].src="about:blank"})});p(" ")}else if(a.html)p(a.html);else if(U(l)){c=new Image;c.onload=function(){var e;c.onload=null;c.id=i+"Photo";b(c).css({border:N,display:"block",cssFloat:"left"});if(a.scalePhotos){q=function(){c.height-=c.height*e;c.width-=c.width*e};if(a.mw&&c.width>a.mw){e=(c.width-a.mw)/c.width;q()}if(a.mh&&c.height>a.mh){e=(c.height-a.mh)/c.height;q()}}if(a.h)c.style.marginTop=Math.max(a.h-c.height,0)/2+"px";g[1]&&(f<g.length-1||a.loop)&&b(c).css({cursor:"pointer"}).click(d.next);if(v)c.style.msInterpolationMode="bicubic";setTimeout(function(){p(c)},1)};setTimeout(function(){c.src=l},1)}else l&&G.load(l,function(d,c,a){p(c==="error"?"Request unsuccessful: "+a.statusText:b(this).children())})};d.next=function(){if(!B){f=f<g.length-1?f+1:0;d.load()}};d.prev=function(){if(!B){f=f?f-1:g.length-1;d.load()}};d.close=function(){if(q&&!J){J=j;q=c;s(gb,a.onCleanup);l.unbind("."+i+" ."+K);t.fadeTo("fast",0);h.stop().fadeTo("fast",0,function(){s(L);k.remove();h.add(t).css({opacity:1,cursor:I}).hide();try{Y.focus()}catch(b){}setTimeout(function(){J=c;s(cb,a.onClosed)},1)})}};d.element=function(){return b(m)};d.settings=fb;b(d.init)})(jQuery,this)
