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

