/*
 RequireJS 0.23.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details
*/
var require,define;
(function(){function P(e){return ca.call(e)==="[object Function]"}function U(e){return ca.call(e)==="[object Array]"}function V(e,f,k){for(var j in f)if(!(j in E)&&(!(j in e)||k))e[j]=f[j];return g}function da(e,f,k){var j,o,n;for(j=0;n=f[j];j++){n=typeof n==="string"?{name:n}:n;o=n.location;if(k&&(!o||o.indexOf("/")!==0&&o.indexOf(":")===-1))o=k+"/"+(o||n.name);e[n.name]={name:n.name,location:o||n.name,lib:n.lib||"lib",main:(n.main||"lib/main").replace(pa,"").replace(ea,"")}}}function qa(e){function f(a){var b,
c;for(b=0;c=a[b];b++)if(c==="."){a.splice(b,1);b-=1}else if(c==="..")if(b===1&&(a[2]===".."||a[0]===".."))break;else if(b>0){a.splice(b-1,2);b-=2}}function k(a,b){var c;if(a.charAt(0)===".")if(b){if(t.pkgs[b])b=[b];else{b=b.split("/");b=b.slice(0,b.length-1)}a=b.concat(a.split("/"));f(a);c=t.pkgs[b=a[0]];a=a.join("/");if(c&&a===b+"/"+c.main)a=b}return a}function j(a,b){var c=a?a.indexOf("!"):-1,d=null,h=b?b.name:null,l=a,p,m;if(c!==-1){d=a.substring(0,c);a=a.substring(c+1,a.length)}if(d){d=k(d,h);
d=ra[d]||d}if(a){if(d)p=(c=q[d])?c.normalize?c.normalize(a,function(u){return k(u,h)}):k(a,h):"__$p"+h+"@"+a;else p=k(a,h);m=W[p];if(!m){m=g.toModuleUrl?g.toModuleUrl(i,a,b):i.nameToUrl(a,null,b);W[p]=m}}return{prefix:d,name:p,parentMap:b,url:m,originalName:l,fullName:d?d+"!"+p:p}}function o(){var a=true,b=t.priorityWait,c,d;if(b){for(d=0;c=b[d];d++)if(!w[c]){a=false;break}a&&delete t.priorityWait}return a}function n(a){return function(b){a.exports=b}}function Q(a,b,c){return function(){var d=[].concat(sa.call(arguments,
0)),h;if(c&&P(h=d[d.length-1]))h.__requireJsBuild=true;d.push(b);return a.apply(null,d)}}function fa(a,b){b=Q(i.require,a,b);V(b,{nameToUrl:Q(i.nameToUrl,a),toUrl:Q(i.toUrl,a),isDefined:Q(i.isDefined,a),ready:g.ready,isBrowser:g.isBrowser});if(g.paths)b.paths=g.paths;return b}function ta(a){var b,c,d,h,l,p,m,u=R[a];if(u)for(h=0;c=u[h];h++){b=c.fullName;c=j(c.originalName,c.parentMap);c=c.fullName;d=v[b];l=v[c];if(c!==b){if(b in z){delete z[b];z[c]=true}v[c]=l?l.concat(d):d;delete v[b];for(l=0;l<d.length;l++){m=
d[l].depArray;for(p=0;p<m.length;p++)if(m[p]===b)m[p]=c}}}delete R[a]}function ga(a){var b=a.prefix,c=a.fullName;if(!(z[c]||c in q)){if(b&&!F[b]){F[b]=undefined;(R[b]||(R[b]=[])).push(a);(v[b]||(v[b]=[])).push({onDep:function(d){d===b&&ta(b)}});ga(j(b))}i.paused.push(a)}}function X(a){var b,c,d;b=a.callback;var h=a.fullName;d=[];var l=a.depArray;if(b&&P(b)){if(l)for(b=0;b<l.length;b++)d.push(a.deps[l[b]]);c=g.execCb(h,a.callback,d);if(h)if(a.usingExports&&c===undefined&&(!a.cjsModule||!("exports"in
a.cjsModule)))c=q[h];else if(a.cjsModule&&"exports"in a.cjsModule)c=q[h]=a.cjsModule.exports;else{if(h in q&&!a.usingExports)return g.onError(new Error(h+" has already been defined"));q[h]=c}}else if(h)c=q[h]=b;if(h)if(d=v[h]){for(b=0;b<d.length;b++)d[b].onDep(h,c);delete v[h]}if(B[a.waitId]){delete B[a.waitId];a.isDone=true;i.waitCount-=1;if(i.waitCount===0)Y=[]}}function ha(a,b,c,d){a=j(a,d);var h=a.name,l=a.fullName,p={},m={waitId:h||ua+va++,depCount:0,depMax:0,prefix:a.prefix,name:h,fullName:l,
deps:{},depArray:b,callback:c,onDep:function(ia,wa){if(!(ia in m.deps)){m.deps[ia]=wa;m.depCount+=1;m.depCount===m.depMax&&X(m)}}},u,s;if(l){if(l in q||w[l]===true)return;z[l]=true;w[l]=true;i.jQueryDef=l==="jquery"}for(c=0;c<b.length;c++)if(u=b[c]){u=j(u,h?a:d);s=u.fullName;b[c]=s;if(s==="require")m.deps[s]=fa(a);else if(s==="exports"){m.deps[s]=q[l]={};m.usingExports=true}else if(s==="module"){m.cjsModule=u=m.deps[s]={id:h,uri:h?i.nameToUrl(h,null,d):undefined};u.setExports=n(u)}else if(s in q&&
!(s in B))m.deps[s]=q[s];else if(!p[s]){m.depMax+=1;ga(u);(v[s]||(v[s]=[])).push(m);p[s]=true}}if(m.depCount===m.depMax)X(m);else{B[m.waitId]=m;Y.push(m);i.waitCount+=1}}function J(a){ha.apply(null,a);w[a[0]]=true}function ja(a){if(!i.jQuery)if((a=a||(typeof jQuery!=="undefined"?jQuery:null))&&"readyWait"in a){i.jQuery=a;J(["jquery",[],function(){return jQuery}]);if(i.scriptCount){a.readyWait+=1;i.jQueryIncremented=true}}}function ka(a,b){if(!a.isDone){var c=a.fullName,d=a.depArray,h,l;if(c){if(b[c])return q[c];
b[c]=true}for(l=0;l<d.length;l++)(h=d[l])&&!a.deps[h]&&B[h]&&a.onDep(h,ka(B[h],b));return c?q[c]:undefined}}function Z(){var a=t.waitSeconds*1E3,b=a&&i.startTime+a<(new Date).getTime();a="";var c=false,d=false,h;if(!(i.pausedCount>0)){if(t.priorityWait)if(o())G();else return;for(h in w)if(!(h in E)){c=true;if(!w[h])if(b)a+=h+" ";else{d=true;break}}if(c||i.waitCount){if(b&&a){h=new Error("require.js load timeout for modules: "+a);h.requireType="timeout";h.requireModules=a;return g.onError(h)}if(d||
i.scriptCount){if(A||la)setTimeout(Z,50)}else if(i.waitCount){for(C=0;a=Y[C];C++)ka(a,{});Z()}else g.checkReadyState()}}}function ma(a,b){var c=b.name,d=b.fullName;if(!(d in q||d in w)){F[a]||(F[a]=q[a]);w[d]||(w[d]=false);F[a].load(c,fa(b.parentMap,true),function(h){require.onPluginLoad&&require.onPluginLoad(i,a,c,h);X({prefix:b.prefix,name:b.name,fullName:b.fullName,callback:function(){return h}});w[d]=true},t)}}function xa(a){if(a.prefix&&a.name.indexOf("__$p")===0&&q[a.prefix])a=j(a.originalName,
a.parentMap);var b=a.prefix,c=a.fullName;if(!(z[c]||c in q)){z[c]=true;if(b)if(q[b])ma(b,a);else{if(!K[b]){K[b]=[];(v[b]||(v[b]=[])).push({onDep:function(d){if(d===b){var h,l=K[b];for(d=0;d<l.length;d++){h=l[d];ma(b,j(h.originalName,h.parentMap))}delete K[b]}}})}K[b].push(a)}else g.load(i,c,a.url)}}var i,G,t={waitSeconds:7,baseUrl:r.baseUrl||"./",paths:{},pkgs:{}},L=[],z={require:true,exports:true,module:true},W={},q={},w={},B={},Y=[],va=0,v={},F={},K={},$=0,R={};G=function(){var a,b,c;$+=1;if(i.scriptCount<=
0)i.scriptCount=0;for(;L.length;){a=L.shift();if(a[0]===null)return g.onError(new Error("Mismatched anonymous require.def modules"));else J(a)}if(!(t.priorityWait&&!o())){for(;i.paused.length;){c=i.paused;i.pausedCount+=c.length;i.paused=[];for(b=0;a=c[b];b++)xa(a);i.startTime=(new Date).getTime();i.pausedCount-=c.length}$===1&&Z();$-=1}};i={contextName:e,config:t,defQueue:L,waiting:B,waitCount:0,specified:z,loaded:w,urlMap:W,scriptCount:0,urlFetched:{},defined:q,paused:[],pausedCount:0,plugins:F,
managerCallbacks:v,makeModuleMap:j,normalize:k,configure:function(a){var b,c,d;if(a.baseUrl)if(a.baseUrl.charAt(a.baseUrl.length-1)!=="/")a.baseUrl+="/";b=t.paths;d=t.pkgs;V(t,a,true);if(a.paths){for(c in a.paths)c in E||(b[c]=a.paths[c]);t.paths=b}if((b=a.packagePaths)||a.packages){if(b)for(c in b)c in E||da(d,b[c],c);a.packages&&da(d,a.packages);t.pkgs=d}if(a.priority){c=i.requireWait;i.requireWait=false;i.require(a.priority);G();i.requireWait=c;t.priorityWait=a.priority}if(a.deps||a.callback)i.require(a.deps||
[],a.callback);a.ready&&g.ready(a.ready)},isDefined:function(a,b){return j(a,b).fullName in q},require:function(a,b,c){if(typeof a==="string"){if(g.get)return g.get(i,a,b);c=b;b=j(a,c);a=q[b.fullName];if(a===undefined)return g.onError(new Error("require: module name '"+b.fullName+"' has not been loaded yet for context: "+e));return a}ha(null,a,b,c);if(!i.requireWait)for(;!i.scriptCount&&i.paused.length;)G()},takeGlobalQueue:function(){if(S.length){ya.apply(i.defQueue,[i.defQueue.length-1,0].concat(S));
S=[]}},completeLoad:function(a){var b;for(i.takeGlobalQueue();L.length;){b=L.shift();if(b[0]===null){b[0]=a;break}else if(b[0]===a)break;else{J(b);b=null}}b?J(b):J([a,[],a==="jquery"&&typeof jQuery!=="undefined"?function(){return jQuery}:null]);w[a]=true;ja();if(g.isAsync)i.scriptCount-=1;G();g.isAsync||(i.scriptCount-=1)},toUrl:function(a,b){var c=a.lastIndexOf("."),d=null;if(c!==-1){d=a.substring(c,a.length);a=a.substring(0,c)}return i.nameToUrl(a,d,b)},nameToUrl:function(a,b,c){var d,h,l,p,m=i.config;
if(a.indexOf("./")===0||a.indexOf("../")===0){c=c&&c.url?c.url.split("/"):[];c.length&&c.pop();c=c.concat(a.split("/"));f(c);b=c.join("/")+(b?b:g.jsExtRegExp.test(a)?"":".js")}else{a=k(a,c);if(g.jsExtRegExp.test(a))b=a+(b?b:"");else{d=m.paths;h=m.pkgs;c=a.split("/");for(p=c.length;p>0;p--){l=c.slice(0,p).join("/");if(d[l]){c.splice(0,p,d[l]);break}else if(l=h[l]){a=a===l.name?l.location+"/"+l.main:l.location+"/"+l.lib;c.splice(0,p,a);break}}b=c.join("/")+(b||".js");b=(b.charAt(0)==="/"||b.match(/^\w+:/)?
"":m.baseUrl)+b}}return m.urlArgs?b+((b.indexOf("?")===-1?"?":"&")+m.urlArgs):b}};i.jQueryCheck=ja;i.resume=G;return i}function za(){var e,f,k;if(M&&M.readyState==="interactive")return M;e=document.getElementsByTagName("script");for(f=e.length-1;f>-1&&(k=e[f]);f--)if(k.readyState==="interactive")return M=k;return null}var Aa=/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,Ba=/require\(["']([^'"\s]+)["']\)/g,pa=/^\.\//,ea=/\.js$/,ca=Object.prototype.toString,x=Array.prototype,sa=x.slice,ya=x.splice,A=!!(typeof window!==
"undefined"&&navigator&&document),la=!A&&typeof importScripts!=="undefined",Ca=A&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,ua="_r@@",E={},H={},S=[],M=null,Da=false,na=false,ra={text:"require/text",i18n:"require/i18n",order:"require/order"},g;x={};var aa,r,I,T,y,N,O,C,ba,oa,D;if(typeof require!=="undefined")if(P(require))return;else x=require;g=require=function(e,f,k){var j="_",o;if(!U(e)&&typeof e!=="string"){o=e;if(U(f)){e=f;f=k}else e=[]}if(o&&o.context)j=o.context;
k=H[j]||(H[j]=qa(j));o&&k.configure(o);return k.require(e,f)};g.version="0.23.0";g.isArray=U;g.isFunction=P;g.mixin=V;g.jsExtRegExp=/^\/|:|\?|\.js$/;r=g.s={contexts:H,skipAsync:{},isPageLoaded:!A,readyCalls:[]};if(g.isAsync=g.isBrowser=A){I=r.head=document.getElementsByTagName("head")[0];if(T=document.getElementsByTagName("base")[0])I=r.head=T.parentNode}g.onError=function(e){throw e;};g.load=function(e,f,k){var j=e.contextName,o=e.urlFetched,n=e.loaded;Da=false;n[f]||(n[f]=false);if(!o[k]){e.scriptCount+=
1;g.attach(k,j,f);o[k]=true;if(e.jQuery&&!e.jQueryIncremented){e.jQuery.readyWait+=1;e.jQueryIncremented=true}}};define=g.def=function(e,f,k){var j;if(typeof e!=="string"){k=f;f=e;e=null}if(!g.isArray(f)){k=f;f=[]}if(!e&&!f.length&&g.isFunction(k))if(k.length){k.toString().replace(Aa,"").replace(Ba,function(o,n){f.push(n)});f=["require","exports","module"].concat(f)}if(na){j=aa||za();if(!j)return g.onError(new Error("ERROR: No matching script interactive for "+k));e||(e=j.getAttribute("data-requiremodule"));
j=H[j.getAttribute("data-requirecontext")]}(j?j.defQueue:S).push([e,f,k])};define.amd={multiversion:true,plugins:true};g.execCb=function(e,f,k){return f.apply(null,k)};g.onScriptLoad=function(e){var f=e.currentTarget||e.srcElement,k;if(e.type==="load"||Ca.test(f.readyState)){M=null;e=f.getAttribute("data-requirecontext");k=f.getAttribute("data-requiremodule");H[e].completeLoad(k);f.removeEventListener?f.removeEventListener("load",g.onScriptLoad,false):f.detachEvent("onreadystatechange",g.onScriptLoad)}};
g.attach=function(e,f,k,j,o){var n;if(A){j=j||g.onScriptLoad;n=document.createElement("script");n.type=o||"text/javascript";n.charset="utf-8";n.async=!r.skipAsync[e];n.setAttribute("data-requirecontext",f);n.setAttribute("data-requiremodule",k);if(n.addEventListener)n.addEventListener("load",j,false);else{na=true;n.attachEvent("onreadystatechange",j)}n.src=e;aa=n;T?I.insertBefore(n,T):I.appendChild(n);aa=null;return n}else if(la){j=H[f];f=j.loaded;f[k]=false;importScripts(e);j.completeLoad(k)}return null};
if(A){y=document.getElementsByTagName("script");for(C=y.length-1;C>-1&&(N=y[C]);C--){if(!I)I=N.parentNode;if(O=N.getAttribute("data-main")){if(!x.baseUrl){y=O.split("/");N=y.pop();y=y.length?y.join("/")+"/":"./";x.baseUrl=y;O=N.replace(ea,"")}x.deps=x.deps?x.deps.concat(O):[O];break}}}r.baseUrl=x.baseUrl;g.pageLoaded=function(){if(!r.isPageLoaded){r.isPageLoaded=true;ba&&clearInterval(ba);if(oa)document.readyState="complete";g.callReady()}};g.checkReadyState=function(){var e=r.contexts,f;for(f in e)if(!(f in
E))if(e[f].waitCount)return;r.isDone=true;g.callReady()};g.callReady=function(){var e=r.readyCalls,f,k,j;if(r.isPageLoaded&&r.isDone){if(e.length){r.readyCalls=[];for(f=0;k=e[f];f++)k()}e=r.contexts;for(j in e)if(!(j in E)){f=e[j];if(f.jQueryIncremented){f.jQuery.ready(true);f.jQueryIncremented=false}}}};g.ready=function(e){r.isPageLoaded&&r.isDone?e():r.readyCalls.push(e);return g};if(A){if(document.addEventListener){document.addEventListener("DOMContentLoaded",g.pageLoaded,false);window.addEventListener("load",
g.pageLoaded,false);if(!document.readyState){oa=true;document.readyState="loading"}}else if(window.attachEvent){window.attachEvent("onload",g.pageLoaded);if(self===self.top)ba=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");g.pageLoaded()}}catch(e){}},30)}document.readyState==="complete"&&g.pageLoaded()}g(x);if(g.isAsync&&typeof setTimeout!=="undefined"){D=r.contexts[x.context||"_"];D.requireWait=true;setTimeout(function(){D.requireWait=false;D.takeGlobalQueue();
D.jQueryCheck();D.scriptCount||D.resume();g.checkReadyState()},0)}})();
// ColorBox v1.3.16 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(a,b,c){function ba(b){if(!T){O=b,Z(a.extend(J,a.data(O,e))),x=a(O),P=0,J.rel!=="nofollow"&&(x=a("."+V).filter(function(){var b=a.data(this,e).rel||this.rel;return b===J.rel}),P=x.index(O),P===-1&&(x=x.add(O),P=x.length-1));if(!R){R=S=!0,q.show();if(J.returnFocus)try{O.blur(),a(O).one(k,function(){try{this.focus()}catch(a){}})}catch(c){}p.css({opacity:+J.opacity,cursor:J.overlayClose?"pointer":"auto"}).show(),J.w=X(J.initialWidth,"x"),J.h=X(J.initialHeight,"y"),U.position(0),n&&y.bind("resize."+o+" scroll."+o,function(){p.css({width:y.width(),height:y.height(),top:y.scrollTop(),left:y.scrollLeft()})}).trigger("resize."+o),$(g,J.onOpen),I.add(C).hide(),H.html(J.close).show()}U.load(!0)}}function _(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;J.slideshow&&x[1]&&(d=function(){E.text(J.slideshowStop).unbind(c).bind(i,function(){if(P<x.length-1||J.loop)a=setTimeout(U.next,J.slideshowSpeed)}).bind(h,function(){clearTimeout(a)}).one(c+" "+j,e),q.removeClass(b+"off").addClass(b+"on"),a=setTimeout(U.next,J.slideshowSpeed)},e=function(){clearTimeout(a),E.text(J.slideshowStart).unbind([i,h,j,c].join(" ")).one(c,d),q.removeClass(b+"on").addClass(b+"off")},J.slideshowAuto?d():e())}function $(b,c){c&&c.call(O),a.event.trigger(b)}function Z(b){for(var c in b)a.isFunction(b[c])&&c.substring(0,2)!=="on"&&(b[c]=b[c].call(O));b.rel=b.rel||O.rel||"nofollow",b.href=a.trim(b.href||a(O).attr("href")),b.title=b.title||O.title}function Y(a){return J.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function X(a,b){b=b==="x"?y.width():y.height();return typeof a=="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function W(c,d){var e=b.createElement("div");c&&(e.id=f+c),e.style.cssText=d||!1;return a(e)}var d={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:.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},e="colorbox",f="cbox",g=f+"_open",h=f+"_load",i=f+"_complete",j=f+"_cleanup",k=f+"_closed",l=f+"_purge",m=a.browser.msie&&!a.support.opacity,n=m&&a.browser.version<7,o=f+"_IE6",p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J={},K,L,M,N,O,P,Q,R,S,T=!1,U,V=f+"Element";U=a.fn[e]=a[e]=function(b,c){var f=this,g;if(!f[0]&&f.selector)return f;b=b||{},c&&(b.onComplete=c);if(!f[0]||f.selector===undefined)f=a("<a/>"),b.open=!0;f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(V)}),g=b.open,a.isFunction(g)&&(g=g.call(f)),g&&ba(f[0]);return f},U.init=function(){y=a(c),q=W().attr({id:e,"class":m?f+(n?"IE6":"IE"):""}),p=W("Overlay",n?"position:absolute":"").hide(),r=W("Wrapper"),s=W("Content").append(z=W("LoadedContent","width:0; height:0; overflow:hidden"),B=W("LoadingOverlay").add(W("LoadingGraphic")),C=W("Title"),D=W("Current"),F=W("Next"),G=W("Previous"),E=W("Slideshow").bind(g,_),H=W("Close")),r.append(W().append(W("TopLeft"),t=W("TopCenter"),W("TopRight")),W(!1,"clear:left").append(u=W("MiddleLeft"),s,v=W("MiddleRight")),W(!1,"clear:left").append(W("BottomLeft"),w=W("BottomCenter"),W("BottomRight"))).children().children().css({"float":"left"}),A=W(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(p,q.append(r,A)),s.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),K=t.height()+w.height()+s.outerHeight(!0)-s.height(),L=u.width()+v.width()+s.outerWidth(!0)-s.width(),M=z.outerHeight(!0),N=z.outerWidth(!0),q.css({"padding-bottom":K,"padding-right":L}).hide(),F.click(function(){U.next()}),G.click(function(){U.prev()}),H.click(function(){U.close()}),I=F.add(G).add(D).add(E),s.children().removeClass("hover"),a("."+V).live("click",function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),ba(this))}),p.click(function(){J.overlayClose&&U.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;R&&J.escKey&&b===27&&(a.preventDefault(),U.close()),R&&J.arrowKey&&x[1]&&(b===37?(a.preventDefault(),G.click()):b===39&&(a.preventDefault(),F.click()))})},U.remove=function(){q.add(p).remove(),a("."+V).die("click").removeData(e).removeClass(V)},U.position=function(a,c){function g(a){t[0].style.width=w[0].style.width=s[0].style.width=a.style.width,B[0].style.height=B[1].style.height=s[0].style.height=u[0].style.height=v[0].style.height=a.style.height}var d,e=Math.max(b.documentElement.clientHeight-J.h-M-K,0)/2+y.scrollTop(),f=Math.max(y.width()-J.w-N-L,0)/2+y.scrollLeft();d=q.width()===J.w+N&&q.height()===J.h+M?0:a,r[0].style.width=r[0].style.height="9999px",q.dequeue().animate({width:J.w+N,height:J.h+M,top:e,left:f},{duration:d,complete:function(){g(this),S=!1,r[0].style.width=J.w+N+L+"px",r[0].style.height=J.h+M+K+"px",c&&c()},step:function(){g(this)}})},U.resize=function(a){if(R){a=a||{},a.width&&(J.w=X(a.width,"x")-N-L),a.innerWidth&&(J.w=X(a.innerWidth,"x")),z.css({width:J.w}),a.height&&(J.h=X(a.height,"y")-M-K),a.innerHeight&&(J.h=X(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=z.wrapInner("<div style='overflow:auto'></div>").children();J.h=b.height(),b.replaceWith(b.children())}z.css({height:J.h}),U.position(J.transition==="none"?0:J.speed)}},U.prep=function(b){function h(b){U.position(b,function(){var b,d,g,h,j=x.length,k,n;!R||(n=function(){B.hide(),$(i,J.onComplete)},m&&Q&&z.fadeIn(100),C.html(J.title).add(z).show(),j>1?(typeof J.current=="string"&&D.html(J.current.replace(/\{current\}/,P+1).replace(/\{total\}/,j)).show(),F[J.loop||P<j-1?"show":"hide"]().html(J.next),G[J.loop||P?"show":"hide"]().html(J.previous),b=P?x[P-1]:x[j-1],g=P<j-1?x[P+1]:x[0],J.slideshow&&E.show(),J.preloading&&(h=a.data(g,e).href||g.href,d=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,d=a.isFunction(d)?d.call(b):d,Y(h)&&(a("<img/>")[0].src=h),Y(d)&&(a("<img/>")[0].src=d))):I.hide(),J.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],J.fastIframe?n():a(k).load(n),k.name=f+ +(new Date),k.src=J.href,J.scrolling||(k.scrolling="no"),m&&(k.frameborder=0,k.allowTransparency="true"),a(k).appendTo(z).one(l,function(){k.src="//about:blank"})):n(),J.transition==="fade"?q.fadeTo(c,1,function(){q[0].style.filter=""}):q[0].style.filter="",y.bind("resize."+f,function(){U.position(0)}))})}function g(){J.h=J.h||z.height(),J.h=J.mh&&J.mh<J.h?J.mh:J.h;return J.h}function d(){J.w=J.w||z.width(),J.w=J.mw&&J.mw<J.w?J.mw:J.w;return J.w}if(!!R){var c=J.transition==="none"?0:J.speed;y.unbind("resize."+f),z.remove(),z=W("LoadedContent").html(b),z.hide().appendTo(A.show()).css({width:d(),overflow:J.scrolling?"auto":"hidden"}).css({height:g()}).prependTo(s),A.hide(),a(Q).css({"float":"none"}),n&&a("select").not(q.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(j,function(){this.style.visibility="inherit"}),J.transition==="fade"?q.fadeTo(c,0,function(){h(0)}):h(c)}},U.load=function(b){var c,d,g=U.prep;S=!0,Q=!1,O=x[P],b||Z(a.extend(J,a.data(O,e))),$(l),$(h,J.onLoad),J.h=J.height?X(J.height,"y")-M-K:J.innerHeight&&X(J.innerHeight,"y"),J.w=J.width?X(J.width,"x")-N-L:J.innerWidth&&X(J.innerWidth,"x"),J.mw=J.w,J.mh=J.h,J.maxWidth&&(J.mw=X(J.maxWidth,"x")-N-L,J.mw=J.w&&J.w<J.mw?J.w:J.mw),J.maxHeight&&(J.mh=X(J.maxHeight,"y")-M-K,J.mh=J.h&&J.h<J.mh?J.h:J.mh),c=J.href,B.show(),J.inline?(W().hide().insertBefore(a(c)[0]).one(l,function(){a(this).replaceWith(z.children())}),g(a(c))):J.iframe?g(" "):J.html?g(J.html):Y(c)?(a(Q=new Image).addClass(f+"Photo").error(function(){J.title=!1,g(W("Error").text("This image could not be loaded"))}).load(function(){var a;Q.onload=null,J.scalePhotos&&(d=function(){Q.height-=Q.height*a,Q.width-=Q.width*a},J.mw&&Q.width>J.mw&&(a=(Q.width-J.mw)/Q.width,d()),J.mh&&Q.height>J.mh&&(a=(Q.height-J.mh)/Q.height,d())),J.h&&(Q.style.marginTop=Math.max(J.h-Q.height,0)/2+"px"),x[1]&&(P<x.length-1||J.loop)&&(Q.style.cursor="pointer",Q.onclick=function(){U.next()}),m&&(Q.style.msInterpolationMode="bicubic"),setTimeout(function(){g(Q)},1)}),setTimeout(function(){Q.src=c},1)):c&&A.load(c,function(b,c,d){g(c==="error"?W("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},U.next=function(){!S&&x[1]&&(P<x.length-1||J.loop)&&(P=P<x.length-1?P+1:0,U.load())},U.prev=function(){!S&&x[1]&&(P||J.loop)&&(P=P?P-1:x.length-1,U.load())},U.close=function(){R&&!T&&(T=!0,R=!1,$(j,J.onCleanup),y.unbind("."+f+" ."+o),p.fadeTo(200,0),q.stop().fadeTo(300,0,function(){q.add(p).css({opacity:1,cursor:"auto"}).hide(),$(l),z.remove(),setTimeout(function(){T=!1,$(k,J.onClosed)},1)}))},U.element=function(){return a(O)},U.settings=d,a(U.init)})(jQuery,document,this);
