$(document).ready(function(){jQuery.get("device_aware/saveScreenResolution",{width:screen.width,height:screen.height})});
(function(a){function q(b,c,d){var e=a('<div id="uGallery">').css({position:"fixed",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"}).data("sources",b).appendTo("body");d.loadingIndicatorImageURL&&e.data("loadingIndicatorImageURL",d.loadingIndicatorImageURL);d.arrowNavigation&&e.data("hasArrows",!0);a('<div id="uGalleryOverlay">').css({position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:d.background_color,opacity:d.background_alpha,zIndex:5}).appendTo(e);if(d.arrowNavigation){var g=
a('<div id="uGalleryArrowLeft">').css({position:"absolute",top:0,width:"2%",height:"100%",paddingLeft:"1.5%",paddingRight:"1.5%",textAlign:"center",display:"inline-block",clear:"both",zIndex:99999,opacity:0}),f=a(g).clone();a(g).css({left:0}).appendTo(e);var i=new Image;a(i).css({maxWidth:"100%",cursor:"pointer"});a(i).attr("src",d.arrowsImages.left);a(i).appendTo(g);a(i).load(j);a(f).attr("id","uGalleryArrowRight").css({right:0}).appendTo(e);g=a(i).clone();a(g).attr("src",d.arrowsImages.right);a(g).appendTo(f);
a(g).load(j)}b.each(function(c){var f=a('<div class="uGalleryImageHolder">').css({position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundPosition:"center center",backgroundRepeat:"no-repeat",textAlign:"center",display:"none",zIndex:10+c}).appendTo(e),g=a.proxy(d.fullSizeImage,b.get(c))(),h;g.embed?(h=document.createElement("iframe"),a(h).attr("frameborder",0),a(h).attr("url",g.embed),a(h).css({height:"80%",width:"80%"})):(h=new Image,a(h).css({height:"auto",width:"auto"}),a(h).attr("url",
g));a(h).load(r);a(h).css({maxHeight:"90%",maxWidth:"90%",display:"inline-block",opacity:0}).appendTo(f);d.showCaption&&(f=a('<div class="uGalleryImageTitle">').css({width:"90%",height:"9%",paddingTop:"1%",textAlign:"center",display:"inline-block",clear:"both",color:d.text_color,opacity:0}).appendTo(f),c=a.proxy(d.getCaption,b.get(c))(),a(f).html(c))});m(c);d.arrowNavigation&&n()}function k(){var b=a("#uGallery").data("sources");try{b.removeClass("opened")}catch(c){}a(document).unbind("keydown",o);
a("#uGallery .uGalleryImageHolder").unbind("click",k);a("#uGallery #uGalleryArrowLeft img").unbind("click");a("#uGallery #uGalleryArrowRight img").unbind("click");a("#uGallery").empty();a("#uGallery").remove()}function j(b){var b=b.target,c=a(b).parent(),d=a(b).height(),c=a(c).height();if(d==0)d=a(b).scrollHeight;d=(c-d)/2;a(b).css({paddingTop:d+"px"})}function r(b){j(b);b=a(this).parents(".uGalleryImageHolder");p(b);a(this).animate({opacity:1},100,function(){a("#uGallery").data("hasArrows")&&s()});
b.find(".uGalleryImageTitle").animate({opacity:1},200)}function m(b){b=typeof b=="number"?a("#uGallery .uGalleryImageHolder").eq(b):a(b);p(b);var c=a(b).find("img");a(c).length==0&&(c=a(b).find("iframe"));c.attr("src",c.attr("url"));b.css({display:"block"})}function p(b){if(a(b).css("backgroundImage")=="none"){var c=a("#uGallery").data("loadingIndicatorImageURL");c&&a(b).css("background-image","url('"+c+"')")}else a(b).css({backgroundImage:"none"})}function n(){var b=a("#uGallery #uGalleryArrowLeft"),
c=a("#uGallery #uGalleryArrowRight");a(b).css("opacity")<1&&a(b).css({opacity:1});a(c).css("opacity")<1&&a(c).css({opacity:1});a("#uGallery #uGalleryArrowLeft").fadeOut(100);a("#uGallery #uGalleryArrowRight").fadeOut(100)}function s(){var b=e();l(b,1).length>0&&a("#uGallery #uGalleryArrowLeft").fadeIn(100,function(){j({target:a(this).find("img")})});l(b,-1).length>0&&a("#uGallery #uGalleryArrowRight").fadeIn(100,function(){j({target:a(this).find("img")})})}function t(b){var c=a(b).find("img");a(c).length==
0&&(c=a(b).find("iframe"));c.attr("src","");c.css({opacity:0});a(this).parents(".uGalleryImageHolder").find("uGalleryImageTitle").css({opacity:0})}function l(b,c){return c==1?a(b).prev(".uGalleryImageHolder"):a(b).next(".uGalleryImageHolder")}function f(b,c){c!=1&&c!=-1&&(c=-1);l(b,c).length>0?(a("#uGallery").data("hasArrows")&&n(),a(b).animate({left:a(b).outerWidth()*c+"px"},{duration:100,complete:function(){a(this).css({display:"none"});t(this);var b=l(this,c);a(b).css({display:"block",left:0});
m(b)}})):a(b).animate({left:a(b).outerWidth()*c/10+"px"},{duration:25,complete:function(){a(b).animate({left:0},{duration:50})}})}function e(){return a("#uGallery .uGalleryImageHolder:visible")}function o(a){if(a.keyCode==37)return f(e(),1),!1;if(a.keyCode==39)return f(e(),-1),!1;a.keyCode==27&&k();return!1}function u(a,c){f(e(),c.direction.vector)}function v(){a("#uGallery .uGalleryImageHolder").live("click",k);a(document).bind("keydown",o);jQuery().jGestures&&(a("#uGallery").live("swipeone",u),
a("#uGallery").live("tapone",k));a("#uGallery #uGalleryArrowLeft img").live("click",function(){f(e(),1)});a("#uGallery #uGalleryArrowRight img").live("click",function(){f(e(),-1)})}a.fn.uGallery=function(b){var b=a.extend({},a.fn.uGallery.defaults,b),c=this;this.live("click",function(d){d.preventDefault();a(this).is(".opened")||(c.addClass("opened"),q(c,c.index(a(this)),b),v())});return this};a.fn.uGallery.defaults={fullSizeImage:function(){return a(this).attr("href")},showCaption:!1,getCaption:function(){return a(this).find("img").attr("alt")},
background_color:"#000",background_alpha:1,text_color:"#FFF",arrowNavigation:!1}})(jQuery);
window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){arguments.callee=arguments.callee.caller;var a=[].slice.call(arguments);typeof console.log==="object"?log.apply.call(console.log,console,a):console.log.apply(console,a)}};
(function(a){function c(){}for(var d="assert,clear,count,debug,dir,dirxml,error,exception,firebug,group,groupCollapsed,groupEnd,info,log,memoryProfile,memoryProfileEnd,profile,profileEnd,table,time,timeEnd,timeStamp,trace,warn".split(","),b;b=d.pop();)a[b]=a[b]||c})(function(){try{return console.log(),window.console}catch(a){return window.console={}}}());
$(document).ready(function(){init_tiles_size();init_behaviour()});function init_tiles_size(){$(".tile").length>0&&$(".tile").height($(".tile:first").width()+"px")}
function init_behaviour(){if($(".tile").length>0)$(window).on("resize",init_tiles_size);$(".tile .overlay").length>0&&($(".tile .overlay").parents(".tile").on("mouseenter",showHideTileOverlay),$(".tile .overlay").parents(".tile").on("mouseleave",showHideTileOverlay));$(".inPageGallery .nav").length>0&&($(".inPageGallery .nav .nav-left").on("click",slide_inPageGallery),$(".inPageGallery .nav .nav-right").on("click",slide_inPageGallery))}
function showHideTileOverlay(c){var a="100%";c.type=="mouseenter"&&(a="50%");$(c.currentTarget).find(".overlay").animate({top:a},150)}
function slide_inPageGallery(c){var a,d,b,f,g,h,e;e=$("#site_header").height()*1.5;c=c.currentTarget;a=$(c).parents(".content");d=$(a).find(".item:visible");$(c).hasClass("nav-left")?(b=$(d).prev(".item"),$(b).length==0&&(b=$(a).find(".item:last"))):(b=$(d).next(".item"),$(b).length==0&&(b=$(a).find(".item:first")));f=$(b).hasClass("tall")?"tall":"wide";h=$(b).hasClass("img")?"img":"embed";$(document).scrollTop($(a).parents(".inPageGallery").offset().top-e);$(d).height();g=$(b).height();$(d).fadeOut(200,
function(){$(a).css({height:g+"px"});$(document).scrollTop($(a).parents(".inPageGallery").offset().top-e);$(a).removeClass("img embed tall wide").addClass(f+" "+h);$(b).fadeIn(200,function(){$(a).css({height:"auto"})})})};

