text: (function(e,f,p){var P,ga,L,m=this,n=m.document,F=e(n),v=e(m),G=Array.prototype,ha=!0,V=!1,A=navigator.userAgent.toLowerCase(),ia=m.location.hash.replace(/#\//,""),t=function(){},ta=function(){return!1},q,s=3,z=n.createElement("div"),D=z.getElementsByTagName("i");do z.innerHTML="\x3c!--[if gt IE "+ ++s+"]><i></i><![endif]--\x3e";while(D[0]);q=4<s?s:p;var r=function(){return{html:n.documentElement,body:n.body,head:n.getElementsByTagName("head")[0],title:n.title}},M=m.parent!==m.self,Q=[];e.each("data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image".split(" "),
  function(a,b){Q.push(b);/_/.test(b)&&Q.push(b.replace(/_/g,""))});var ja=function(a){var b;if("object"!==typeof a)return a;e.each(a,function(c,d){/^[a-z]+_/.test(c)&&(b="",e.each(c.split("_"),function(a,c){b+=0<a?c.substr(0,1).toUpperCase()+c.substr(1):c}),a[b]=d,delete a[c])});return a},W=function(a){return-1<e.inArray(a,Q)?f[a.toUpperCase()]:a},H={youtube:{reg:/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&amp;(?:amp;)?)*v(?:&lt;[A-Z]+&gt;)?=([0-9a-zA-Z\-\_]+))/i,embed:function(a){return"http://www.youtube.com/embed/"+
  a},getThumb:function(a,b,c){c=c||t;e.getJSON(m.location.protocol+"//gdata.youtube.com/feeds/api/videos/"+a+"?v=2&alt=json-in-script&callback=?",function(a){try{b(a.entry.media$group.media$thumbnail[0].url)}catch(e){c()}})}},vimeo:{reg:/https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,embed:function(a){return"http://player.vimeo.com/video/"+a},getThumb:function(a,b,c){c=c||t;e.getJSON("http://vimeo.com/api/v2/video/"+a+".json?callback=?",function(a){try{b(a[0].thumbnail_medium)}catch(e){c()}})}},
  dailymotion:{reg:/https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,embed:function(a){return"http://www.dailymotion.com/embed/video/"+a},getThumb:function(a,b,c){c=c||t;e.getJSON("https://api.dailymotion.com/video/"+a+"?fields=thumbnail_medium_url&callback=?",function(a){try{b(a.thumbnail_medium_url)}catch(e){c()}})}}},ka=function(a){var b,c;for(c in H)if((b=a&&a.match(H[c].reg))&&b.length)return{id:b[2],provider:c};return!1},s=r().html,w={support:!M&&(s.requestFullscreen||s.mozRequestFullScreen||
  s.webkitRequestFullScreen),callback:t,enter:function(a,b,c){this.instance=a;this.callback=b||t;c=c||r().html;c.requestFullscreen?c.requestFullscreen():c.mozRequestFullScreen?c.mozRequestFullScreen():c.webkitRequestFullScreen&&c.webkitRequestFullScreen()},exit:function(a){this.callback=a||t;n.exitFullscreen?n.exitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitCancelFullScreen&&n.webkitCancelFullScreen()},instance:null,listen:function(){if(this.support){var a=function(){if(w.instance){var a=
  w.instance._fullscreen;n.fullscreen||n.mozFullScreen||n.webkitIsFullScreen?a._enter(w.callback):a._exit(w.callback)}};n.addEventListener("fullscreenchange",a,!1);n.addEventListener("mozfullscreenchange",a,!1);n.addEventListener("webkitfullscreenchange",a,!1)}}},X=[],E=[],la=!1,x=!1,Y=[],Z=function(a){f.theme=a;e.each(Y,function(a,c){c._initialized||c._init.call(c)});Y=[]},R;a:{s=["transition","WebkitTransition","MozTransition","OTransition"];if(!m.opera)for(z=0;s[z];z++)if("undefined"!==typeof(n.body||
  n.documentElement).style[s[z]]){R=s[z];break a}R=!1}var ma={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[R],$={_default:[0.25,0.1,0.25,1],galleria:[0.645,0.045,0.355,1],galleriaIn:[0.55,0.085,0.68,0.53],galleriaOut:[0.25,0.46,0.45,0.94],ease:[0.25,0,0.25,1],linear:[0.25,0.25,0.75,0.75],"ease-in":[0.42,0,1,1],"ease-out":[0,0,0.58,1],"ease-in-out":[0.42,0,0.58,1]},S=function(a,b,c){var d={};c=c||"transition";e.each(["webkit",
  "moz","ms","o"],function(){d["-"+this+"-"+c]=b});a.css(d)},na=function(a){S(a,"none","transition");f.WEBKIT&&f.TOUCH&&(S(a,"translate3d(0,0,0)","transform"),a.data("revert")&&(a.css(a.data("revert")),a.data("revert",null)))},aa,T,oa,pa,ba,N,ca,h={clearTimer:function(a){e.each(f.get(),function(){this.clearTimer(a)})},addTimer:function(a){e.each(f.get(),function(){this.addTimer(a)})},array:function(a){return G.slice.call(a,0)},create:function(a,b){var c=n.createElement(b||"div");c.className=a;return c},
  removeFromArray:function(a,b){e.each(a,function(c,d){if(d==b)return a.splice(c,1),!1});return a},getScriptPath:function(a){a=a||e("script:last").attr("src");a=a.split("/");if(1==a.length)return"";a.pop();return a.join("/")+"/"},animate:function(a,b,c){c=e.extend({duration:400,complete:t,stop:!1},c);a=e(a);c.duration?R?(c.stop&&(a.unbind(ma),na(a)),aa=!1,e.each(b,function(b,c){ca=a.css(b);h.parseValue(ca)!=h.parseValue(c)&&(aa=!0);a.css(b,ca)}),aa?(T=[],oa=c.easing in $?$[c.easing]:$._default,pa=" "+
  c.duration+"ms cubic-bezier("+oa.join(",")+")",m.setTimeout(function(a,b,j,l){return function(){a.one(b,function(a){return function(){na(a);c.complete.call(a[0])}}(a));if(f.WEBKIT&&f.TOUCH&&(ba={},N=[0,0,0],e.each(["left","top"],function(b,c){c in j&&(N[b]=h.parseValue(j[c])-h.parseValue(a.css(c))+"px",ba[c]=j[c],delete j[c])}),N[0]||N[1]))a.data("revert",ba),T.push("-webkit-transform"+l),S(a,"translate3d("+N.join(",")+")","transform");e.each(j,function(a){T.push(a+l)});S(a,T.join(","));a.css(j)}}(a,
  ma,b,pa),2)):m.setTimeout(function(){c.complete.call(a[0])},c.duration)):a.animate(b,c):(a.css(b),c.complete.call(a[0]))},removeAlpha:function(a){a instanceof jQuery&&(a=a[0]);if(9>q&&a){var b=a.style;a=(a=a.currentStyle)&&a.filter||b.filter||"";/alpha/.test(a)&&(b.filter=a.replace(/alpha\([^)]*\)/i,""))}},forceStyles:function(a,b){a=e(a);a.attr("style")&&a.data("styles",a.attr("style")).removeAttr("style");a.css(b)},revertStyles:function(){e.each(h.array(arguments),function(a,b){b=e(b);b.removeAttr("style");
  b.attr("style","");b.data("styles")&&b.attr("style",b.data("styles")).data("styles",null)})},moveOut:function(a){h.forceStyles(a,{position:"absolute",left:-1E4})},moveIn:function(){h.revertStyles.apply(h,h.array(arguments))},hide:function(a,b,c){c=c||t;var d=e(a);a=d[0];d.data("opacity")||d.data("opacity",d.css("opacity"));var g={opacity:0};b?h.animate(a,g,{duration:b,complete:9>q&&a?function(){h.removeAlpha(a);a.style.visibility="hidden";c.call(a)}:c,stop:!0}):9>q&&a?(h.removeAlpha(a),a.style.visibility=
  "hidden"):d.css(g)},show:function(a,b,c){c=c||t;var d=e(a);a=d[0];var g={opacity:parseFloat(d.data("opacity"))||1};b?(9>q&&(d.css("opacity",0),a.style.visibility="visible"),h.animate(a,g,{duration:b,complete:9>q&&a?function(){1==g.opacity&&h.removeAlpha(a);c.call(a)}:c,stop:!0})):9>q&&1==g.opacity&&a?(h.removeAlpha(a),a.style.visibility="visible"):d.css(g)},wait:function(a){a=e.extend({until:ta,success:t,error:function(){f.raise("Could not complete wait function.")},timeout:3E3},a);var b=h.timestamp(),
  c,d,g=function(){d=h.timestamp();c=d-b;if(a.until(c))return a.success(),!1;if("number"==typeof a.timeout&&d>=b+a.timeout)return a.error(),!1;m.setTimeout(g,10)};m.setTimeout(g,10)},toggleQuality:function(a,b){7!==q&&8!==q||(!a||"IMG"!=a.nodeName.toUpperCase())||("undefined"===typeof b&&(b="nearest-neighbor"===a.style.msInterpolationMode),a.style.msInterpolationMode=b?"bicubic":"nearest-neighbor")},insertStyleTag:function(a,b){if(!b||!e("#"+b).length){var c=n.createElement("style");b&&(c.id=b);r().head.appendChild(c);
  if(c.styleSheet)c.styleSheet.cssText=a;else{var d=n.createTextNode(a);c.appendChild(d)}}},loadScript:function(a,b){var c=!1,d=e("<script>").attr({src:a,async:!0}).get(0);d.onload=d.onreadystatechange=function(){if(!c&&(!this.readyState||"loaded"===this.readyState||"complete"===this.readyState))c=!0,d.onload=d.onreadystatechange=null,"function"===typeof b&&b.call(this,this)};r().head.appendChild(d)},parseValue:function(a){return"number"===typeof a?a:"string"===typeof a?(a=a.match(/\-?\d|\./g))&&a.constructor===
  Array?1*a.join(""):0:0},timestamp:function(){return(new Date).getTime()},loadCSS:function(a,b,c){var d,g;e("link[rel=stylesheet]").each(function(){if(RegExp(a).test(this.href))return d=this,!1});"function"===typeof b&&(c=b,b=p);c=c||t;if(d)return c.call(d,d),d;g=n.styleSheets.length;if(e("#"+b).length)e("#"+b).attr("href",a),g--;else if(d=e("<link>").attr({rel:"stylesheet",href:a,id:b}).get(0),b=e('link[rel="stylesheet"], style'),b.length?b.get(0).parentNode.insertBefore(d,b[0]):r().head.appendChild(d),
  q&&31<=g){f.raise("You have reached the browser stylesheet limit (31)",!0);return}if("function"===typeof c){var j=e("<s>").attr("id","galleria-loader").hide().appendTo(r().body);h.wait({until:function(){return 1==j.height()},success:function(){j.remove();c.call(d,d)},error:function(){j.remove();f.raise("Theme CSS could not load after 20 sec. "+(f.QUIRK?"Your browser is in Quirks Mode, please add a correct doctype.":"Please download the latest theme at http://galleria.io/customer/."),!0)},timeout:5E3})}return d}},
  da=function(a,b,c,d){var g=this.getOptions("easing"),j=this.getStageWidth(),l={left:j*(a.rewind?-1:1)},f={left:0};c?(l.opacity=0,f.opacity=1):l.opacity=1;e(a.next).css(l);h.animate(a.next,f,{duration:a.speed,complete:function(a){return function(){b();a.css({left:0})}}(e(a.next).add(a.prev)),queue:!1,easing:g});d&&(a.rewind=!a.rewind);a.prev&&(l={left:0},f={left:j*(a.rewind?1:-1)},c&&(l.opacity=1,f.opacity=0),e(a.prev).css(l),h.animate(a.prev,f,{duration:a.speed,queue:!1,easing:g,complete:function(){e(this).css("opacity",
  0)}}))};P=!1;ga=function(a,b,c){L.hasOwnProperty(a)&&L[a].call(this,b,c)};L={fade:function(a,b){e(a.next).css({opacity:0,left:0});h.animate(a.next,{opacity:1},{duration:a.speed,complete:b});a.prev&&(e(a.prev).css("opacity",1).show(),h.animate(a.prev,{opacity:0},{duration:a.speed}))},flash:function(a,b){e(a.next).css({opacity:0,left:0});a.prev?h.animate(a.prev,{opacity:0},{duration:a.speed/2,complete:function(){h.animate(a.next,{opacity:1},{duration:a.speed,complete:b})}}):h.animate(a.next,{opacity:1},
  {duration:a.speed,complete:b})},pulse:function(a,b){a.prev&&e(a.prev).hide();e(a.next).css({opacity:0,left:0}).show();h.animate(a.next,{opacity:1},{duration:a.speed,complete:b})},slide:function(a,b){da.apply(this,h.array(arguments))},fadeslide:function(a,b){da.apply(this,h.array(arguments).concat([!0]))},doorslide:function(a,b){da.apply(this,h.array(arguments).concat([!1,!0]))}};w.listen();f=m.Galleria=function(){var a=this;this._options={};this._playing=!1;this._playtime=5E3;this._active=null;this._queue=
  {length:0};this._data=[];this._dom={};this._thumbnails=[];this._layers=[];this._firstrun=this._initialized=!1;this._stageHeight=this._stageWidth=0;this._target=p;this._binds=[];this._id=parseInt(1E4*Math.random(),10);e.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "),function(b,c){a._dom[c]=h.create("galleria-"+c)});e.each(["current",
  "total"],function(b,c){a._dom[c]=h.create("galleria-"+c,"span")});var b=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:!1,press:function(c){var d=c.keyCode||c.which;d in b.map&&"function"===typeof b.map[d]&&b.map[d].call(a,c)},attach:function(a){var c,d;for(c in a)a.hasOwnProperty(c)&&(d=c.toUpperCase(),d in b.keys?b.map[b.keys[d]]=a[c]:b.map[d]=a[c]);b.bound||(b.bound=!0,F.bind("keydown",b.press))},detach:function(){b.bound=!1;b.map={};
  F.unbind("keydown",b.press)}},c=this._controls={"0":p,1:p,active:0,swap:function(){c.active=c.active?0:1},getActive:function(){return a._options.swipe?c.slides[a._active]:c[c.active]},getNext:function(){return a._options.swipe?c.slides[a.getNext(a._active)]:c[1-c.active]},slides:[]},d=this._carousel={next:a.$("thumb-nav-right"),prev:a.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var b=0,c=0,l=[0];e.each(a._thumbnails,function(a,d){d.ready&&(b+=d.outerWidth||e(d.container).outerWidth(!0),
  l[a+1]=b,c=Math.max(c,d.outerHeight||e(d.container).outerHeight(!0)))});a.$("thumbnails").css({width:b,height:c});d.max=b;d.hooks=l;d.width=a.$("thumbnails-list").width();d.setClasses();a.$("thumbnails-container").toggleClass("galleria-carousel",b>d.width);d.width=a.$("thumbnails-list").width()},bindControls:function(){var b;d.next.bind("click",function(c){c.preventDefault();if("auto"===a._options.carouselSteps)for(b=d.current;b<d.hooks.length;b++){if(d.hooks[b]-d.hooks[d.current]>d.width){d.set(b-
  2);break}}else d.set(d.current+a._options.carouselSteps)});d.prev.bind("click",function(c){c.preventDefault();if("auto"===a._options.carouselSteps)for(b=d.current;0<=b;b--)if(d.hooks[d.current]-d.hooks[b]>d.width){d.set(b+2);break}else{if(0===b){d.set(0);break}}else d.set(d.current-a._options.carouselSteps)})},set:function(a){for(a=Math.max(a,0);d.hooks[a-1]+d.width>=d.max&&0<=a;)a--;d.current=a;d.animate()},getLast:function(a){return(a||d.current)-1},follow:function(a){if(0===a||a===d.hooks.length-
  2)d.set(a);else{for(var b=d.current;d.hooks[b]-d.hooks[d.current]<d.width&&b<=d.hooks.length;)b++;a-1<d.current?d.set(a-1):a+2>b&&d.set(a-b+d.current+2)}},setClasses:function(){d.prev.toggleClass("disabled",!d.current);d.next.toggleClass("disabled",d.hooks[d.current]+d.width>=d.max)},animate:function(){d.setClasses();var b=-1*d.hooks[d.current];isNaN(b)||h.animate(a.get("thumbnails"),{left:b},{duration:a._options.carouselSpeed,easing:a._options.easing,queue:!1})}},g=this._tooltip={initialized:!1,
  open:!1,timer:"tooltip"+a._id,swapTimer:"swap"+a._id,init:function(){g.initialized=!0;h.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3;opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}","galleria-tooltip");a.$("tooltip").css({opacity:0.8,visibility:"visible",display:"none"})},move:function(b){var c=a.getMousePosition(b).x;
  b=a.getMousePosition(b).y;var d=a.$("tooltip"),e=b,l=d.outerHeight(!0)+1,g=d.outerWidth(!0),j=l+15,g=a.$("container").width()-g-2,f=a.$("container").height()-l-2;!isNaN(c)&&!isNaN(e)&&(e-=l+8,c=Math.max(0,Math.min(g,c+10)),e=Math.max(0,Math.min(f,e)),b<j&&(e=j),d.css({left:c,top:e}))},bind:function(b,c){if(!f.TOUCH){g.initialized||g.init();var d=function(){a.$("container").unbind("mousemove",g.move);a.clearTimer(g.timer);a.$("tooltip").stop().animate({opacity:0},200,function(){a.$("tooltip").hide();
  a.addTimer(g.swapTimer,function(){g.open=!1},1E3)})},l=function(b,c){g.define(b,c);e(b).hover(function(){a.clearTimer(g.swapTimer);a.$("container").unbind("mousemove",g.move).bind("mousemove",g.move).trigger("mousemove");g.show(b);a.addTimer(g.timer,function(){a.$("tooltip").stop().show().animate({opacity:1});g.open=!0},g.open?0:500)},d).click(d)};"string"===typeof c?l(b in a._dom?a.get(b):b,c):e.each(b,function(b,c){l(a.get(b),c)})}},show:function(b){b=e(b in a._dom?a.get(b):b);var c=b.data("tt"),
  d=function(a){m.setTimeout(function(a){return function(){g.move(a)}}(a),10);b.unbind("mouseup",d)};if(c="function"===typeof c?c():c)a.$("tooltip").html(c.replace(/\s/,"&#160;")),b.bind("mouseup",d)},define:function(b,c){if("function"!==typeof c){var d=c;c=function(){return d}}b=e(b in a._dom?a.get(b):b).data("tt",c);g.show(b)}},j=this._fullscreen={scrolled:0,crop:p,active:!1,prev:e(),beforeEnter:function(a){a()},beforeExit:function(a){a()},keymap:a._keyboard.map,parseCallback:function(b,c){return P?
  function(){"function"==typeof b&&b.call(a);var d=a._controls.getActive(),l=a._controls.getNext();a._scaleImage(l);a._scaleImage(d);c&&a._options.trueFullscreen&&e(d.container).add(l.container).trigger("transitionend")}:b},enter:function(b){j.beforeEnter(function(){b=j.parseCallback(b,!0);a._options.trueFullscreen&&w.support?(j.active=!0,h.forceStyles(a.get("container"),{width:"100%",height:"100%"}),a.rescale(),f.MAC?f.WEBKIT&&(!f.SAFARI||!/version\/[1-5]/.test(A))?(a.$("container").css("opacity",
  0).addClass("fullscreen"),m.setTimeout(function(){j.scale();a.$("container").css("opacity",1)},50)):(a.$("stage").css("opacity",0),m.setTimeout(function(){j.scale();a.$("stage").css("opacity",1)},4)):a.$("container").addClass("fullscreen"),v.resize(j.scale),w.enter(a,b,a.get("container"))):(j.scrolled=v.scrollTop(),f.TOUCH||m.scrollTo(0,0),j._enter(b))})},_enter:function(b){j.active=!0;if(M){var c=j,d;var l;d=n.referrer;var g=n.createElement("a"),k=m.location;g.href=d;g.protocol!=k.protocol||g.hostname!=
  k.hostname||g.port!=k.port?(f.raise("Parent fullscreen not available. Iframe protocol, domains and ports must match."),d=!1):(j.pd=m.parent.document,e(j.pd).find("iframe").each(function(){if((this.contentDocument||this.contentWindow.document)===n)return l=this,!1}),d=l);c.iframe=d}h.hide(a.getActiveImage());M&&j.iframe&&(j.iframe.scrolled=e(m.parent).scrollTop(),m.parent.scrollTo(0,0));c=a.getData();d=a._options;var y=!a._options.trueFullscreen||!w.support,g={height:"100%",overflow:"hidden",margin:0,
  padding:0};y&&(a.$("container").addClass("fullscreen"),j.prev=a.$("container").prev(),j.prev.length||(j.parent=a.$("container").parent()),a.$("container").appendTo("body"),h.forceStyles(a.get("container"),{position:f.TOUCH?"absolute":"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1E4}),h.forceStyles(r().html,g),h.forceStyles(r().body,g));M&&j.iframe&&(h.forceStyles(j.pd.documentElement,g),h.forceStyles(j.pd.body,g),h.forceStyles(j.iframe,e.extend(g,{width:"100%",height:"100%",top:0,left:0,
  position:"fixed",zIndex:1E4,border:"none"})));j.keymap=e.extend({},a._keyboard.map);a.attachKeyboard({escape:a.exitFullscreen,right:a.next,left:a.prev});j.crop=d.imageCrop;d.fullscreenCrop!=p&&(d.imageCrop=d.fullscreenCrop);if(c&&c.big&&c.image!==c.big){d=new f.Picture;var U=d.isCached(c.big),q=a.getIndex(),I=a._thumbnails[q];a.trigger({type:f.LOADSTART,cached:U,rewind:!1,index:q,imageTarget:a.getActiveImage(),thumbTarget:I,galleriaData:c});d.load(c.big,function(b){a._scaleImage(b,{complete:function(b){a.trigger({type:f.LOADFINISH,
  cached:U,index:q,rewind:!1,imageTarget:b.image,thumbTarget:I});var c=a._controls.getActive().image;c&&e(c).width(b.image.width).height(b.image.height).attr("style",e(b.image).attr("style")).attr("src",b.image.src)}})})}a.rescale(function(){a.addTimer(!1,function(){y&&h.show(a.getActiveImage());"function"===typeof b&&b.call(a)},100);a.trigger(f.FULLSCREEN_ENTER)});y?v.resize(j.scale):h.show(a.getActiveImage())},scale:function(){a.rescale()},exit:function(b){j.beforeExit(function(){b=j.parseCallback(b);
  a._options.trueFullscreen&&w.support?w.exit(b):j._exit(b)})},_exit:function(b){j.active=!1;var c=!a._options.trueFullscreen||!w.support,d=a.$("container").removeClass("fullscreen");j.parent?j.parent.prepend(d):d.insertAfter(j.prev);c&&(h.hide(a.getActiveImage()),h.revertStyles(a.get("container"),r().html,r().body),f.TOUCH||m.scrollTo(0,j.scrolled));M&&j.iframe&&(h.revertStyles(j.pd.documentElement,j.pd.body,j.iframe),j.iframe.scrolled&&m.parent.scrollTo(0,j.iframe.scrolled));a.detachKeyboard();a.attachKeyboard(j.keymap);
  a._options.imageCrop=j.crop;var d=a.getData().big,e=a._controls.getActive().image;!a.getData().iframe&&(e&&d&&d==e.src)&&m.setTimeout(function(a){return function(){e.src=a}}(a.getData().image),1);a.rescale(function(){a.addTimer(!1,function(){c&&h.show(a.getActiveImage());"function"===typeof b&&b.call(a);v.trigger("resize")},50);a.trigger(f.FULLSCREEN_EXIT)});v.unbind("resize",j.scale)}},l=this._idle={trunk:[],bound:!1,active:!1,add:function(a,b,c,d){if(a){l.bound||l.addEvent();a=e(a);"boolean"==typeof c&&
  (d=c,c={});c=c||{};var g={},j;for(j in b)b.hasOwnProperty(j)&&(g[j]=a.css(j));a.data("idle",{from:e.extend(g,c),to:b,complete:!0,busy:!1});d?a.css(b):l.addTimer();l.trunk.push(a)}},remove:function(b){b=e(b);e.each(l.trunk,function(a,c){c&&(c.length&&!c.not(b).length)&&(b.css(b.data("idle").from),l.trunk.splice(a,1))});l.trunk.length||(l.removeEvent(),a.clearTimer(l.timer))},addEvent:function(){l.bound=!0;a.$("container").bind("mousemove click",l.showAll);"hover"==a._options.idleMode&&a.$("container").bind("mouseleave",
  l.hide)},removeEvent:function(){l.bound=!1;a.$("container").bind("mousemove click",l.showAll);"hover"==a._options.idleMode&&a.$("container").unbind("mouseleave",l.hide)},addTimer:function(){"hover"!=a._options.idleMode&&a.addTimer("idle",function(){l.hide()},a._options.idleTime)},hide:function(){if(a._options.idleMode&&!(!1===a.getIndex()||a.getData().iframe)){a.trigger(f.IDLE_ENTER);var b=l.trunk.length;e.each(l.trunk,function(c,d){var e=d.data("idle");e&&(d.data("idle").complete=!1,h.animate(d,
  e.to,{duration:a._options.idleSpeed,complete:function(){c==b-1&&(l.active=!1)}}))})}},showAll:function(){a.clearTimer("idle");e.each(l.trunk,function(a,b){l.show(b)})},show:function(b){var c=b.data("idle");if(!l.active||!c.busy&&!c.complete)c.busy=!0,a.trigger(f.IDLE_EXIT),a.clearTimer("idle"),h.animate(b,c.from,{duration:a._options.idleSpeed/2,complete:function(){l.active=!0;e(b).data("idle").busy=!1;e(b).data("idle").complete=!0}});l.addTimer()}},k=this._lightbox={width:0,height:0,initialized:!1,
  active:null,image:null,elems:{},keymap:!1,init:function(){a.trigger(f.LIGHTBOX_OPEN);if(!k.initialized){k.initialized=!0;var b={},c=a._options,d="",c={overlay:"position:fixed;display:none;opacity:"+c.overlayOpacity+";filter:alpha(opacity="+100*c.overlayOpacity+");top:0;left:0;width:100%;height:100%;background:"+c.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:"position:absolute;background:#000;width:100%;height:100%;",
  content:"position:absolute;background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:"position:absolute;bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",close:"position:absolute;top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:"position:absolute;top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:"position:absolute;width:50%;top:0;bottom:40px;cursor:pointer;",
  nextholder:"position:absolute;width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",next:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"},
  g={};q&&7<q&&(c.nextholder+="background:#000;filter:alpha(opacity=0);",c.prevholder+="background:#000;filter:alpha(opacity=0);");e.each(c,function(a,b){d+=".galleria-lightbox-"+a+"{"+b+"}"});d+=".galleria-lightbox-box.iframe .galleria-lightbox-prevholder,.galleria-lightbox-box.iframe .galleria-lightbox-nextholder{width:100px;height:100px;top:50%;margin-top:-70px}";h.insertStyleTag(d,"galleria-lightbox");e.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),
  function(c,d){a.addElement("lightbox-"+d);b[d]=k.elems[d]=a.get("lightbox-"+d)});k.image=new f.Picture;e.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(a,b){var c=[];e.each(b.split(" "),function(a,b){c.push("lightbox-"+b)});g["lightbox-"+a]=c});a.append(g);e(b.image).append(k.image.container);e(r().body).append(b.overlay,b.box);e(b.close).bind("click",k.hide).html("&#215;").hover(function(){e(this).css("color",
  "#bbb")},function(){e(this).css("color","#444")});e.each(["Prev","Next"],function(a,c){var d=e(b[c.toLowerCase()]).html(/v/.test(c)?"&#8249;&#160;":"&#160;&#8250;"),g=e(b[c.toLowerCase()+"holder"]);g.bind("click",function(){k["show"+c]()});8>q||f.TOUCH?d.show():g.hover(function(){d.show()},function(){d.stop().fadeOut(200)})});e(b.overlay).bind("click",k.hide);f.IPAD&&(a._options.lightboxTransitionSpeed=0)}},rescale:function(b){var c=Math.min(v.width()-40,k.width),d=Math.min(v.height()-60,k.height),
  d=Math.min(c/k.width,d/k.height),c=Math.round(k.width*d)+40,d=Math.round(k.height*d)+60,c={width:c,height:d,"margin-top":-1*Math.ceil(d/2),"margin-left":-1*Math.ceil(c/2)};b?e(k.elems.box).css(c):e(k.elems.box).animate(c,{duration:a._options.lightboxTransitionSpeed,easing:a._options.easing,complete:function(){var b=k.image,c=a._options.lightboxFadeSpeed;a.trigger({type:f.LIGHTBOX_IMAGE,imageTarget:b.image});e(b.container).show();e(b.image).animate({opacity:1},c);h.show(k.elems.info,c)}})},hide:function(){k.image.image=
  null;v.unbind("resize",k.rescale);e(k.elems.box).hide();h.hide(k.elems.info);a.detachKeyboard();a.attachKeyboard(k.keymap);k.keymap=!1;h.hide(k.elems.overlay,200,function(){e(this).hide().css("opacity",a._options.overlayOpacity);a.trigger(f.LIGHTBOX_CLOSE)})},showNext:function(){k.show(a.getNext(k.active))},showPrev:function(){k.show(a.getPrev(k.active))},show:function(b){k.active=b="number"===typeof b?b:a.getIndex()||0;k.initialized||k.init();k.keymap||(k.keymap=e.extend({},a._keyboard.map),a.attachKeyboard({escape:k.hide,
  right:k.showNext,left:k.showPrev}));v.unbind("resize",k.rescale);var c=a.getData(b),d=a.getDataLength(),g=a.getNext(b),l,j,y;h.hide(k.elems.info);try{for(y=a._options.preload;0<y;y--)j=new f.Picture,l=a.getData(g),j.preload("big"in l?l.big:l.image),g=a.getNext(g)}catch(n){}k.image.isIframe=!!c.iframe;e(k.elems.box).toggleClass("iframe",!!c.iframe);k.image.load(c.iframe||c.big||c.image,function(g){if(g.isIframe){var l=e(m).width(),j=e(m).height();if(a._options.maxVideoSize){var f=Math.min(a._options.maxVideoSize/
  l,a._options.maxVideoSize/j);1>f&&(l*=f,j*=f)}k.width=l;k.height=j}else k.width=g.original.width,k.height=g.original.height;e(g.image).css({width:g.isIframe?"100%":"100.1%",height:g.isIframe?"100%":"100.1%",top:0,zIndex:99998,opacity:0,visibility:"visible"});k.elems.title.innerHTML=c.title||"";k.elems.counter.innerHTML=b+1+" / "+d;v.resize(k.rescale);k.rescale()});e(k.elems.overlay).show().css("visibility","visible");e(k.elems.box).show()}},y=this._timer={trunk:{},add:function(a,b,c,d){a=a||(new Date).getTime();
  d=d||!1;this.clear(a);if(d){var e=b;b=function(){e();y.add(a,b,c)}}this.trunk[a]=m.setTimeout(b,c)},clear:function(a){var b;if(a&&a in this.trunk)m.clearTimeout(this.trunk[a]),delete this.trunk[a];else if("undefined"===typeof a)for(b in this.trunk)this.trunk.hasOwnProperty(b)&&(a=b,m.clearTimeout(this.trunk[a]),delete this.trunk[a])}};return this};f.prototype={constructor:f,init:function(a,b){b=ja(b);this._original={target:a,options:b,data:null};this._target=this._dom.target=a.nodeName?a:e(a).get(0);
  this._original.html=this._target.innerHTML;E.push(this);if(this._target)return this._options={autoplay:!1,carousel:!0,carouselFollow:!0,carouselSpeed:400,carouselSteps:"auto",clicknext:!1,dailymotion:{foreground:"%23EEEEEE",highlight:"%235BCEC5",background:"%23222222",logo:0,hideInfos:1},dataConfig:function(){return{}},dataSelector:"img",dataSort:!1,dataSource:this._target,debug:p,dummy:p,easing:"galleria",extend:function(){},fullscreenCrop:p,fullscreenDoubleTap:!0,fullscreenTransition:p,height:0,
  idleMode:!0,idleTime:3E3,idleSpeed:200,imageCrop:!1,imageMargin:0,imagePan:!1,imagePanSmoothness:12,imagePosition:"50%",imageTimeout:p,initialTransition:p,keepSource:!1,layerFollow:!0,lightbox:!1,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceImages:!0,maxScaleRatio:p,maxVideoSize:p,minScaleRatio:p,overlayOpacity:0.85,overlayBackground:"#0b0b0b",pauseOnInteraction:!0,popupLinks:!1,preload:2,queue:!0,responsive:!0,show:0,showInfo:!0,showCounter:!0,showImagenav:!0,swipe:!0,thumbCrop:!0,
  thumbEventType:"click",thumbFit:!0,thumbMargin:0,thumbQuality:"auto",thumbDisplayOrder:!0,thumbnails:!0,touchTransition:p,transition:"fade",transitionInitial:p,transitionSpeed:400,trueFullscreen:!0,useCanvas:!1,vimeo:{title:0,byline:0,portrait:0,color:"aaaaaa"},wait:5E3,width:"auto",youtube:{modestbranding:1,autohide:1,color:"white",hd:1,rel:0,showinfo:0}},this._options.initialTransition=this._options.initialTransition||this._options.transitionInitial,b&&!1===b.debug&&(ha=!1),b&&"string"===typeof b.dummy&&
  (V=b.dummy),f.TOUCH||(this._options.swipe=!1),e(this._target).children().hide(),f.QUIRK&&f.raise("Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML and add a correct doctype."),"object"===typeof f.theme?this._init():Y.push(this),this;f.raise("Target not found",!0)},_init:function(){var a=this,b=this._options;if(this._initialized)return f.raise("Init failed: Gallery instance already initialized."),this;this._initialized=!0;if(!f.theme)return f.raise("Init failed: No theme found.",
  !0),this;e.extend(!0,b,f.theme.defaults,this._original.options,f.configure.options);b.swipe&&(b.clicknext=!1,b.imagePan=!1);var c=n.createElement("canvas");"getContext"in c&&(x=x||{elem:c,context:c.getContext("2d"),cache:{},length:0});f.Fastclick.init(this.get("target"));this.bind(f.DATA,function(){m.screen&&(m.screen.width&&Array.prototype.forEach)&&this._data.forEach(function(a){var b="devicePixelRatio"in m?m.devicePixelRatio:1;1024>Math.max(m.screen.width,m.screen.height)*b&&(a.big=a.image)});
  this._original.data=this._data;this.get("total").innerHTML=this.getDataLength();var b=this.$("container");2>a._options.height&&(a._userRatio=a._ratio=a._options.height);var c={width:0,height:0},d=function(){return a.$("stage").height()};h.wait({until:function(){c=a._getWH();b.width(c.width).height(c.height);return d()&&c.width&&50<c.height},success:function(){a._width=c.width;a._height=c.height;a._ratio=a._ratio||c.height/c.width;f.WEBKIT?m.setTimeout(function(){a._run()},1):a._run()},error:function(){d()?
  f.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+c.width+"px, height: "+c.height+"px.",!0):f.raise("Could not extract a stage height from the CSS. Traced height: "+d()+"px.",!0)},timeout:"number"==typeof this._options.wait?this._options.wait:!1})});this.append({"info-text":["info-title","info-description"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],
  "thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]});h.hide(this.$("counter").append(this.get("current"),n.createTextNode(" / "),this.get("total")));this.setCounter("&#8211;");h.hide(a.get("tooltip"));this.$("container").addClass(f.TOUCH?"touch":"notouch");this._options.swipe||e.each(Array(2),function(b){var c=new f.Picture;e(c.container).css({position:"absolute",top:0,left:0}).prepend(a._layers[b]=e(h.create("galleria-layer")).css({position:"absolute",
  top:0,left:0,right:0,bottom:0,zIndex:2})[0]);a.$("images").append(c.container);a._controls[b]=c});this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"});b.swipe&&(this.$("images").css({position:"absolute",top:0,left:0,width:0,height:"100%"}),this.finger=new f.Finger(this.get("stage"),{onchange:function(b){a.setCounter(b);a.pause();a.show(b)},oncomplete:function(b){b=Math.max(0,Math.min(parseInt(b,10),a.getDataLength()-1));var c=a.getData(b);if(c){var d=c.iframe||(a.isFullscreen()&&
  "big"in c?c.big:c.image),e=a._controls.slides[b],d=e.isCached(d);a.trigger({type:f.IMAGE,cached:d,index:b,imageTarget:e.image,thumbTarget:a._thumbnails[b].image,galleriaData:c});a._options.carousel&&a._options.carouselFollow&&a._carousel.follow(b)}}}),this.bind(f.RESCALE,function(){this.finger.setup()}),this.bind(f.IMAGE,function(b){a.setCounter(b.index);a.setInfo(b.index);e.each([this.getNext(),this.getPrev()],function(b,c){var d=a.getData(c),e=a._controls.slides[c],d=d.iframe||(a.isFullscreen()&&
  "big"in d?d.big:d.image);e.ready||a._controls.slides[c].load(d,function(b){a._scaleImage(b)})})}));this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"});this.$("image-nav-right, image-nav-left").bind("click",function(c){b.clicknext&&c.stopPropagation();b.pauseOnInteraction&&a.pause();c=/right/.test(this.className)?"next":"prev";a[c]()});e.each(["info","counter","image-nav"],function(c,d){!1===b["show"+d.substr(0,1).toUpperCase()+d.substr(1).replace(/-/,"")]&&h.moveOut(a.get(d.toLowerCase()))});
  this.load();!b.keepSource&&!q&&(this._target.innerHTML="");this.get("errors")&&this.appendChild("target","errors");this.appendChild("target","container");if(b.carousel){var d=0,g=b.show;this.bind(f.THUMBNAIL,function(){this.updateCarousel();++d==this.getDataLength()&&("number"==typeof g&&0<g)&&this._carousel.follow(g)})}b.responsive&&v.bind("resize",function(){a.isFullscreen()||a.resize()});b.fullscreenDoubleTap&&this.$("stage").bind("touchstart",function(){var b,c,d,e,g,f;a.$("stage").bind("touchmove",
  function(){b=0});return function(m){/(-left|-right)/.test(m.target.className)||(f=h.timestamp(),c=(m.originalEvent.touches?m.originalEvent.touches[0]:m).pageX,d=(m.originalEvent.touches?m.originalEvent.touches[0]:m).pageY,2>m.originalEvent.touches.length&&300>f-b&&20>c-e&&20>d-g?(a.toggleFullscreen(),m.preventDefault()):(b=f,e=c,g=d))}}());e.each(f.on.binds,function(b,c){-1==e.inArray(c.hash,a._binds)&&a.bind(c.type,c.callback)});return this},addTimer:function(){this._timer.add.apply(this._timer,
  h.array(arguments));return this},clearTimer:function(){this._timer.clear.apply(this._timer,h.array(arguments));return this},_getWH:function(){var a=this.$("container"),b=this.$("target"),c=this,d={},g;e.each(["width","height"],function(e,f){c._options[f]&&"number"===typeof c._options[f]?d[f]=c._options[f]:(g=[h.parseValue(a.css(f)),h.parseValue(b.css(f)),a[f](),b[f]()],c["_"+f]||g.splice(g.length,h.parseValue(a.css("min-"+f)),h.parseValue(b.css("min-"+f))),d[f]=Math.max.apply(Math,g))});c._userRatio&&
  (d.height=d.width*c._userRatio);return d},_createThumbnails:function(a){this.get("total").innerHTML=this.getDataLength();var b,c,d,g,j=this,l=this._options,k=a?this._data.length-a.length:0,y=k,qa=[],ra=0,B=8>q?"http://upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif":"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D",p;p=j.$("thumbnails").find(".active");p=p.length?p.find("img").attr("src"):!1;var u="string"===typeof l.thumbnails?l.thumbnails.toLowerCase():
  null,s=function(a){return n.defaultView&&n.defaultView.getComputedStyle?n.defaultView.getComputedStyle(b.container,null)[a]:g.css(a)},t=function(a,b,c){return function(){e(c).append(a);j.trigger({type:f.THUMBNAIL,thumbTarget:a,index:b,galleriaData:j.getData(b)})}},U=function(a){l.pauseOnInteraction&&j.pause();var b=e(a.currentTarget).data("index");j.getIndex()!==b&&j.show(b);a.preventDefault()},r=function(a,b){e(a.container).css("visibility","visible");j.trigger({type:f.THUMBNAIL,thumbTarget:a.image,
  index:a.data.order,galleriaData:j.getData(a.data.order)});"function"==typeof b&&b.call(j,a)},I=function(a,b){a.scale({width:a.data.width,height:a.data.height,crop:l.thumbCrop,margin:l.thumbMargin,canvas:l.useCanvas,complete:function(a){var c=["left","top"],d,g,f=j.getData(a.index),k=f.thumb.split(":");e.each(["Width","Height"],function(b,f){d=f.toLowerCase();if((!0!==l.thumbCrop||l.thumbCrop===d)&&l.thumbFit)g={},g[d]=a[d],e(a.container).css(g),g={},g[c[b]]=0,e(a.image).css(g);a["outer"+f]=e(a.container)["outer"+
  f](!0)});h.toggleQuality(a.image,!0===l.thumbQuality||"auto"===l.thumbQuality&&a.original.width<3*a.width);f.iframe&&2==k.length&&k[0]in H?H[k[0]].getThumb(k[1],function(c){return function(d){c.src=d;r(a,b)}}(a.image)):l.thumbDisplayOrder&&!a.lazy?e.each(qa,function(a,c){a===ra&&(c.ready&&!c.displayed)&&(ra++,c.displayed=!0,r(c,b))}):r(a,b)}})};a||(this._thumbnails=[],this.$("thumbnails").empty());for(;this._data[k];k++)c=this._data[k],a=c.thumb||c.image,(!0===l.thumbnails||"lazy"==u)&&(c.thumb||
  c.image)?(b=new f.Picture(k),b.index=k,b.displayed=!1,b.lazy=!1,b.video=!1,this.$("thumbnails").append(b.container),g=e(b.container),g.css("visibility","hidden"),b.data={width:h.parseValue(s("width")),height:h.parseValue(s("height")),order:k,src:a},l.thumbFit&&!0!==l.thumbCrop?g.css({width:"auto",height:"auto"}):g.css({width:b.data.width,height:b.data.height}),d=a.split(":"),2==d.length&&d[0]in H?(b.video=!0,b.ready=!0,b.load(B,{height:b.data.height,width:1.25*b.data.height},I)):"lazy"==u?(g.addClass("lazy"),
  b.lazy=!0,b.load(B,{height:b.data.height,width:b.data.width})):b.load(a,I),"all"===l.preload&&b.preload(c.image)):c.iframe||"empty"===u||"numbers"===u?(b={container:h.create("galleria-image"),image:h.create("img","span"),ready:!0},"numbers"===u&&e(b.image).text(k+1),c.iframe&&e(b.image).addClass("iframe"),this.$("thumbnails").append(b.container),m.setTimeout(t(b.image,k,b.container),50+20*k)):b={container:null,image:null},e(b.container).add(l.keepSource&&l.linkSourceImages?c.original:null).data("index",
  k).bind(l.thumbEventType,U).data("thumbload",I),p===a&&e(b.container).addClass("active"),this._thumbnails.push(b);qa=this._thumbnails.slice(y);return this},lazyLoad:function(a,b){var c=a.constructor==Array?a:[a],d=this,g=0;e.each(c,function(a,f){if(!(f>d._thumbnails.length-1)){var h=d._thumbnails[f],m=h.data,n=function(){++g==c.length&&"function"==typeof b&&b.call(d)},p=e(h.container).data("thumbload");h.video?p.call(d,h,n):h.load(m.src,function(a){p.call(d,a,n)})}});return this},lazyLoadChunks:function(a,
  b){var c=this.getDataLength(),d=0,e=0,f=[],l=[],h=this;for(b=b||0;d<c;d++)if(l.push(d),++e==a||d==c-1)f.push(l),e=0,l=[];var n=function(a){var c=f.shift();c&&m.setTimeout(function(){h.lazyLoad(c,function(){n(!0)})},b&&a?b:0)};n(!1);return this},_run:function(){var a=this;a._createThumbnails();h.wait({timeout:1E4,until:function(){f.OPERA&&a.$("stage").css("display","inline-block");a._stageWidth=a.$("stage").width();a._stageHeight=a.$("stage").height();return a._stageWidth&&50<a._stageHeight},success:function(){X.push(a);
  if(a._options.swipe){var b=a.$("images").width(a.getDataLength()*a._stageWidth);e.each(Array(a.getDataLength()),function(c){var d=new f.Picture;e(d.container).css({position:"absolute",top:0,left:a._stageWidth*c}).prepend(a._layers[c]=e(h.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]).appendTo(b);a._controls.slides.push(d)});a.finger.setup()}h.show(a.get("counter"));a._options.carousel&&a._carousel.bindControls();a._options.autoplay&&(a.pause(),"number"===
  typeof a._options.autoplay&&(a._playtime=a._options.autoplay),a._playing=!0);a._firstrun?(a._options.autoplay&&a.trigger(f.PLAY),"number"===typeof a._options.show&&a.show(a._options.show)):(a._firstrun=!0,f.History&&f.History.change(function(b){isNaN(b)?m.history.go(-1):a.show(b,p,!0)}),a.trigger(f.READY),f.theme.init.call(a,a._options),e.each(f.ready.callbacks,function(b,d){"function"==typeof d&&d.call(a,a._options)}),a._options.extend.call(a,a._options),/^[0-9]{1,4}$/.test(ia)&&f.History?a.show(ia,
  p,!0):a._data[a._options.show]&&a.show(a._options.show),a._options.autoplay&&a.trigger(f.PLAY))},error:function(){f.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+a._stageWidth+"px, height: "+a._stageHeight+"px.",!0)}})},load:function(a,b,c){var d=this,g=this._options;this._data=[];this._thumbnails=[];this.$("thumbnails").empty();"function"===typeof b&&(c=b,b=null);a=a||g.dataSource;b=b||g.dataSelector;c=c||g.dataConfig;/^function Object/.test(a.constructor)&&
  (a=[a]);a.constructor===Array?this.validate(a)?this._data=a:f.raise("Load failed: JSON Array not valid."):e(a).find(b+",.video,.iframe").each(function(a,b){b=e(b);var g={},f=b.parent(),h=f.attr("href"),f=f.attr("rel");h&&("IMG"==b[0].nodeName||b.hasClass("video"))&&ka(h)?g.video=h:h&&b.hasClass("iframe")?g.iframe=h:g.image=g.big=h;f&&(g.big=f);e.each(["big","title","description","link","layer"],function(a,c){b.data(c)&&(g[c]=b.data(c))});d._data.push(e.extend({title:b.attr("title")||"",thumb:b.attr("src"),
  image:b.attr("src"),big:b.attr("src"),description:b.attr("alt")||"",link:b.attr("longdesc"),original:b.get(0)},g,c(b)))});"function"==typeof g.dataSort?G.sort.call(this._data,g.dataSort):"random"==g.dataSort&&this._data.sort(function(){return Math.round(Math.random())-0.5});this.getDataLength()&&this._parseData().trigger(f.DATA);return this},_parseData:function(){var a=this,b;e.each(this._data,function(c,d){b=a._data[c];!1==="thumb"in d&&(b.thumb=d.image);!1 in d&&(b.big=d.image);if("video"in d){var g=
  ka(d.video);if(g){var f=H[g.provider].embed(g.id),h;if("object"==typeof a._options[g.provider]){var k=[];e.each(a._options[g.provider],function(a,b){k.push(a+"="+b)});"youtube"==g.provider&&(k=["wmode=opaque"].concat(k));h="?"+k.join("&")}else h="";b.iframe=f+h;delete b.video;if(!("thumb"in b)||!b.thumb)b.thumb=g.provider+":"+g.id}}});return this},destroy:function(){this.$("target").data("galleria",null);this.$("container").unbind("galleria");this.get("target").innerHTML=this._original.html;this.clearTimer();
  h.removeFromArray(E,this);h.removeFromArray(X,this);return this},splice:function(){var a=this,b=h.array(arguments);m.setTimeout(function(){G.splice.apply(a._data,b);a._parseData()._createThumbnails()},2);return a},push:function(){var a=this,b=h.array(arguments);1==b.length&&b[0].constructor==Array&&(b=b[0]);m.setTimeout(function(){G.push.apply(a._data,b);a._parseData()._createThumbnails(b)},2);return a},_getActive:function(){return this._controls.getActive()},validate:function(){return!0},bind:function(a,
  b){a=W(a);this.$("container").bind(a,this.proxy(b));return this},unbind:function(a){a=W(a);this.$("container").unbind(a);return this},trigger:function(a){a="object"===typeof a?e.extend(a,{scope:this}):{type:W(a),scope:this};this.$("container").trigger(a);return this},addIdleState:function(a,b,c,d){this._idle.add.apply(this._idle,h.array(arguments));return this},removeIdleState:function(a){this._idle.remove.apply(this._idle,h.array(arguments));return this},enterIdleMode:function(){this._idle.hide();
  return this},exitIdleMode:function(){this._idle.showAll();return this},enterFullscreen:function(a){this._fullscreen.enter.apply(this,h.array(arguments));return this},exitFullscreen:function(a){this._fullscreen.exit.apply(this,h.array(arguments));return this},toggleFullscreen:function(a){this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,h.array(arguments));return this},bindTooltip:function(a,b){this._tooltip.bind.apply(this._tooltip,h.array(arguments));return this},defineTooltip:function(a,
  b){this._tooltip.define.apply(this._tooltip,h.array(arguments));return this},refreshTooltip:function(a){this._tooltip.show.apply(this._tooltip,h.array(arguments));return this},openLightbox:function(){this._lightbox.show.apply(this._lightbox,h.array(arguments));return this},closeLightbox:function(){this._lightbox.hide.apply(this._lightbox,h.array(arguments));return this},getActiveImage:function(){var a=this._getActive();return a?a.image:p},getActiveThumb:function(){return this._thumbnails[this._active].image||
  p},getMousePosition:function(a){return{x:a.pageX-this.$("container").offset().left,y:a.pageY-this.$("container").offset().top}},addPan:function(a){if(!1!==this._options.imageCrop){a=e(a||this.getActiveImage());var b=this,c=a.width()/2,d=a.height()/2,g=parseInt(a.css("left"),10),f=parseInt(a.css("top"),10),l=g||0,k=f||0,m=0,n=0,p=!1,B=h.timestamp(),s=0,u=0,r=function(b,c,d){if(0<b&&(u=Math.round(Math.max(-1*b,Math.min(0,c))),s!==u))if(s=u,8===q)a.parent()["scroll"+d](-1*u);else b={},b[d.toLowerCase()]=
  u,a.css(b)},t=function(a){50>h.timestamp()-B||(p=!0,c=b.getMousePosition(a).x,d=b.getMousePosition(a).y)};8===q&&(a.parent().scrollTop(-1*k).scrollLeft(-1*l),a.css({top:0,left:0}));this.$("stage").unbind("mousemove",t).bind("mousemove",t);this.addTimer("pan"+b._id,function(){p&&(m=a.width()-b._stageWidth,n=a.height()-b._stageHeight,g=-1*c/b._stageWidth*m,f=-1*d/b._stageHeight*n,l+=(g-l)/b._options.imagePanSmoothness,k+=(f-k)/b._options.imagePanSmoothness,r(n,k,"Top"),r(m,l,"Left"))},50,!0);return this}},
  proxy:function(a,b){if("function"!==typeof a)return t;b=b||this;return function(){return a.apply(b,h.array(arguments))}},removePan:function(){this.$("stage").unbind("mousemove");this.clearTimer("pan"+this._id);return this},addElement:function(a){var b=this._dom;e.each(h.array(arguments),function(a,d){b[d]=h.create("galleria-"+d)});return this},attachKeyboard:function(a){this._keyboard.attach.apply(this._keyboard,h.array(arguments));return this},detachKeyboard:function(){this._keyboard.detach.apply(this._keyboard,
  h.array(arguments));return this},appendChild:function(a,b){this.$(a).append(this.get(b)||b);return this},prependChild:function(a,b){this.$(a).prepend(this.get(b)||b);return this},remove:function(a){this.$(h.array(arguments).join(",")).remove();return this},append:function(a){var b,c;for(b in a)if(a.hasOwnProperty(b))if(a[b].constructor===Array)for(c=0;a[b][c];c++)this.appendChild(b,a[b][c]);else this.appendChild(b,a[b]);return this},_scaleImage:function(a,b){if(a=a||this._controls.getActive()){var c,
  d=function(a){e(a.container).children(":first").css({top:Math.max(0,h.parseValue(a.image.style.top)),left:Math.max(0,h.parseValue(a.image.style.left)),width:h.parseValue(a.image.width),height:h.parseValue(a.image.height)})};b=e.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition,iframelimit:this._options.maxVideoSize},b);this._options.layerFollow&&
  !0!==this._options.imageCrop?"function"==typeof b.complete?(c=b.complete,b.complete=function(){c.call(a,a);d(a)}):b.complete=d:e(a.container).children(":first").css({top:0,left:0});a.scale(b);return this}},updateCarousel:function(){this._carousel.update();return this},resize:function(a,b){"function"==typeof a&&(b=a,a=p);a=e.extend({width:0,height:0},a);var c=this,d=this.$("container");e.each(a,function(b,e){e||(d[b]("auto"),a[b]=c._getWH()[b])});e.each(a,function(a,b){d[a](b)});return this.rescale(b)},
  rescale:function(a,b,c){var d=this;"function"===typeof a&&(c=a,a=p);(function(){d._stageWidth=a||d.$("stage").width();d._stageHeight=b||d.$("stage").height();d._options.swipe?(e.each(d._controls.slides,function(a,b){d._scaleImage(b);e(b.container).css("left",d._stageWidth*a)}),d.$("images").css("width",d._stageWidth*d.getDataLength())):d._scaleImage();d._options.carousel&&d.updateCarousel();d.trigger(f.RESCALE);"function"===typeof c&&c.call(d)}).call(d);return this},refreshImage:function(){this._scaleImage();
  this._options.imagePan&&this.addPan();return this},show:function(a,b,c){var d=this._options.swipe;if(d||!(3<this._queue.length||!1===a||!this._options.queue&&this._queue.stalled))if(a=Math.max(0,Math.min(parseInt(a,10),this.getDataLength()-1)),b="undefined"!==typeof b?!!b:a<this.getIndex(),!c&&f.History)f.History.set(a.toString());else{d&&a!==this._active&&(this.finger.to=-(a*this.finger.width),this.finger.index=a);this._active=a;if(d){c=this.getData(a);var g=this;if(!c)return;var d=c.iframe||(this.isFullscreen()&&
  "big"in c?c.big:c.image),h=this._controls.slides[a],l={cached:h.isCached(d),index:a,rewind:b,imageTarget:h.image,thumbTarget:this._thumbnails[a].image,galleriaData:c};this.trigger(e.extend(l,{type:f.LOADSTART}));var k=function(){g.trigger(e.extend(l,{type:f.LOADFINISH}));g._playCheck()};h.ready?(g.trigger(e.extend(l,{type:f.LOADFINISH})),k()):h.load(d,function(a){g._scaleImage(a,k).trigger(e.extend(l,{type:f.IMAGE}));k()})}else G.push.call(this._queue,{index:a,rewind:b}),this._queue.stalled||this._show();
  return this}},_show:function(){var a=this,b=this._queue[0],c=this.getData(b.index);if(c){var d=c.iframe||(this.isFullscreen()&&"big"in c?c.big:c.image),g=this._controls.getActive(),j=this._controls.getNext(),l=j.isCached(d),k=this._thumbnails[b.index],n=function(){e(j.image).trigger("mouseup")},q;q=function(){P=!1;h.toggleQuality(j.image,a._options.imageQuality);a._layers[a._controls.active].innerHTML="";e(g.container).css({zIndex:0,opacity:0}).show();g.isIframe&&e(g.container).find("iframe").remove();
  a.$("container").toggleClass("iframe",!!c.iframe);e(j.container).css({zIndex:1,left:0,top:0}).show();a._controls.swap();a._options.imagePan&&a.addPan(j.image);(c.link||a._options.lightbox||a._options.clicknext)&&e(j.image).css({cursor:"pointer"}).bind("mouseup",function(b){"number"==typeof b.which&&1<b.which||(a._options.clicknext&&!f.TOUCH?(a._options.pauseOnInteraction&&a.pause(),a.next()):c.link?a._options.popupLinks?m.open(c.link,"_blank"):m.location.href=c.link:a._options.lightbox&&a.openLightbox())});
  a._playCheck();a.trigger({type:f.IMAGE,index:b.index,imageTarget:j.image,thumbTarget:k.image,galleriaData:c});G.shift.call(a._queue);a._queue.stalled=!1;a._queue.length&&a._show()};this._options.carousel&&this._options.carouselFollow&&this._carousel.follow(b.index);if(this._options.preload){var s,B,r=this.getNext(),u;try{for(B=this._options.preload;0<B;B--)s=new f.Picture,u=a.getData(r),s.preload(this.isFullscreen()&&"big"in u?u.big:u.image),r=a.getNext(r)}catch(t){}}h.show(j.container);j.isIframe=
  !!c.iframe;e(a._thumbnails[b.index].container).addClass("active").siblings(".active").removeClass("active");a.trigger({type:f.LOADSTART,cached:l,index:b.index,rewind:b.rewind,imageTarget:j.image,thumbTarget:k.image,galleriaData:c});a._queue.stalled=!0;j.load(d,function(d){var j=e(a._layers[1-a._controls.active]).html(c.layer||"").hide();a._scaleImage(d,{complete:function(d){"image"in g&&h.toggleQuality(g.image,!1);h.toggleQuality(d.image,!1);a.removePan();a.setInfo(b.index);a.setCounter(b.index);
  c.layer&&(j.show(),(c.link||a._options.lightbox||a._options.clicknext)&&j.css("cursor","pointer").unbind("mouseup").mouseup(n));var k=a._options.transition;e.each({initial:null===g.image,touch:f.TOUCH,fullscreen:a.isFullscreen()},function(b,c){if(c&&a._options[b+"Transition"]!==p)return k=a._options[b+"Transition"],!1});if(!1===k in L)q();else{var m={prev:g.container,next:d.container,rewind:b.rewind,speed:a._options.transitionSpeed||400};P=!0;ga.call(a,k,m,q)}a.trigger({type:f.LOADFINISH,cached:l,
  index:b.index,rewind:b.rewind,imageTarget:d.image,thumbTarget:a._thumbnails[b.index].image,galleriaData:a.getData(b.index)})}})})}},getNext:function(a){a="number"===typeof a?a:this.getIndex();return a===this.getDataLength()-1?0:a+1},getPrev:function(a){a="number"===typeof a?a:this.getIndex();return 0===a?this.getDataLength()-1:a-1},next:function(){1<this.getDataLength()&&this.show(this.getNext(),!1);return this},prev:function(){1<this.getDataLength()&&this.show(this.getPrev(),!0);return this},get:function(a){return a in
  this._dom?this._dom[a]:null},getData:function(a){return a in this._data?this._data[a]:this._data[this._active]},getDataLength:function(){return this._data.length},getIndex:function(){return"number"===typeof this._active?this._active:!1},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(a){return"undefined"===typeof a?this._options:this._options[a]},setOptions:function(a,b){"object"===typeof a?e.extend(this._options,a):this._options[a]=
  b;return this},play:function(a){this._playing=!0;this._playtime=a||this._playtime;this._playCheck();this.trigger(f.PLAY);return this},pause:function(){this._playing=!1;this.trigger(f.PAUSE);return this},playToggle:function(a){return this._playing?this.pause():this.play(a)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var a=this,b=0,c=h.timestamp(),d="play"+this._id;if(this._playing){this.clearTimer(d);var e=function(){b=h.timestamp()-
  c;b>=a._playtime&&a._playing?(a.clearTimer(d),a.next()):a._playing&&(a.trigger({type:f.PROGRESS,percent:Math.ceil(100*(b/a._playtime)),seconds:Math.floor(b/1E3),milliseconds:b}),a.addTimer(d,e,20))};a.addTimer(d,e,20)}},setPlaytime:function(a){this._playtime=a;return this},setIndex:function(a){this._active=a;return this},setCounter:function(a){"number"===typeof a?a++:"undefined"===typeof a&&(a=this.getIndex()+1);this.get("current").innerHTML=a;if(q){a=this.$("counter");var b=a.css("opacity");1===
  parseInt(b,10)?h.removeAlpha(a[0]):this.$("counter").css("opacity",b)}return this},setInfo:function(a){var b=this,c=this.getData(a);e.each(["title","description"],function(a,e){var f=b.$("info-"+e);c[e]?f[c[e].length?"show":"hide"]().html(c[e]):f.empty().hide()});return this},hasInfo:function(a){var b=["title","description"],c;for(c=0;b[c];c++)if(this.getData(a)[b[c]])return!0;return!1},jQuery:function(a){var b=this,c=[];e.each(a.split(","),function(a,d){d=e.trim(d);b.get(d)&&c.push(d)});var d=e(b.get(c.shift()));
  e.each(c,function(a,c){d=d.add(b.get(c))});return d},$:function(a){return this.jQuery.apply(this,h.array(arguments))}};e.each(Q,function(a,b){var c=/_/.test(b)?b.replace(/_/g,""):b;f[b.toUpperCase()]="galleria."+c});e.extend(f,{IE9:9===q,IE8:8===q,IE7:7===q,IE6:6===q,IE:q,WEBKIT:/webkit/.test(A),CHROME:/chrome/.test(A),SAFARI:/safari/.test(A)&&!/chrome/.test(A),QUIRK:q&&n.compatMode&&"BackCompat"===n.compatMode,MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!m.opera,IPHONE:/iphone/.test(A),
  IPAD:/ipad/.test(A),ANDROID:/android/.test(A),TOUCH:"ontouchstart"in n});f.addTheme=function(a){a.name||f.raise("No theme name specified");a.defaults="object"!==typeof a.defaults?{}:ja(a.defaults);var b=!1,c;"string"===typeof a.css?(e("link").each(function(d,e){c=RegExp(a.css);if(c.test(e.href))return b=!0,Z(a),!1}),b||e("script").each(function(d,e){c=RegExp("galleria\\."+a.name.toLowerCase()+"\\.");c.test(e.src)&&(b=e.src.replace(/[^\/]*$/,"")+a.css,m.setTimeout(function(){h.loadCSS(b,"galleria-theme",
  function(){Z(a)})},1))}),b||f.raise("No theme CSS loaded")):Z(a);return a};f.loadTheme=function(a){if(!e("script").filter(function(){return e(this).attr("src")==a}).length){var b=!1,c;e(m).load(function(){b||(c=m.setTimeout(function(){!b&&!f.theme&&f.raise("Galleria had problems loading theme at "+a+". Please check theme path or load manually.",!0)},2E4))});f.unloadTheme();h.loadScript(a,function(){b=!0;m.clearTimeout(c)});return f}};f.unloadTheme=function(){"object"==typeof f.theme&&(e("script").each(function(a,
  b){RegExp("galleria\\."+f.theme.name+"\\.").test(b.src)&&e(b).remove()}),f.theme=p);return f};f.get=function(a){if(E[a])return E[a];if("number"!==typeof a)return E;f.raise("Gallery index "+a+" not found")};f.configure=function(a,b){var c={};"string"==typeof a&&b?(c[a]=b,a=c):e.extend(c,a);f.configure.options=c;e.each(f.get(),function(a,b){b.setOptions(c)});return f};f.configure.options={};f.on=function(a,b){if(a){b=b||t;var c=a+b.toString().replace(/\s/g,"")+h.timestamp();e.each(f.get(),function(d,
  e){e._binds.push(c);e.bind(a,b)});f.on.binds.push({type:a,callback:b,hash:c});return f}};f.on.binds=[];f.run=function(a,b){e.isFunction(b)&&(b={extend:b});e(a||"#galleria").galleria(b);return f};f.addTransition=function(a,b){L[a]=b;return f};f.utils=h;f.log=function(){var a=h.array(arguments);if("console"in m&&"log"in m.console)try{return m.console.log.apply(m.console,a)}catch(b){e.each(a,function(){m.console.log(this)})}else return m.alert(a.join("<br>"))};f.ready=function(a){if("function"!=typeof a)return f;
  e.each(X,function(b,c){a.call(c,c._options)});f.ready.callbacks.push(a);return f};f.ready.callbacks=[];f.raise=function(a,b){var c=b?"Fatal error":"Error",d={color:"#fff",position:"absolute",top:0,left:0,zIndex:1E5},f=function(a){var f='<div style="padding:4px;margin:0 0 2px;background:#'+(b?"811":"222")+';">'+(b?"<strong>"+c+": </strong>":"")+a+"</div>";e.each(E,function(){var a=this.$("errors"),b=this.$("target");a.length||(b.css("position","relative"),a=this.addElement("errors").appendChild("target",
  "errors").$("errors").css(d));a.append(f)});E.length||e("<div>").css(e.extend(d,{position:"fixed"})).append(f).appendTo(r().body)};if(ha){if(f(a),b)throw Error(c+": "+a);}else b&&!la&&(la=!0,b=!1,f("Gallery could not load."))};f.version=1.3;f.requires=function(a,b){f.version<a&&f.raise(b||"You need to upgrade Galleria to version "+a+" to use one or more components.",!0);return f};f.Picture=function(a){this.id=a||null;this.image=null;this.container=h.create("galleria-image");e(this.container).css({overflow:"hidden",
  position:"relative"});this.original={width:0,height:0};this.isIframe=this.ready=!1};f.Picture.prototype={cache:{},show:function(){h.show(this.image)},hide:function(){h.moveOut(this.image)},clear:function(){this.image=null},isCached:function(a){return!!this.cache[a]},preload:function(a){e(new Image).load(function(a,c){return function(){c[a]=a}}(a,this.cache)).attr("src",a)},load:function(a,b,c){"function"==typeof b&&(c=b,b=null);if(this.isIframe){var d="if"+(new Date).getTime();this.image=e("<iframe>",
  {src:a,frameborder:0,id:d,allowfullscreen:!0,css:{visibility:"hidden"}})[0];e(this.container).find("iframe,img").remove();this.container.appendChild(this.image);e("#"+d).load(function(a,b){return function(){m.setTimeout(function(){e(a.image).css("visibility","visible");"function"==typeof b&&b.call(a,a)},10)}}(this,c));return this.container}this.image=new Image;f.IE8&&e(this.image).css("filter","inherit");var g=!1,j=!1,d=e(this.container),l=e(this.image),k,n=this,p=c;k=function(){var c=function(){e(this).unbind("load");
  n.original=b||{height:this.height,width:this.width};f.HAS3D&&(this.style.MozTransform=this.style.webkitTransform="translate3d(0,0,0)");n.container.appendChild(this);n.cache[a]=a;"function"==typeof p&&m.setTimeout(function(){p.call(n,n)},1)};!this.width||!this.height?m.setTimeout(function(a){return function(){a.width&&a.height?c.call(a):j?f.raise("Could not extract width/height from image: "+a.src+". Traced measures: width:"+a.width+"px, height: "+a.height+"px."):(e(new Image).load(k).attr("src",a.src),
  j=!0)}}(this),2):c.call(this)};d.find("iframe,img").remove();l.css("display","block");h.hide(this.image);e.each(["minWidth","minHeight","maxWidth","maxHeight"],function(a,b){l.css(b,/min/.test(b)?"0":"none")});l.load(k).bind("error",function(){g?V?e(this).attr("src",V):f.raise("Image not found: "+a):(g=!0,m.setTimeout(function(a,b){return function(){a.attr("src",b+"?"+h.timestamp())}}(e(this),a),50))}).attr("src",a);return this.container},scale:function(a){var b=this;a=e.extend({width:0,height:0,
  min:p,max:p,margin:0,complete:t,position:"center",crop:!1,canvas:!1,iframelimit:p},a);if(this.isIframe){var c=a.width,d=a.height,g,j;if(a.iframelimit){var l=Math.min(a.iframelimit/c,a.iframelimit/d);1>l?(g=c*l,j=d*l,e(this.image).css({top:d/2-j/2,left:c/2-g/2,position:"absolute"})):e(this.image).css({top:0,left:0})}e(this.image).width(g||c).height(j||d).removeAttr("width").removeAttr("height");e(this.container).width(c).height(d);a.complete.call(b,b);try{this.image.contentWindow&&e(this.image.contentWindow).trigger("resize")}catch(k){}return this.container}if(!this.image)return this.container;
  var m,n,q=e(b.container),r;h.wait({until:function(){m=a.width||q.width()||h.parseValue(q.css("width"));n=a.height||q.height()||h.parseValue(q.css("height"));return m&&n},success:function(){var c=(m-2*a.margin)/b.original.width,d=(n-2*a.margin)/b.original.height,f=Math.min(c,d),g=Math.max(c,d),j={"true":g,width:c,height:d,"false":f,landscape:b.original.width>b.original.height?g:f,portrait:b.original.width<b.original.height?g:f}[a.crop.toString()],f="";a.max&&(j=Math.min(a.max,j));a.min&&(j=Math.max(a.min,
  j));e.each(["width","height"],function(a,c){e(b.image)[c](b[c]=b.image[c]=Math.round(b.original[c]*j))});e(b.container).width(m).height(n);if(a.canvas&&x){x.elem.width=b.width;x.elem.height=b.height;f=b.image.src+":"+b.width+"x"+b.height;c=b.image;if(!(d=x.cache[f])){x.context.drawImage(b.image,0,0,b.original.width*j,b.original.height*j);try{r=x.elem.toDataURL(),x.length+=r.length,d=x.cache[f]=r}catch(l){d=b.image.src}}c.src=d}var k={},p={},c=function(a,c,d){var f=0;/\%/.test(a)?(a=parseInt(a,10)/
  100,c=b.image[c]||e(b.image)[c](),f=Math.ceil(-1*c*a+d*a)):f=h.parseValue(a);return f},q={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};e.each(a.position.toLowerCase().split(" "),function(a,b){"center"===b&&(b="50%");k[a?"top":"left"]=b});e.each(k,function(a,b){q.hasOwnProperty(b)&&e.extend(p,q[b])});k=k.top?e.extend(k,p):p;k=e.extend({top:"50%",left:"50%"},k);e(b.image).css({position:"absolute",top:c(k.top,"height",n),left:c(k.left,"width",m)});b.show();b.ready=!0;a.complete.call(b,
  b)},error:function(){f.raise("Could not scale image: "+b.image.src)},timeout:1E3});return this}};e.extend(e.easing,{galleria:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},galleriaIn:function(a,b,c,d,e){return d*(b/=e)*b+c},galleriaOut:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});var s=f,ea=/iP(ad|hone|od)/.test(navigator.userAgent),ua=ea&&/OS 4_\d(_\d)?/.test(navigator.userAgent),va=ea&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);s.Fastclick={init:function(a){var b,
  c=this;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.layer=a;e.each(["Click","TouchStart","TouchMove","TouchEnd","TouchCancel"],function(a,b){var e=c["on"+b];c["on"+b]=function(){e.apply(c,arguments)}});f.TOUCH&&(a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,
  !1),a.addEventListener("touchcancel",this.onTouchCancel,!1),m.Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,e){var f=m.Node.prototype.removeEventListener;"click"===b?f.call(a,b,c.hijacked||c,e):f.call(a,b,c,e)},a.addEventListener=function(b,c,e){var f=m.Node.prototype.addEventListener;"click"===b?f.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),e):f.call(a,b,c,e)}),"function"===typeof a.onclick&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},
  !1),a.onclick=null))},sendClick:function(a,b){var c,d;n.activeElement&&n.activeElement!==a&&n.activeElement.blur();d=b.changedTouches[0];c=n.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,m,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null);c.forwardedTouchEvent=!0;a.dispatchEvent(c)},onTouchStart:function(a){var b,c,d;b=a.target;c=a.targetTouches[0];if(ea){d=m.getSelection();if(d.rangeCount&&!d.isCollapsed)return!0;if(!ua){if(c.identifier===this.lastTouchIdentifier)return a.preventDefault(),
  !1;this.lastTouchIdentifier=c.identifier}}this.trackingClick=!0;this.trackingClickStart=a.timeStamp;this.targetElement=b;this.touchStartX=c.pageX;this.touchStartY=c.pageY;200>a.timeStamp-this.lastClickTime&&a.preventDefault();return!0},touchHasMoved:function(a){a=a.targetTouches[0];return 10<Math.abs(a.pageX-this.touchStartX)||10<Math.abs(a.pageY-this.touchStartY)?!0:!1},onTouchMove:function(a){if(!this.trackingClick)return!0;if(this.targetElement!==a.target||this.touchHasMoved(a))this.trackingClick=
  !1,this.targetElement=null;return!0},onTouchEnd:function(a){var b;b=this.targetElement;if(!this.trackingClick)return!0;if(200>a.timeStamp-this.lastClickTime)return this.cancelNextClick=!0;this.lastClickTime=a.timeStamp;this.trackingClick=!1;this.trackingClickStart=0;va&&(b=a.changedTouches[0],b=n.elementFromPoint(b.pageX-m.pageXOffset,b.pageY-m.pageYOffset));b.tagName.toLowerCase();a.preventDefault();this.sendClick(b,a);return!1},onTouchCancel:function(){this.trackingClick=!1;this.targetElement=null},
  onClick:function(a){if(!this.targetElement||a.forwardedTouchEvent)return!0;this.targetElement=null;return this.trackingClick?(this.trackingClick=!1,!0):!a.cancelable?!0:this.cancelNextClick?(this.cancelNextClick=!1,a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0}};var s=f,J=Math.abs,z=f,D=n.createElement("p"),C,O=["webkit","O","ms","Moz",""],fa,K=0;for(r().html.insertBefore(D,null);O[K];K++)fa=O[K]?O[K]+"Transform":"transform",
  void 0!==D.style[fa]&&(D.style[fa]="translate3d(1px,1px,1px)",C=e(D).css(O[K]?"-"+O[K].toLowerCase()+"-transform":"transform"));r().html.removeChild(D);var sa=z.HAS3D=void 0!==C&&0<C.length&&"none"!==C,wa=m.requestAnimationFrame||m.webkitRequestAnimationFrame||m.mozRequestAnimationFrame||m.oRequestAnimationFrame||m.msRequestAnimationFrame||function(a){m.setTimeout(a,1E3/60)};C=function(a,b){this.config={start:0,duration:240,onchange:function(){},oncomplete:function(){},easing:function(a,b,c,e,f){return-e*
  ((b=b/f-1)*b*b*b-1)+c}};if(a.children.length){var c=this;e.extend(this.config,b);this.elem=a;this.child=a.children[0];this.to=this.pos=0;this.touching=!1;this.start={};this.index=this.config.start;this.anim=0;sa||(this.child.style.position="absolute",this.elem.style.position="relative");e.each(["ontouchstart","ontouchmove","ontouchend","setup"],function(a,b){var e=c[b];c[b]=function(){e.apply(c,arguments)}});this.setX=function(){var a=c.child.style;sa?a.MozTransform=a.webkitTransform="translate3d("+
  c.pos+"px,0,0)":a.left=c.pos+"px"};e(a).bind("touchstart",this.ontouchstart);e(m).bind("resize",this.setup);e(m).bind("orientationchange",this.setup);this.setup();(function g(){wa(g);c.loop.call(c)})()}};C.prototype={constructor:C,setup:function(){this.width=e(this.elem).width();this.length=Math.ceil(e(this.child).width()/this.width);0!==this.index&&(this.index=Math.max(0,Math.min(this.index,this.length-1)),this.pos=this.to=-this.width*this.index)},ontouchstart:function(a){a=a.originalEvent.touches;
  this.start={pageX:a[0].pageX,pageY:a[0].pageY,time:+new Date};this.isScrolling=null;this.touching=!0;this.deltaX=0;F.bind("touchmove",this.ontouchmove);F.bind("touchend",this.ontouchend)},ontouchmove:function(a){var b=a.originalEvent.touches;b&&1<b.length||(a.scale&&1!==a.scale||n.documentElement.clientWidth!==m.innerWidth)||(this.deltaX=b[0].pageX-this.start.pageX,null===this.isScrolling&&(this.isScrolling=!!(this.isScrolling||J(this.deltaX)<J(b[0].pageY-this.start.pageY))),this.isScrolling||(a.preventDefault(),
  this.deltaX/=!this.index&&0<this.deltaX||this.index==this.length-1&&0>this.deltaX?J(this.deltaX)/this.width+1.8:1,this.to=this.deltaX-this.index*this.width),a.stopPropagation())},ontouchend:function(){this.touching=!1;var a=250>+new Date-this.start.time&&40<J(this.deltaX)||J(this.deltaX)>this.width/2,b=!this.index&&0<this.deltaX||this.index==this.length-1&&0>this.deltaX;this.isScrolling||this.show(this.index+(a&&!b?0>this.deltaX?1:-1:0));F.unbind("touchmove",this.ontouchmove);F.unbind("touchend",
  this.ontouchend)},show:function(a){a!=this.index?this.config.onchange.call(this,a):this.to=-(a*this.width)},loop:function(){var a=this.to-this.pos;if(this.touching||1>=J(a)){this.pos=this.to;if(this.anim)this.config.oncomplete(this.index);this.anim=0}else this.anim||(this.anim={v:this.pos,c:a,t:0}),this.pos=this.config.easing(null,this.anim.t++,this.anim.v,this.anim.c,this.config.duration/10);this.setX()}};s.Finger=C;e.fn.galleria=function(a){var b=this.selector;return!e(this).length?(e(function(){e(b).length?
  e(b).galleria(a):f.utils.wait({until:function(){return e(b).length},success:function(){e(b).galleria(a)},error:function(){f.raise('Init failed: Galleria could not find the element "'+b+'".')},timeout:5E3})}),this):this.each(function(){e.data(this,"galleria")&&(e.data(this,"galleria").destroy(),e(this).find("*").hide());e.data(this,"galleria",(new f).init(this,a))})}})(jQuery);