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