/* ColorBox v1.2.2 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 (c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php */ (function(u){var G,z,r,E,a,d,J,f,t,b,A,D,F,n,h,y,i,g,H,I,c,m,x,e,v,j,B,o,q;function s(){x.css({position:"absolute",width:F.width(),height:F.height(),top:F.scrollTop(),left:F.scrollLeft()})}function l(){var K;function L(){D.text(G.slideshowStop).bind("cbox_complete",function(){A=setTimeout(u.fn.colorbox.next,G.slideshowSpeed)}).bind("cbox_load",function(){clearTimeout(A)}).one("click",function(){K();u(this).removeClass("hover")});H.removeClass("cboxSlideshow_off").addClass("cboxSlideshow_on")}K=function(){clearTimeout(A);D.text(G.slideshowStart).unbind("cbox_complete cbox_load").one("click",function(){L();A=setTimeout(u.fn.colorbox.next,G.slideshowSpeed);u(this).removeClass("hover")});H.removeClass("cboxSlideshow_on").addClass("cboxSlideshow_off")};if(G.slideshow&&b.length>1){if(G.slideshowAuto){L()}else{K()}}}function k(){if(u("#cboxInlineTemp").length>0){v.children().insertAfter("#cboxInlineTemp")}}function C(K){if(K.keyCode==37){K.preventDefault();y.click()}else{if(K.keyCode==39){K.preventDefault();h.click()}}}function w(K,L){L=L=="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return(typeof K=="string")?(K.match(/%/)?(L/100)*parseInt(K,10):parseInt(K,10)):K}function p(K){return G.photo?true:K.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i)}u(function(){u.fn.colorbox.init()});u.fn.colorbox=function(L,K){if(this.length){this.each(function(){if(u(this).data("colorbox")){u(this).data("colorbox",u.extend({},u(this).data("colorbox"),L))}else{u(this).data("colorbox",u.extend({},u.fn.colorbox.settings,L))}var M=u(this).data("colorbox");M.title=M.title?M.title:this.title;M.href=M.href?M.href:this.href;M.rel=M.rel?M.rel:this.rel;u(this).data("colorbox",M).addClass("cboxelement")})}else{u(this).data("colorbox",u.extend({},u.fn.colorbox.settings,L))}u(this).unbind("click.colorbox").bind("click.colorbox",function(N){G=u(this).data("colorbox");this.blur();if(K){var M=this;z=function(){u(M).each(K)}}else{z=function(){}}if(G.rel&&G.rel!="nofollow"){b=u(".cboxelement").filter(function(){return(u(this).data("colorbox").rel==G.rel)});t=b.index(this)}else{b=u(this);t=0}if(H.data("open")!==true){u.event.trigger("cbox_open");n.html(G.close);x.css({opacity:G.opacity}).show();H.data("open",true);u.fn.colorbox.position(w(G.initialWidth,"x"),w(G.initialHeight,"y"),0);if(u.browser.msie&&u.browser.version<7){F.bind("resize scroll",s)}}l();u.fn.colorbox.load();if(G.overlayClose===true){x.css({cursor:"pointer"}).click(u.fn.colorbox.close)}N.preventDefault()});if(L&&L.open){u(this).triggerHandler("click.colorbox")}return this};u.fn.colorbox.init=function(){F=u(window);u("body").prepend(x=u('
').hide(),H=u('
'));I=u('
').appendTo(H).append(u("
").append(u('
'),j=u('
'),u('
')),B=u('
'),e=u('
'),o=u('
'),u("
").append(u('
'),q=u('
'),u('
')));I.find("[id]").css({"float":"left"});e.append(v=u('
'),c=u('
'),m=u('
'),g=u('
'),i=u('
'),D=u('
'),h=u('
').click(u.fn.colorbox.next),y=u('
').click(u.fn.colorbox.prev),n=u('
').click(u.fn.colorbox.close));e.children().addClass("hover").mouseover(function(){u(this).addClass("hover")}).mouseout(function(){u(this).removeClass("hover")}).hide();J=j.height()+q.height()+e.outerHeight(true)-e.height();f=B.width()+o.width()+e.outerWidth(true)-e.width();d=v.outerHeight(true);a=v.outerWidth(true);H.css({"padding-bottom":J,"padding-right":f}).hide();u().bind("keydown.cbox_close",function(K){if(K.keyCode==27){K.preventDefault();n.click()}});e.children().removeClass("hover")};u.fn.colorbox.next=function(){t=t0?t-1:b.length-1;u.fn.colorbox.load()};u.fn.colorbox.position=function(N,M,L,O){var P=document.documentElement.clientHeight;var R=P/2-M/2;var Q=document.documentElement.clientWidth/2-N/2;if(M>P){R-=(M-P)}if(R<0){R=0}if(Q<0){Q=0}R+=F.scrollTop();Q+=F.scrollLeft();N=N-f;M=M-J;I[0].style.width=I[0].style.height="9999px";function S(T){j[0].style.width=q[0].style.width=e[0].style.width=T.style.width;m[0].style.height=c[0].style.height=e[0].style.height=B[0].style.height=o[0].style.height=T.style.height}var K=(H.width()===N&&H.height()===M)?0:L;H.dequeue().animate({height:M,width:N,top:R,left:Q},{duration:K,complete:function(){S(this);I[0].style.width=(N+f)+"px";I[0].style.height=(M+J)+"px";if(O){O()}if(u.browser.msie&&u.browser.version<7){s()}},step:function(){S(this)}})};u.fn.colorbox.dimensions=function(N){F.unbind("resize.cbox_resize");if(H.data("open")!==true){return false}var Q=G.transition=="none"?0:G.speed;v.remove();v=u(N);function K(){if(G.width){return r}else{return r&&r0&&G.height){var M=(v.height()-parseInt(u("#cboxPhoto")[0].style.height,10))/2;u("#cboxPhoto").css({marginTop:(M>0?M:0)})}function L(T){var S=v.width()+a+f;var U=v.height()+d+J;u.fn.colorbox.position(S,U,T,function(){if(H.data("open")!==true){return false}e.children().show();c.hide();m.hide();D.hide();if(b.length>1){i.html(G.current.replace(/\{current\}/,t+1).replace(/\{total\}/,b.length));h.html(G.next);y.html(G.previous);u().unbind("keydown",C).one("keydown",C);if(G.slideshow){D.show()}}else{i.add(h).add(y).hide()}g.html(G.title);u("#cboxIframe").attr("src",u("#cboxIframe").attr("src"));u.event.trigger("cbox_complete");z();if(G.transition==="fade"){H.fadeTo(Q,1)}F.bind("resize.cbox_resize",function(){u.fn.colorbox.position(S,U,0)});return true})}if(G.transition=="fade"){H.fadeTo(Q,0,function(){L(0)})}else{L(Q)}if(G.preloading&&b.length>1){var P=t>0?b[t-1]:b[b.length-1];var O=t").attr("src",O)}if(p(u(P).data("colorbox").href)){u("").attr("src",P)}}return true};u.fn.colorbox.load=function(){u.event.trigger("cbox_load");G=u(b[t]).data("colorbox");c.show();m.show();n.show();k();var K=G.height?w(G.height,"y")-d-J:false;var N=G.width?w(G.width,"x")-a-f:false;if(G.maxHeight){E=G.maxHeight?w(G.maxHeight,"y")-d-J:false;K=K&&K').hide().insertBefore(u(L)[0]);u.fn.colorbox.dimensions(u(L).wrapAll("
").parent())}else{if(G.iframe){u.fn.colorbox.dimensions(u("