(function(b){var a=navigator.userAgent.toLowerCase();b.browser={version:(a.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(a),opera:/opera/.test(a),msie:/msie/.test(a)&&!/opera/.test(a),mozilla:/mozilla/.test(a)&&!/(compatible|webkit)/.test(a)}})(jQuery);(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var l=this,j=c(l),k=f,i,g={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);case"object":if(k.is||k.style){i=(k=c(k)).offset()}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=a.max(l,r);if(i){g[p]=i[u]+(m?0:o-j.offset()[u]);if(d.margin){g[p]-=parseInt(k.css("margin"+s))||0;g[p]-=parseInt(k.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=k[r=="x"?"width":"height"]()*d.over[u]}}else{var t=k[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){h(d.onAfterFirst)}delete g[p]}});h(d.onAfter);function h(n){j.animate(g,e,d.easing,n&&function(){n.call(this,f,d)})}}).end()};a.max=function(j,i){var h=i=="x"?"Width":"Height",e="scroll"+h;if(!c(j).is("html,body")){return j[e]-c(j)[h.toLowerCase()]()}var g="client"+h,f=j.ownerDocument.documentElement,d=j.ownerDocument.body;return Math.max(f[e],d[e])-Math.min(f[g],d[g])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);function logger(){if(window.console!==undefined&&typeof window.console.log==="function"){console.log(arguments)}}(function(){jQuery.fn.nexTrackGoogleAnalyticsUrl=function(a){if(window.pageTracker){pageTracker._trackPageview(a);logger("tracking: "+a)}else{logger("Google Page Tracker NOT installed"+a)}}})(jQuery);if(!Array.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a}}return -1}}jQuery.fn.nexGallery=function(a){var c={thumbs:"#thumbs",stories:"#stories",imgWrapper:"#image",imgCaption:"#caption",imgCreator:"#creator",onGalleryInit:function(){},onImageShow:function(){},onImageHide:function(){},onStoryShow:function(){},onStoryHide:function(){},onThumbClick:function(){},onStoryClick:function(){},onNextImage:function(){},onPrevImage:function(){},onLoadImage:function(){},getTargetHeight:function(){}};var b=$.extend(true,{},c,a);return this.each(function(){var s=this;var g=$(b.thumbs);var o=$(b.stories);var r=$(b.imgCaption);var k=$(b.imgCreator);if(g.find("div").find("a").length===0){$(b.imgWrapper).hide();return false}if(g.find("div").length){}else{}function d(){g.find("div:first").addClass("selected");g.find("div:first > a:first").addClass("selected");g.find("a").hover(function(){$(this).find("img").stop()}).mouseout(function(){if($(this).hasClass("selected")){}else{$(this).find("img").stop().animate({opacity:1},"fast")}}).click(function(){$(this).addClass("selected").siblings().removeClass("selected").find("img").css({opacity:1});f($(this));$.fn.nexTrackGoogleAnalyticsUrl($(this).attr("href"));b.onThumbClick.call(this);return false});q("first");if(o.length!==0){o.css({opacity:0.2}).hover(function(){$(this).stop().css({opacity:1})},function(){$(this).stop().animate({opacity:0.2},"slow")}).find("li:first").addClass("selected");o.find("a").click(function(){index=$(this).parent().prevAll().length;m(index,"first");$(this).parent().addClass("selected").siblings().removeClass("selected");b.onStoryClick.call(this);return false})}$("img#a").load(function(){$(this).animate({opacity:1},"fast");j()});$("img#a").click(function(){i();h();return false});l();$(window).resize(function(){l()});b.onGalleryInit.call(this)}d();function p(t){$selectedStory=g.find(">.selected");if(!$selectedStory.is(":last-child")){index=parseInt($selectedStory.prevAll().length,10);m(index+1,t)}else{logger("no next story - nothing to show")}}function n(t){$selectedStory=g.find(">.selected");if(!$selectedStory.is(":first-child")){index=parseInt($selectedStory.prevAll().length,10);m(index-1,t)}else{logger("no next story - nothing to show")}}function i(){$selectedImage=g.find(">.selected >.selected");if(!$selectedImage.is(":last-child")){index=parseInt($selectedImage.prevAll().length,10);q(index+1)}else{p("first")}b.onNextImage.call(this)}function e(){$selectedImage=g.find(">.selected >.selected");if(!$selectedImage.is(":first-child")){index=parseInt($selectedImage.prevAll().length,10);q(index-1)}else{n("last")}b.onPrevImage.call(this)}function m(u,t){logger("swichting to story:"+u);switch(u){case"last":o.find("ul > li:last").addClass("selected").siblings().removeClass("selected");g.find("div:last").addClass("selected").siblings().removeClass("selected");q("first");break;case"first":o.find("ul > li:first").addClass("selected").siblings().removeClass("selected");g.find("div:first").addClass("selected").siblings().removeClass("selected");q("first");break;default:o.find("ul").children().eq(u).addClass("selected").siblings().removeClass("selected");g.children().eq(u).addClass("selected").siblings().removeClass("selected");q(t)}}function q(t){if(t!==undefined){switch(t){case"last":g.find(".selected > a:last-child").addClass("selected").siblings().removeClass("selected");f(g.find(".selected > a:last-child"));break;case"first":g.find(".selected > a:first-child").addClass("selected").siblings().removeClass("selected");f(g.find(".selected > a:first-child"));break;default:g.find(".selected > a").eq(t).addClass("selected").siblings().removeClass("selected");f(g.find(".selected > a").eq(t))}}else{logger("sorry not imageIndex"+t)}}function l(){b.getTargetHeight.call(this);targetHeight=$(window).height()-$("#asset-head").height()-$("#footer").height()-80;$("#a").css({height:targetHeight});o.css({height:targetHeight})}function f(t){$("img#a").stop().animate({opacity:0},"fast",function(){$(this).attr("src",t.attr("href"));r.text(t.attr("title"));k.text(t.attr("creator"))})}function j(){var t=$("#thumbs").find("a.selected").next().attr("href");$.preloadImages(t)}function h(){$wrapper=g.parent();$thumb=g.find("div.selected").find("a.selected");if($.browser.opera){return false}else{var t=g.find("div.selected").find("a.selected").attr("offsetLeft");t-=($wrapper.width()/2);t+=($thumb.find("img").width()/2)}t=Math.round(Math.abs(Math.max(t,0)));if(jQuery.scrollTo){$wrapper.stop().scrollTo(t,500,{axis:"x"});logger("use plugin")}else{$wrapper.stop().animate({scrollLeft:t},"fast");logger("no plugin")}}})};jQuery.preloadImages=function(){for(var a=0;a<arguments.length;a++){jQuery("<img>").attr("src",arguments[a])}};jQuery.preloadContent=function(){for(var a=0;a<arguments.length;a++){jQuery("<div>").html(arguments[a])}};