(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);
/*
 * jQuery hashchange event - v1.2 - 2/11/2010
 * http://benalman.com/projects/jquery-hashchange-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);NavObject=function(){list=[];this._current="introduction";this.fromScroll=false;this.fixed=true;this.footerTop=$("footer").position().top;$("#content > article").each(function(){list.push({name:$(this).attr("id"),_top:$(this).position().top,_bottom:$(this).position().top+$(this).outerHeight(true)})});this.list=list;this.goTo=function(a){if(a!=="introduction"){$(window).scrollTo($("#"+a).position().top-74,1000)}else{$(window).scrollTo(0,1000)}};this.switchNav=function(a){$("nav .current").removeClass("current");$('nav a[href="#'+a+'"]').addClass("current");this._current=a};this.unloadFooter=function(){$(window).unbind("mousemove").unbind("resize");camera=null};this.loadFooter=function(){$("nav .current").removeClass("current");camera=new CameraObject(($("body").width()/2),0)};this.handleScroll=function(a){scrollPos=a;windowHeight=$(window).height();$.each(navigation.list,function(){if((scrollPos+(windowHeight/2))>this._top&&(scrollPos+(windowHeight/2))<this._bottom){navigation.switchNav(this.name)}})};$("nav a").click(function(){navigation.fromScroll=false;location.hash="#/"+$(this).attr("href").split("#")[1];return false});$("#backToTop").click(function(){navigation.fromScroll=false;location.hash="#/";$(window).scrollTo(0,500);return false});$(window).bind("hashchange",function(){if(location.hash=="#/"){$(window).scrollTo(0,1000)}else{if(navigation.fromScroll==false){navigation.goTo(location.hash.split("#/")[1])}else{navigation.fromScroll=false}}});$(window).scroll(function(){navigation.fromScroll=true;if($(window).scrollTop()>navigation.footerTop){if(navigation.fixed==true){$("nav .current").removeClass("current");$("nav h1").css({position:"absolute",top:navigation.footerTop});$("nav ul").css({position:"absolute",top:navigation.footerTop+198+18});navigation.fixed=1;navigation.loadFooter()}}else{if(navigation.fixed!==true){$("nav h1").css({position:"fixed",top:17});$("nav ul").css({position:"fixed",top:198+17+18});navigation.fixed=true;navigation.unloadFooter()}}navigation.handleScroll($(window).scrollTop())})};CameraObject=function(a,b){this._x=a;this._y=b;this.ww=$(window).width();this.wh=$(window).height();$(window).resize(function(){camera.ww=$(window).width();camera.wh=$(window).height()});$(window).mousemove(function(c){camera.setView(c.pageX,c.pageY)});this.setView=function(c,d){this._x=c;this._y=d;this.position()};this.position=function(){$(".fly").each(function(){var f=$(this).attr("data-z");var c=$(this).position();var e=(camera._y-c.top)/camera.wh*f;var d=(camera._x-c.left)/camera.ww*f;if($(this).hasClass("shadow")){e=0}$(this).css({top:-e,left:-d})})}};$(document).ready(function(){navigation=new NavObject;if(location.hash.split("#/").length>1){navigation.goTo(location.hash.split("#/")[1])}if(location.hash.split("#").length>1){navigation.goTo(location.hash.split("#")[1])}});