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(e){function h(){}for(var g="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),f;f=g.pop();){e[f]=e[f]||h}})((function(){try{console.log();return window.console}catch(a){return window.console={}}})());
/*!
 * jQuery Smooth Scroll Plugin v1.4
 *
 * Date: Mon Apr 25 00:02:30 2011 EDT
 * Requires: jQuery v1.3+
 *
 * Copyright 2010, Karl Swedberg
 * Dual licensed under the MIT and GPL licenses (just like jQuery):
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 *
 *
 *
*/
(function(c){var b="1.4",d={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,afterScroll:null,easing:"swing",speed:400},f=e(location.pathname),a=function(i){var j=[],h=false,g=i.dir&&i.dir=="left"?"scrollLeft":"scrollTop";this.each(function(){if(this==document||this==window){return}var k=c(this);if(k[g]()>0){j.push(this);return}k[g](1);h=k[g]()>0;k[g](0);if(h){j.push(this);return}});if(i.el==="first"&&j.length){j=[j.shift()]}return j};c.fn.extend({scrollable:function(g){var h=a.call(this,{dir:g});return this.pushStack(h)},firstScrollable:function(g){var h=a.call(this,{el:"first",dir:g});return this.pushStack(h)},smoothScroll:function(g){g=g||{};var h=c.extend({},c.fn.smoothScroll.defaults,g);this.die("click.smoothscroll").live("click.smoothscroll",function(j){var s=this,r=c(this),o=((location.hostname===s.hostname)||!s.hostname),i=h.scrollTarget||(e(s.pathname)||f)===f,q=s.hash,k=true;if(!h.scrollTarget&&(!o||!i||!q)){k=false}else{var l=h.exclude,u=0,m=l.length;while(k&&u<m){if(r.is(l[u++])){k=false}}var p=h.excludeWithin,n=0,t=p.length;while(k&&n<t){if(r.closest(p[n++]).length){k=false}}}if(k){h.scrollTarget=g.scrollTarget||q;h.link=s;j.preventDefault();c.smoothScroll(h)}});return this}});c.smoothScroll=function(o,l){var g,i,n,m=0,j="offset",k="scrollTop",h={};if(typeof o==="number"){g=c.fn.smoothScroll.defaults;n=o}else{g=c.extend({},c.fn.smoothScroll.defaults,o||{});if(g.scrollElement){j="position";if(g.scrollElement.css("position")=="static"){g.scrollElement.css("position","relative")}}n=l||(c(g.scrollTarget)[j]()&&c(g.scrollTarget)[j]()[g.direction])||0}g=c.extend({link:null},g);k=g.direction=="left"?"scrollLeft":k;if(g.scrollElement){i=g.scrollElement;m=i[k]()}else{i=c("html, body").firstScrollable()}h[k]=n+m+g.offset;i.animate(h,{duration:g.speed,easing:g.easing,complete:function(){if(g.afterScroll&&c.isFunction(g.afterScroll)){g.afterScroll.call(g.link,g)}}})};c.smoothScroll.version=b;c.fn.smoothScroll.defaults=d;function e(g){return g.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")}})(jQuery);$(function(){$window=$(window);$slides=$('section[data-type="background"]');stateObj={foo:"bar"};iHash="";$("nav a").smoothScroll();buildNav();if(!isMobile){$slides.css("background-attachment","fixed");parallax()}if(isMobile){window.top.scrollTo(0,1);$(".mid").remove()}if(navigator.userAgent.match(/iPad/i)){$slides.css("background-size","cover");$("#references").css("background-size","100% auto")}});if(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)){var isMobile=true}function setActiveMenu(){$("nav li").removeClass("selected");$('nav a[href="#'+$(".inview").attr("id")+'"]').parent().addClass("selected")}function parallax(){$("[data-type]").each(function(){$(this).data("offsetY",parseInt($(this).attr("data-offsetY")));$(this).data("Xposition",$(this).attr("data-Xposition"));$(this).data("speed",$(this).attr("data-speed"))});$slides.each(function(){var c=$(this),b=c.offset(),a=b.top;$window.scroll(function(){if(($window.scrollTop()+$window.height())>(a)&&((a+c.height())>$window.scrollTop())){c.addClass("inview");var d=-($window.scrollTop()/c.data("speed"));if(c.data("offsetY")){d+=c.data("offsetY")}var e="50% "+d+"px";c.css({backgroundPosition:e});$('[data-type="sprite"]',c).each(function(){var h=$(this);var f=-($window.scrollTop()/h.data("speed"));var g=h.data("Xposition")+" "+(f+h.data("offsetY"))+"px";h.css({backgroundPosition:g})})}else{c.removeClass("inview");if(iHash!=$(".inview").attr("id")){iHash=$(".inview").attr("id");history.replaceState(stateObj,$(".inview").attr("id"),"#"+$(".inview").attr("id"));setActiveMenu()}_gaq.push(["_trackEvent","scrollTo","Play",$(".inview").attr("id")])}})})}function floatyNav(){$("nav").addClass("floaty");var a=false;$window.scroll(function(){a=true});setInterval(function(){if(a){a=false;var b=$(window).scrollTop();var c=b+50;$(".floaty").css("-webkit-transform","translateY("+c+"px)")}},250)}function buildNav(){var c="<ul>",b,a;for(i=0;i<=$slides.length-1;i++){b=$slides.eq(i).attr("id");a=b.replace("-"," ");c+='<li><a href="#'+b+'">'+a+"</a></li>"}c+="</ul>";$("nav").prepend(c)};
