/**********************************************************/
/**********************************************************/
/**********************************************************/
/**********************************************************/
/********                                       ***********/
/********          CUSTOMIZED VERSION           ***********/
/********                                       ***********/
/**********************************************************/
/**********************************************************/
/**********************************************************/
/**********************************************************/

(function(b,P,fa){function c(a,x,d){a=P.createElement(a);if(x)a.id=n+x;if(d)a.style.cssText=d;return b(a)}function J(a){var b=j.length,a=(o+a)%b;return 0>a?b+a:a}function l(a,b){return Math.round((/%/.test(a)?("x"===b?f.width():f.height())/100:1)*parseInt(a,10))}function Z(g){return a.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(g)}function $(){var g;a=b.extend({},b.data(i,q));for(g in a)b.isFunction(a[g])&&"on"!==g.slice(0,2)&&(a[g]=a[g].call(i));a.rel=a.rel||i.rel||"nofollow";a.href=a.href||
    b(i).attr("href");a.title=a.title||i.title;if("string"===typeof a.href)a.href=b.trim(a.href)}function y(a,d){b.event.trigger(a);d&&d.call(i)}function ga(){var g,b=n+"Slideshow_",c="click."+n,e,p;a.slideshow&&j[1]?(e=function(){A.text(a.slideshowStop).unbind(c).bind(Q,function(){if(o<j.length-1||a.loop)g=setTimeout(d.next,a.slideshowSpeed)}).bind(R,function(){clearTimeout(g)}).one(c+" "+K,p);h.removeClass(b+"off").addClass(b+"on");g=setTimeout(d.next,a.slideshowSpeed)},p=function(){clearTimeout(g);
    A.text(a.slideshowStart).unbind([Q,R,K,c].join(" ")).one(c,function(){d.next();e()});h.removeClass(b+"on").addClass(b+"off")},a.slideshowAuto?e():p()):h.removeClass(b+"off "+b+"on")}function aa(g){if(!L){i=g;$();j=b(i);o=0;"nofollow"!==a.rel&&(j=b("."+B).filter(function(){return(b.data(this,q).rel||this.rel)===a.rel}),o=j.index(i),-1===o&&(j=j.add(i),o=j.length-1));if(!r){r=C=!0;h.show();if(a.returnFocus)try{i.blur(),b(i).one(ba,function(){try{this.focus()}catch(a){}})}catch(c){}k.css({opacity:+a.opacity,
    cursor:a.overlayClose?"pointer":"auto"}).show();a.w=l(a.initialWidth,"x");a.h=l(a.initialHeight,"y");d.position();D&&f.bind("resize."+M+" scroll."+M,function(){k.css({width:f.width(),height:f.height(),top:f.scrollTop(),left:f.scrollLeft()})}).trigger("resize."+M);y(ca,a.onOpen);S.add(N).hide();T.html(a.close).show()}d.load(!0)}}var da={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,
    inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:0.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0},q="colorbox",n="cbox",
    B=n+"Element",ca=n+"_open",R=n+"_load",Q=n+"_complete",K=n+"_cleanup",ba=n+"_closed",O=n+"_purge",E=b.browser.msie&&!b.support.opacity,D=E&&7>b.browser.version,M=n+"_IE6",k,h,z,s,U,V,W,X,j,f,m,F,G,N,Y,A,H,I,T,S,a,v,w,t,u,i,o,e,r,C,L,ea,d;d=b.fn[q]=b[q]=function(a,c){var e=this,a=a||{};d.init();if(!e[0]){if(e.selector)return e;e=b("<a/>");a.open=!0}if(c)a.onComplete=c;e.each(function(){b.data(this,q,b.extend({},b.data(this,q)||da,a));b(this).addClass(B)});(b.isFunction(a.open)&&a.open.call(e)||a.open)&&
aa(e[0]);return e};d.init=function(){if(!h)if(b("body")[0]){f=b(fa);h=c("div").attr({id:q,"class":E?n+(D?"IE6":"IE"):""});k=c("div","Overlay",D?"position:absolute":"").hide();var g=c("div","Controls").append(Y=c("div","Current"),H=c("div","Next"),I=c("div","Previous"),A=c("div","Slideshow").bind(ca,ga),T=c("div","Close")),e=c("div","Advertisement");N=c("div","Title");z=c("div","Wrapper");s=c("div","Content").append(m=c("div","LoadedContent","width:0; height:0; overflow:hidden"),G=c("div","LoadingOverlay").add(c("div",
    "LoadingGraphic")));z.append(c("div").append(c("div","TopLeft"),U=c("div","TopCenter"),c("div","TopRight")),c("div",!1,"clear:left").append(V=c("div","MiddleLeft"),s,W=c("div","MiddleRight")),c("div",!1,"clear:left").append(c("div","BottomLeft"),X=c("div","BottomCenter"),c("div","BottomRight"))).find("div div").css({"float":"left"});F=c("div",!1,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(k,h.append(z,F));k.prepend(g);k.append(e);g.after(N);v=U.height()+X.height()+
    s.outerHeight(!0)-s.height();w=V.width()+W.width()+s.outerWidth(!0)-s.width();t=m.outerHeight(!0);u=m.outerWidth(!0);h.css({"padding-bottom":v,"padding-right":w}).hide();H.click(function(){d.next();return!1});I.click(function(){d.prev();return!1});T.click(function(){d.close()});S=H.add(I).add(Y).add(A);k.click(function(){a.overlayClose&&d.close()});b(P).bind("keydown."+n,function(b){var g=b.keyCode;r&&a.escKey&&27===g&&(b.preventDefault(),d.close());r&&a.arrowKey&&j[1]&&(37===g?(b.preventDefault(),
    I.click()):39===g&&(b.preventDefault(),H.click()))})}else b(d.init)};d.remove=function(){h.add(k).remove();h=null;b("."+B).removeData(q).removeClass(B)};d.position=function(b,c){function e(a){U[0].style.width=X[0].style.width=s[0].style.width=a.style.width;G[0].style.height=G[1].style.height=s[0].style.height=V[0].style.height=W[0].style.height=a.style.height}var j=0,p=0,m=h.offset();f.unbind("resize."+n);h.css({top:-99999,left:-99999});a.fixed&&!D?h.css({position:"fixed"}):(j=f.scrollTop(),p=f.scrollLeft(),
    h.css({position:"absolute"}));p=!1!==a.right?p+Math.max(f.width()-a.w-u-w-l(a.right,"x"),0):!1!==a.left?p+l(a.left,"x"):p+Math.round(Math.max(f.width()-a.w-u-w,0)/2);j=!1!==a.bottom?j+Math.max(f.height()-a.h-t-v-l(a.bottom,"y"),0):!1!==a.top?j+l(a.top,"y"):j+Math.round(Math.max(f.height()-a.h-t-v,0)/2);h.css({top:m.top,left:m.left});b=h.width()===a.w+u&&h.height()===a.h+t?0:b||0;z[0].style.width=z[0].style.height="9999px";h.dequeue().animate({width:a.w+u,height:a.h+t,top:j,left:p},{duration:b,complete:function(){e(this);
    C=!1;z[0].style.width=a.w+u+w+"px";z[0].style.height=a.h+t+v+"px";c&&c();setTimeout(function(){f.bind("resize."+n,d.position)},1)},step:function(){e(this)}})};d.resize=function(b){if(r){b=b||{};if(b.width)a.w=l(b.width,"x")-u-w;if(b.innerWidth)a.w=l(b.innerWidth,"x");m.css({width:a.w});if(b.height)a.h=l(b.height,"y")-t-v;if(b.innerHeight)a.h=l(b.innerHeight,"y");if(!b.innerHeight&&!b.height)m.css({height:"auto"}),a.h=m.height();m.css({height:a.h});d.position("none"===a.transition?0:a.speed)}};d.prep=
    function(g){if(r){var f,l="none"===a.transition?0:a.speed;m.remove();m=c("div","LoadedContent").append(g);m.hide().appendTo(F.show()).css({width:function(){a.w=a.w||m.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?"auto":"hidden"}).css({height:function(){a.h=a.h||m.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);F.hide();b(e).css({"float":"none"});if(D)b("select").not(h.find("select")).filter(function(){return"hidden"!==this.style.visibility}).css({visibility:"hidden"}).one(K,
        function(){this.style.visibility="inherit"});f=function(){function d(){E&&h[0].style.removeAttribute("filter")}var g,f;g=j.length;var i,x,k;if(r){x=function(){clearTimeout(ea);G.hide();y(Q,a.onComplete)};E&&e&&m.fadeIn(100);N.html(a.title).add(m).show();if(1<g){if("string"===typeof a.current&&Y.html(a.current.replace("{current}",o+1).replace("{total}",g)).show(),H[a.loop||o<g-1?"show":"hide"]().html(a.next),I[a.loop||o?"show":"hide"]().html(a.previous),a.slideshow&&A.show(),a.preloading)for(g=[J(-1),
        J(1)];f=j[g.pop()];)if(k=b.data(f,q).href||f.href,b.isFunction(k)&&(k=k.call(f)),Z(k))f=new Image,f.src=k}else S.hide();if(a.iframe){i=c("iframe")[0];"frameBorder"in i&&(i.frameBorder=0);"allowTransparency"in i&&(i.allowTransparency="true");i.name=n+ +new Date;if(a.fastIframe)x();else b(i).one("load",x);i.src=a.href;if(!a.scrolling)i.scrolling="no";b(i).addClass(n+"Iframe").appendTo(m).one(O,function(){i.src="//about:blank"})}else x();"fade"===a.transition?h.fadeTo(l,1,d):d()}};"fade"===a.transition?
        h.fadeTo(l,0,function(){d.position(0,f)}):d.position(l,f)}};d.load=function(g){var f,h,k=d.prep;C=!0;e=!1;i=j[o];g||$();y(O);y(R,a.onLoad);a.h=a.height?l(a.height,"y")-t-v:a.innerHeight&&l(a.innerHeight,"y");a.w=a.width?l(a.width,"x")-u-w:a.innerWidth&&l(a.innerWidth,"x");a.mw=a.w;a.mh=a.h;if(a.maxWidth)a.mw=l(a.maxWidth,"x")-u-w,a.mw=a.w&&a.w<a.mw?a.w:a.mw;if(a.maxHeight)a.mh=l(a.maxHeight,"y")-t-v,a.mh=a.h&&a.h<a.mh?a.h:a.mh;f=a.href;ea=setTimeout(function(){G.show()},100);a.inline?(c("div").hide().insertBefore(b(f)[0]).one(O,
    function(){b(this).replaceWith(m.children())}),k(b(f))):a.iframe?k(" "):a.html?k(a.html):Z(f)?(b(e=new Image).addClass(n+"Photo").error(function(){a.title=!1;k(c("div","Error").text("This image could not be loaded"))}).load(function(){var b;e.onload=null;a.scalePhotos&&(h=function(){e.height-=e.height*b;e.width-=e.width*b},a.mw&&e.width>a.mw&&(b=(e.width-a.mw)/e.width,h()),a.mh&&e.height>a.mh&&(b=(e.height-a.mh)/e.height,h()));if(a.h)e.style.marginTop=Math.max(a.h-e.height,0)/2+"px";if(j[1]&&(o<j.length-
    1||a.loop))e.style.cursor="pointer",e.onclick=function(){d.next()};if(E)e.style.msInterpolationMode="bicubic";setTimeout(function(){k(e)},1)}),setTimeout(function(){e.src=f},1)):f&&F.load(f,a.data,function(a,d,e){k("error"===d?c("div","Error").text("Request unsuccessful: "+e.statusText):b(this).contents())})};d.next=function(){if(!C&&j[1]&&(o<j.length-1||a.loop))o=J(1),d.load()};d.prev=function(){if(!C&&j[1]&&(o||a.loop))o=J(-1),d.load()};d.close=function(){r&&!L&&(L=!0,r=!1,y(K,a.onCleanup),f.unbind("."+
    n+" ."+M),k.fadeTo(200,0),h.stop().fadeTo(300,0,function(){h.add(k).css({opacity:1,cursor:"auto"}).hide();y(O);m.remove();setTimeout(function(){L=!1;y(ba,a.onClosed)},1)}))};d.element=function(){return b(i)};d.settings=da;b("."+B,P).live("click",function(a){1<a.which||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),aa(this))});d.init()})(jQuery,document,this);

