(function(a,b){var c;a.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(b){var c=a('meta[name="csrf-token"]').attr("content");c&&b.setRequestHeader("X-CSRF-Token",c)},fire:function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},confirm:function(a){return confirm(a)},ajax:function(b){return a.ajax(b)},handleRemote:function(d){var e,f,g,h=d.data("cross-domain")||null,i=d.data("type")||a.ajaxSettings&&a.ajaxSettings.dataType,j;if(c.fire(d,"ajax:before")){if(d.is("form")){e=d.attr("method"),f=d.attr("action"),g=d.serializeArray();var k=d.data("ujs:submit-button");k&&(g.push(k),d.data("ujs:submit-button",null))}else d.is(c.inputChangeSelector)?(e=d.data("method"),f=d.data("url"),g=d.serialize(),d.data("params")&&(g=g+"&"+d.data("params"))):(e=d.data("method"),f=d.attr("href"),g=d.data("params")||null);return j={type:e||"GET",data:g,dataType:i,crossDomain:h,beforeSend:function(a,e){return e.dataType===b&&a.setRequestHeader("accept","*/*;q=0.5, "+e.accepts.script),c.fire(d,"ajax:beforeSend",[a,e])},success:function(a,b,c){d.trigger("ajax:success",[a,b,c])},complete:function(a,b){d.trigger("ajax:complete",[a,b])},error:function(a,b,c){d.trigger("ajax:error",[a,b,c])}},f&&(j.url=f),c.ajax(j)}return!1},handleMethod:function(c){var d=c.attr("href"),e=c.data("method"),f=c.attr("target"),g=a("meta[name=csrf-token]").attr("content"),h=a("meta[name=csrf-param]").attr("content"),i=a('<form method="post" action="'+d+'"></form>'),j='<input name="_method" value="'+e+'" type="hidden" />';h!==b&&g!==b&&(j+='<input name="'+h+'" value="'+g+'" type="hidden" />'),f&&i.attr("target",f),i.hide().append(j).appendTo("body"),i.submit()},disableFormElements:function(b){b.find(c.disableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with",b[c]()),b[c](b.data("disable-with")),b.prop("disabled",!0)})},enableFormElements:function(b){b.find(c.enableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with")&&b[c](b.data("ujs:enable-with")),b.prop("disabled",!1)})},allowAction:function(a){var b=a.data("confirm"),d=!1,e;return b?(c.fire(a,"confirm")&&(d=c.confirm(b),e=c.fire(a,"confirm:complete",[d])),d&&e):!0},blankInputs:function(b,c,d){var e=a(),f,g=c||"input,textarea";return b.find(g).each(function(){f=a(this);if(d?f.val():!f.val())e=e.add(f)}),e.length?e:!1},nonBlankInputs:function(a,b){return c.blankInputs(a,b,!0)},stopEverything:function(b){return a(b.target).trigger("ujs:everythingStopped"),b.stopImmediatePropagation(),!1},callFormSubmitBindings:function(c,d){var e=c.data("events"),f=!0;return e!==b&&e.submit!==b&&a.each(e.submit,function(a,b){if(typeof b.handler=="function")return f=b.handler(d)}),f},disableElement:function(a){a.data("ujs:enable-with",a.html()),a.html(a.data("disable-with")),a.bind("click.railsDisable",function(a){return c.stopEverything(a)})},enableElement:function(a){a.data("ujs:enable-with")!==b&&(a.html(a.data("ujs:enable-with")),a.data("ujs:enable-with",!1)),a.unbind("click.railsDisable")}},a.ajaxPrefilter(function(a,b,d){a.crossDomain||c.CSRFProtection(d)}),a(document).delegate(c.linkDisableSelector,"ajax:complete",function(){c.enableElement(a(this))}),a(document).delegate(c.linkClickSelector,"click.rails",function(d){var e=a(this),f=e.data("method"),g=e.data("params");if(!c.allowAction(e))return c.stopEverything(d);e.is(c.linkDisableSelector)&&c.disableElement(e);if(e.data("remote")!==b)return(d.metaKey||d.ctrlKey)&&(!f||f==="GET")&&!g?!0:(c.handleRemote(e)===!1&&c.enableElement(e),!1);if(e.data("method"))return c.handleMethod(e),!1}),a(document).delegate(c.inputChangeSelector,"change.rails",function(b){var d=a(this);return c.allowAction(d)?(c.handleRemote(d),!1):c.stopEverything(b)}),a(document).delegate(c.formSubmitSelector,"submit.rails",function(d){var e=a(this),f=e.data("remote")!==b,g=c.blankInputs(e,c.requiredInputSelector),h=c.nonBlankInputs(e,c.fileInputSelector);if(!c.allowAction(e))return c.stopEverything(d);if(g&&e.attr("novalidate")==b&&c.fire(e,"ajax:aborted:required",[g]))return c.stopEverything(d);if(f)return h?c.fire(e,"ajax:aborted:file",[h]):!a.support.submitBubbles&&a().jquery<"1.7"&&c.callFormSubmitBindings(e,d)===!1?c.stopEverything(d):(c.handleRemote(e),!1);setTimeout(function(){c.disableFormElements(e)},13)}),a(document).delegate(c.formInputClickSelector,"click.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);var e=d.attr("name"),f=e?{name:e,value:d.val()}:null;d.closest("form").data("ujs:submit-button",f)}),a(document).delegate(c.formSubmitSelector,"ajax:beforeSend.rails",function(b){this==b.target&&c.disableFormElements(a(this))}),a(document).delegate(c.formSubmitSelector,"ajax:complete.rails",function(b){this==b.target&&c.enableFormElements(a(this))})})(jQuery),function(a){var b="htmlhistory",c="hashchange",d="onhashchange";a.fn.htmlhistory=function(a){return a?this.bind(b,a):this.trigger(b)};var e=a.htmlhistory={options:{useHistory:!0,useHashchange:!0,poll:250,interceptLinks:!1,disableHashLinks:!1},init:function(d){var f,g=a(window),h=a("body");a.extend(e.options,d),e.options.useHistory&&e.supportsHistory()&&g.bind("popstate",function(a){g.trigger(b)}),e.options.useHashchange&&(g.bind(c,function(a){g.trigger(b)}),e.supportsHashchange()||(f=window.location.hash,requestInterval(function(){f!==window.location.hash&&(g.trigger(c),f=window.location.hash)},e.options.poll))),e.options.interceptLinks&&h.delegate('a[href=^"/"]',"click",function(b){e.changeTo(a(this).attr("href")),b.preventDefault()}),e.options.disableHashLinks&&h.delegate("a[href=#]","click",function(a){a.preventDefault()})},changeTo:function(c){var d=a(window);e.options.useHistory&&e.supportsHistory()?(window.history.pushState(null,null,c),d.trigger(b)):(c.indexOf("#")<0&&(c="#"+c),window.location.href=c)},supportsHistory:function(){return!!window.history&&!!history.pushState},supportsHashchange:function(){var a=d in window;return!a&&window.setAttribute&&(window.setAttribute(d,"return;"),a=typeof window.onhashchange=="function"),a}}}(jQuery),window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a,b){window.setTimeout(a,1e3/60)}}(),window.requestInterval=function(a,b){function e(){var f=(new Date).getTime(),g=f-c;g>=b&&(a.call(),c=(new Date).getTime()),d.value=requestAnimFrame(e)}if(!window.requestAnimationFrame&&!window.webkitRequestAnimationFrame&&!window.mozRequestAnimationFrame&&!window.oRequestAnimationFrame&&!window.msRequestAnimationFrame)return window.setInterval(a,b);var c=(new Date).getTime(),d=new Object;return d.value=requestAnimFrame(e),d},jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return b<1?-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c:h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),(b/=e/2)<1?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(a,b,c,d,e){return b<e/2?jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c:jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}});var SLIDE1=function(a){function d(){}var b={},c=a("#talent .logo");return b.draw=function(a,b){var d=(a-this.range.top+b)/b,e=1;d>1&&(d=Math.min(d-1,1),e=1-1*d),c.css({opacity:e})},a(d),b}(jQuery),SLIDE2=function(a){var b={},c=a("#client"),d=a("#pie ul :nth-child(4) p"),e=c.find(".lazer:first"),f=c.find(".lazer.top"),g=c.find(".percent");return b.draw=function(a,b){var c=Math.min((a-this.range.top+b)/b,1);start=-900,e.css({marginLeft:start-(50-parseInt(50*c)),top:-(100-parseInt(100*c))}),f.css({marginLeft:start+60-parseInt(60*c),top:-79-parseInt(130*c)}),g.css({opacity:1*c,top:144+(120-parseInt(120*c))}),APP.rotate(d[0],parseInt(180*c))},b}(jQuery),SLIDE3=function(a){var b={},c=a("#everywhere"),d=c.find(".a1"),e=c.find(".a2"),f=c.find(".a3"),g=c.find(".a4"),h=c.find(".a5"),i=c.find(".a6"),j=c.find(".a7"),k=c.find(".a8");return b.draw=function(a,b){var l=Math.min((a-this.range.top+b)/b,1);d.css({left:parseInt(d.data("x")*l),top:parseInt(d.data("y")*l)}),e.css({top:parseInt(e.data("y")*l)}),f.css({right:parseInt(f.data("x")*l),top:parseInt(f.data("y")*l)}),g.css({right:parseInt(g.data("x")*l)}),h.css({right:parseInt(h.data("x")*l),bottom:parseInt(h.data("y")*l)}),i.css({bottom:parseInt(i.data("y")*l)}),j.css({left:parseInt(j.data("x")*l),bottom:parseInt(j.data("y")*l)}),k.css({left:parseInt(k.data("x")*l)}),c.css({backgroundPosition:"50% -"+parseInt(600-600*l)+"px"})},b}(jQuery),SLIDE4=function(a){function d(){}var b={},c=a("#expertise .copy");return b.draw=function(a,b){},a(d),b}(jQuery),SLIDE5=function(a){function l(){}var b={},c=a("#badge"),d=c.height(),e=a("#people"),f=e.find("#michael"),g=e.find("#mike"),h=e.find("#dave"),i=e.find("#sarah"),j=e.find("#kassan"),k=e.find("#wenda");return b.draw=function(a,b){var e=(a-this.range.top+b)/b,l=Math.min(e,1);tar=200,c.css({top:-(d-parseInt(d*l))}),f.css({marginLeft:parseInt(tar*l)-tar}),i.css({marginRight:parseInt(tar*l)-tar}),e-=.1,g.css({marginLeft:parseInt(tar*Math.min(e,1))-tar}),j.css({marginRight:parseInt(tar*Math.min(e,1))-tar}),e-=.1,h.css({marginLeft:parseInt(tar*Math.min(e,1))-tar}),k.css({marginRight:parseInt(tar*Math.min(e,1))-tar})},a(l),b}(jQuery),SLIDE6=function(a){function e(){}var b={},c=a("#more address"),d=a("#more .top");return b.draw=function(a,b){var e=Math.min((a-this.range.top+b)/b,1);d.css({top:-10-(58-58*e)}),c.css({opacity:1*e})},a(e),b}(jQuery),APP=function(a){function p(){var b="placeholder";a("input["+b+'!=""]').each(function(c,e){d=a(e);var f=d.attr(b);if(f===undefined)return;d.focus(function(){this.value===f&&(this.value="")}).blur(function(){a.trim(this.value)===""&&(this.value=f)}),d.blur()})}function q(a){return a.split("#!/").join("")}function r(){var b=q(window.location.hash);b===""&&(b=a("section:first").attr("id")),d=a("#"+b);var c=Math.min(Math.max(1e3,Math.abs(d.offset().top-e.scrollTop())),4e3);l&&(l=!1,c=0);if(b===""){a("html,body").animate({scrollTop:0},250),document.title=o;return}a("html,body").stop().animate({scrollTop:d.offset().top},c,"easeOutQuad"),_gaq.push(["_trackPageview","/"+b])}function s(b){h=e.height(),a("#more").height(Math.max(h,850));for(var c=0;c<i.length;++c)i[c].update(h)}function u(a){t=e.scrollTop();for(var b=0;b<i.length;++b)d=i[b],t>d.range.drawtop&&t<d.range.bottom&&d.draw(t,h);v(),l=!1}function v(){j=document.elementFromPoint(f.position().left,200),k=a(j).closest("section");var b=k.index();if(k.length<0||n==b||b<0)return;document.title=k.data("title")+" : "+o,g.find("."+m).removeClass(m),g.find("a:nth-child("+(b+1)+")").addClass(m),n=b}function w(b){return a(b.currentTarget).find("button").attr("disabled","disabled").css({opacity:.5}),!0}function x(b,c,e,f){c.success?(d=a(b.target),d.parent().append('<span class="msg">'+c.msg+"</span>"),d.slideUp()):(a(b.target).find("button").removeAttr("disabled").css({opacity:1}),alert(c.msg))}var b=function(b,c){function g(){e.update(d.h),e.draw=d.draw}var d=a.extend({},a.fn.section.defaults,c),e=this,f=a(b);e.range={bottom:0,top:0,drawtop:0},e.$el=f,e.h=0,e.update=function(a){e.range.top=f.offset().top,e.range.drawtop=e.range.top-a,e.range.bottom=e.range.top+f.height(),e.h=f.height()},g()};a.fn.section=function(c){return this.each(function(d,e){var f=a(this),g="section";if(f.data(g))return;var h=new b(this,c);f.data(g,h)})},a.fn.section.defaults={h:100,draw:function(a,b){}};var c={},d,e=a(window),f=a("#wrap"),g=a("nav"),h=e.height(),i=[],j,k,l=!0,m="on",n=-1,o="Namely";return c.init=function(){a("a[href=#]").attr("href","javascript:;"),a("form").submit(w).on("ajax:success",x),a.ajaxSetup({cache:!1,type:"POST"}),Modernizr.input.placeholder||p(),yepnope([{test:Modernizr.csstransitions,nope:"javascripts/app/css3.js"}]),a("#more").height(Math.max(h,850)),a("#talent").section({h:h,draw:SLIDE1.draw}),a("#client").section({h:h,draw:SLIDE2.draw}),a("#everywhere").section({h:h,draw:SLIDE3.draw}),a("#expertise").section({h:h,draw:SLIDE4.draw}),a("#people").section({h:h,draw:SLIDE5.draw}),a("#more").section({h:h,draw:SLIDE6.draw}),a("section").each(function(b,c){i[i.length]=a(c).data("section")}),a.htmlhistory.init(),e.on("htmlhistory",r).scroll(u).resize(s),setTimeout(u,500)},c.rotate=function(a,b){var c="rotate("+b+"deg)";a.style.WebkitTransform=c,a.style.MozTransform=c,a.style.OTransform=c,a.style.MSTransform=c},a(c.init),c}(jQuery)
