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