var funcObj={domReady:function(){smoothScroll.init();$("a[href*=#]").each(smoothScroll.animate);$(".crew-images img").on("click",funcObj.imageSwitch);var a=$(".arrows"),b=$(".right-arrow").show(),c=$(".left-arrow"),d=$(".left-arrow.workarrow"),e=$(".left-arrow.crewarrow"),f=$(".right-arrow.workarrow"),g=$(".right-arrow.crewarrow"),h=$(".workarrow"),i=$(".crewarrow"),j=$(window).height(),k=$(window).width(),l=$("#work .content"),m=$("#crew-2 .content"),n=$(".page"),o,p;o=l.offset().top;p=m.offset().top;h.css("top",o+350);i.css("top",p+350);var q=$(".work .content");var m=$(".crew-2 .content");d.on({mouseenter:function(){f.show();var a=q.find(".workexample").last().position().left+450;var b=q.position().left*-1;var c=parseInt(b/a*1e4);q.animate({left:0},c,function(){d.hide()})},mouseleave:function(){q.stop(false,false)}});f.on({mouseenter:function(){d.show();var a=q.find(".workexample").last().position().left+450;var b=q.position().left*-1;var c=parseInt((a-b)/a*1e4);q.animate({left:-1*a},c,function(){f.hide()})},mouseleave:function(){q.stop(false,false)}});e.on({mouseenter:function(){g.show();var a=m.children().last().position().left;var b=m.position().left*-1;var c=parseInt(b/a*5e3);m.animate({left:0},c,function(){e.hide()})},mouseleave:function(){m.stop(false,false)}});g.on({mouseenter:function(){e.show();var a=m.children().last().position().left;var b=m.position().left*-1;var c=parseInt((a-b)/a*5e3);m.animate({left:-1*a},c,function(){g.hide()})},mouseleave:function(){m.stop(false,false)}});f.on("click",function(){q.stop(false,false);var a=q.find(".workexample").last().position().left+450;var b=q.position().left*-1;if(b<=400){q.animate({left:-520},500);d.show()}else{var c=parseInt((b-400)/730)+1;var e=c*730+520;q.animate({left:-1*e},500);if(e>a){$(this).hide()}}});d.on("click",function(){q.stop(false,false);var a=q.find(".workexample").last().position().left+450;var b=q.position().left*-1;if(b<=500){q.animate({left:0},500);$(this).hide()}else{f.show();var c=parseInt((b-520)/730);var d=c*730+520;q.animate({left:-1*d},500)}});g.on("click",function(){m.stop(false,false);var a=m.children().last().position().left;var b=m.position().left*-1;var c=parseInt((b+40)/730)+1;var d=c*730;m.animate({left:-1*d},500);if(d>=a){$(this).hide()}});e.on("click",function(){m.stop(false,false);var a=m.children().last().position().left;var b=m.position().left*-1;if(b<=730){m.animate({left:0},500);$(this).hide()}else{g.show();var c=parseInt(b/730);var d=c*730;m.animate({left:-1*d},500)}})},fixMenuLinks:function(a,b){var c=$(b);var d=c.attr("href");var e=d.split("/");var f=e.pop();if(a===0){c.attr("href",e.join("/")+"/#home")}else{c.attr("href",e.join("/")+"/#"+f)}},ajaxLoad:function(a,b){var c='<section class="page '+a+'" id="'+a+'">';var d=""+a+"/ #"+a;$(c).load(d,function(){$("#wrapper").append($(this).html());if(b.length!=0){funcObj.ajaxLoad(b.shift(),b)}else{$(document).ready(function(){funcObj.domReady()})}})},imageSwitch:function(){var a=$(this);var b=a.attr("src");var c=a.parent().parent().find(".crew-featured img");c.attr("src",b)}};var smoothScroll={filterPath:function(a){return a.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},scrollableElement:function(a){for(var b=0,c=arguments.length;b<c;b++){var d=arguments[b],e=$(d);if(e.scrollTop()>0){return d}else{e.scrollTop(1);var f=e.scrollTop()>0;e.scrollTop(0);if(f){return d}}}return[]},init:function(){smoothScroll.locationPath=smoothScroll.filterPath(location.pathname);smoothScroll.scrollElem=smoothScroll.scrollableElement("html","body")},animate:function(){var a=smoothScroll.filterPath(this.pathname)||smoothScroll.locationPath;if(smoothScroll.locationPath==a&&(location.hostname==this.hostname||!this.hostname)&&this.hash.replace(/#/,"")){var b=$(this.hash),c=this.hash;if(c.length>0){var d=b.offset().top;$(this).click(function(a){a.preventDefault();$(smoothScroll.scrollElem).animate({scrollTop:d},400,function(){location.hash=c})})}}}};$(document).ready(function(){$("body").addClass("js");$(".singlepage a").each(funcObj.fixMenuLinks);if($(".arrows").length>0){funcObj.ajaxLoad("work",["crew-2","contact"])}})
