/* jquery/jquery.colorbox.js (98%) */
(function(z){var p="colorbox",n="hover",v=true,O=false,U,l=!z.support.opacity,Q=l&&!window.XMLHttpRequest,T="click.colorbox",w="cbox_open",I="cbox_load",s="cbox_complete",H="cbox_cleanup",m="cbox_closed",L="resize.cbox_resize",E,R,S,d,x,i,b,D,c,M,B,f,q,h,k,J,j,G,r,V,g,e,a,o,y,N,u,K,F,A={transition:"elastic",speed:350,width:O,height:O,innerWidth:O,innerHeight:O,initialWidth:"400",initialHeight:"400",maxWidth:O,maxHeight:O,scalePhotos:v,scrolling:v,inline:O,html:O,iframe:O,photo:O,href:O,title:O,rel:O,opacity:0.9,preloading:v,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:O,overlayClose:v,slideshow:O,slideshowAuto:v,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",preloadIMG:v};function C(W,X){X=X==="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return(typeof W==="string")?Math.round((W.match(/%/)?(X/100)*parseInt(W,10):parseInt(W,10))):W}function t(W){return N.photo||W.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function P(){for(var W in N){if(typeof(N[W])==="function"){N[W]=N[W].call(o)}}}U=z.fn.colorbox=function(X,W){if(this.length){this.each(function(){var Y=z(this).data(p)?z.extend({},z(this).data(p),X):z.extend({},A,X);z(this).data(p,Y).addClass("cboxelement")})}else{z(this).data(p,z.extend({},A,X))}z(this).unbind(T).bind(T,function(Z){o=this;N=z(o).data(p);P();F=W||O;var Y=N.rel||o.rel;if(Y&&Y!=="nofollow"){c=z(".cboxelement").filter(function(){var aa=z(this).data(p).rel||this.rel;return(aa===Y)});y=c.index(o);if(y<0){c=c.add(o);y=c.length-1}}else{c=z(o);y=0}if(!u){u=v;K=v;z().bind("keydown.cbox_close",function(aa){if(aa.keyCode===27){aa.preventDefault();U.close()}}).bind("keydown.cbox_arrows",function(aa){if(aa.keyCode===37){aa.preventDefault();G.click()}else{if(aa.keyCode===39){aa.preventDefault();j.click()}}});if(N.overlayClose){E.css({cursor:"pointer"}).one("click",U.close)}o.blur();z.event.trigger(w);r.html(N.close);E.css({opacity:N.opacity}).show();N.w=C(N.initialWidth,"x");N.h=C(N.initialHeight,"y");U.position(0);if(Q){M.bind("resize.cboxie6 scroll.cboxie6",function(){E.css({width:M.width(),height:M.height(),top:M.scrollTop(),left:M.scrollLeft()})}).trigger("scroll.cboxie6")}}U.slideshow();U.load();Z.preventDefault()});if(X&&X.open){z(this).triggerHandler(T)}return this};U.init=function(){function W(X){return z('<div id="cbox'+X+'"/>')}M=z(window);R=z('<div id="colorbox"/>');E=W("Overlay").hide();S=W("Wrapper");d=W("Content").append(B=W("LoadedContent").css({width:0,height:0}),f=W("LoadingOverlay"),q=W("LoadingGraphic"),h=W("Title"),k=W("Current"),J=W("Slideshow"),j=W("Next"),G=W("Previous"),r=W("Close"));S.append(z("<div/>").append(W("TopLeft"),x=W("TopCenter"),W("TopRight")),z("<div/>").append(i=W("MiddleLeft"),d,b=W("MiddleRight")),z("<div/>").append(W("BottomLeft"),D=W("BottomCenter"),W("BottomRight"))).children().children().css({"float":"left"});z("body").prepend(E,R.append(S));if(l){R.addClass("cboxIE");if(Q){E.css("position","absolute")}}d.children().addClass(n).mouseover(function(){z(this).addClass(n)}).mouseout(function(){z(this).removeClass(n)}).hide();V=x.height()+D.height()+d.outerHeight(v)-d.height();g=i.width()+b.width()+d.outerWidth(v)-d.width();e=B.outerHeight(v);a=B.outerWidth(v);R.css({"padding-bottom":V,"padding-right":g}).hide();j.click(U.next);G.click(U.prev);r.click(U.close);d.children().removeClass(n)};U.position=function(ab,Y){var aa,X=document.documentElement.clientHeight,Z=Math.max(X-N.h-e-V,0)/2+M.scrollTop(),W=Math.max(document.documentElement.clientWidth-N.w-a-g,0)/2+M.scrollLeft();aa=(R.width()===N.w+a&&R.height()===N.h+e)?0:ab;S[0].style.width=S[0].style.height="9999px";function ac(ad){x[0].style.width=D[0].style.width=d[0].style.width=ad.style.width;q[0].style.height=f[0].style.height=d[0].style.height=i[0].style.height=b[0].style.height=ad.style.height}R.dequeue().animate({width:N.w+a,height:N.h+e,top:Z,left:W},{duration:aa,complete:function(){ac(this);K=O;S[0].style.width=(N.w+a+g)+"px";S[0].style.height=(N.h+e+V)+"px";if(Y){Y()}},step:function(){ac(this)}})};U.resize=function(aa){if(!u){return}var ab,Z,X,ad,ah,W,af,Y=N.transition==="none"?0:N.speed;M.unbind(L);if(!aa){af=setTimeout(function(){var ai=B.wrapInner("<div style='overflow:auto'></div>").children();N.h=ai.height();B.css({height:N.h});ai.replaceWith(ai.children());U.position(Y)},1);return}B.remove();B=z('<div id="cboxLoadedContent"/>').html(aa);function ae(){N.w=N.w||B.width();return N.w}function ac(){N.h=N.h||B.height();return N.h}B.hide().appendTo(E).css({width:ae(),overflow:N.scrolling?"auto":"hidden"}).css({height:ac()}).prependTo(d);z("#cboxPhoto").css({cssFloat:"none"});if(Q){z("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(H,function(){this.style.visibility="inherit"})}function ag(ai){U.position(ai,function(){if(!u){return}if(l){if(W){B.fadeIn(100)}R[0].style.removeAttribute("filter")}d.children().show();if(N.iframe){B.append("<iframe id='cboxIframe'"+(N.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+(N.href||o.href)+"' />")}f.hide();q.hide();J.hide();if(c.length>1){k.html(N.current.replace(/\{current\}/,y+1).replace(/\{total\}/,c.length));j.html(N.next);G.html(N.previous);if(N.slideshow){J.show()}}else{k.hide();j.hide();G.hide()}h.html(N.title||o.title);z.event.trigger(s);if(F){F.call(o)}if(N.transition==="fade"){R.fadeTo(Y,1,function(){if(l){R[0].style.removeAttribute("filter")}})}M.bind(L,function(){U.position(0)})})}if((N.transition==="fade"&&R.fadeTo(Y,0,function(){ag(0)}))||ag(Y)){}if(N.preloading&&c.length>1){Z=y>0?c[y-1]:c[c.length-1];ad=y<c.length-1?c[y+1]:c[0];ah=z(ad).data(p).href||ad.href;X=z(Z).data(p).href||Z.href;if(t(ah)){z("<img />").attr("src",ah)}if(t(X)){z("<img />").attr("src",X)}}};U.load=function(){var X,W,aa,Z=U.resize;K=v;function Y(ad){var ac=z(ad),ae=ac.find("img"),ab=ae.length;(function af(){var ag=new Image();ab=ab-1;if(ab>=0&&N.preloadIMG){ag.onload=af;ag.src=ae[ab].src}else{Z(ac)}}())}o=c[y];N=z(o).data(p);P();z.event.trigger(I);N.h=N.height?C(N.height,"y")-e-V:N.innerHeight?C(N.innerHeight,"y"):O;N.w=N.width?C(N.width,"x")-a-g:N.innerWidth?C(N.innerWidth,"x"):O;N.mw=N.w;N.mh=N.h;if(N.maxWidth){N.mw=C(N.maxWidth,"x")-a-g;N.mw=N.w&&N.w<N.mw?N.w:N.mw}if(N.maxHeight){N.mh=C(N.maxHeight,"y")-e-V;N.mh=N.h&&N.h<N.mh?N.h:N.mh}X=N.href||o.href;f.show();q.show();r.show();if(N.inline){z('<div id="cboxInlineTemp" />').hide().insertBefore(z(X)[0]).bind(I+" "+H,function(){z(this).replaceWith(B.children())});Z(z(X))}else{if(N.iframe){Z(" ")}else{if(N.html){Y(N.html)}else{if(t(X)){W=new Image();W.onload=function(){var ab;W.onload=null;W.id="cboxPhoto";z(W).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(N.scalePhotos){aa=function(){W.height-=W.height*ab;W.width-=W.width*ab};if(N.mw&&W.width>N.mw){ab=(W.width-N.mw)/W.width;aa()}if(N.mh&&W.height>N.mh){ab=(W.height-N.mh)/W.height;aa()}}if(N.h){W.style.marginTop=Math.max(N.h-W.height,0)/2+"px"}Z(W);if(c.length>1){z(W).css({cursor:"pointer"}).click(U.next)}if(l){W.style.msInterpolationMode="bicubic"}};W.src=X}else{z("<div />").load(X,function(ab,ac){if(ac==="success"){Y(this)}else{Z(z("<p>Request unsuccessful.</p>"))}})}}}}};U.next=function(){if(!K){y=y<c.length-1?y+1:0;U.load()}};U.prev=function(){if(!K){y=y>0?y-1:c.length-1;U.load()}};U.slideshow=function(){var X,W,Y="cboxSlideshow_";J.bind(m,function(){J.unbind();clearTimeout(W);R.removeClass(Y+"off "+Y+"on")});function Z(){J.text(N.slideshowStop).bind(s,function(){W=setTimeout(U.next,N.slideshowSpeed)}).bind(I,function(){clearTimeout(W)}).one("click",function(){X();z(this).removeClass(n)});R.removeClass(Y+"off").addClass(Y+"on")}X=function(){clearTimeout(W);J.text(N.slideshowStart).unbind(s+" "+I).one("click",function(){Z();W=setTimeout(U.next,N.slideshowSpeed);z(this).removeClass(n)});R.removeClass(Y+"on").addClass(Y+"off")};if(N.slideshow&&c.length>1){if(N.slideshowAuto){Z()}else{X()}}};U.close=function(){z.event.trigger(H);u=O;z().unbind("keydown.cbox_close keydown.cbox_arrows");M.unbind(L+" resize.cboxie6 scroll.cboxie6");E.css({cursor:"auto"}).fadeOut("fast");R.stop(v,O).fadeOut("fast",function(){B.remove();R.css({opacity:1});d.children().hide();z.event.trigger(m)})};U.element=function(){return o};U.settings=A;z(U.init)}(jQuery));