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