(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(d){var b=location.href.replace(/#.*/,"");var c=d.localScroll=function(e){d("body").localScroll(e)};c.defaults={duration:1000,axis:"y",event:"click",stop:true,target:window,reset:true};c.hash=function(e){if(location.hash){e=d.extend({},c.defaults,e);e.hash=false;if(e.reset){var f=e.duration;delete e.duration;d(e.target).scrollTo(0,e);e.duration=f}a(0,location,e)}};d.fn.localScroll=function(f){f=d.extend({},c.defaults,f);return f.lazy?this.bind(f.event,function(h){var g=d([h.target,h.target.parentNode]).filter(e)[0];if(g){a(h,g,f)}}):this.find("a,area").filter(e).bind(f.event,function(g){a(g,this,f)}).end().end();function e(){return !!this.href&&!!this.hash&&this.href.replace(this.hash,"")==b&&(!f.filter||d(this).is(f.filter))}};function a(l,j,h){var m=j.hash.slice(1),i=document.getElementById(m)||document.getElementsByName(m)[0];if(!i){return}if(l){l.preventDefault()}var g=d(h.target);if(h.lock&&g.is(":animated")||h.onBefore&&h.onBefore.call(h,l,i,g)===false){return}if(h.stop){g.stop(true)}if(h.hash){var f=i.id==m?"id":"name",k=d("<a> </a>").attr(f,m).css({position:"absolute",top:d(window).scrollTop(),left:d(window).scrollLeft()});i[f]="";d("body").prepend(k);location=j.hash;k.remove();i[f]=m}g.scrollTo(i,h).trigger("notify.serialScroll",[i])}})(jQuery);(function(a){a.anythingSlider=function(c,b){var d=this;d.$el=a(c);d.el=c;d.currentPage=1;d.timer=null;d.playing=false;d.$el.data("AnythingSlider",d);d.init=function(){d.options=a.extend({},a.anythingSlider.defaults,b);d.$wrapper=d.$el.find("> div").css("overflow","hidden");d.$slider=d.$wrapper.find("> ul");d.$items=d.$slider.find("> li");d.$single=d.$items.filter(":first");if(d.options.buildNavigation){d.buildNavigation()}d.singleWidth=d.$single.outerWidth();d.pages=d.$items.length;d.$items.filter(":first").before(d.$items.filter(":last").clone().addClass("cloned"));d.$items.filter(":last").after(d.$items.filter(":first").clone().addClass("cloned"));d.$items=d.$slider.find("> li");d.buildNextBackButtons();if(d.options.autoPlay){d.playing=!d.options.startStopped;d.buildAutoPlay()}if(d.options.pauseOnHover){d.$el.hover(function(){d.clearTimer()},function(){d.startStop(d.playing)})}if((d.options.hashTags==true&&!d.gotoHash())||d.options.hashTags==false){d.setCurrentPage(1)}};d.gotoPage=function(g,f){if(f!==true){f=false}if(!f){d.startStop(false)}if(typeof(g)=="undefined"||g==null){g=1;d.setCurrentPage(1)}if(g>d.pages+1){g=d.pages}if(g<0){g=1}var e=g<d.currentPage?-1:1,i=Math.abs(d.currentPage-g),h=d.singleWidth*e*i;d.$wrapper.filter(":not(:animated)").animate({scrollLeft:"+="+h},d.options.animationTime,d.options.easing,function(){if(g==0){d.$wrapper.scrollLeft(d.singleWidth*d.pages);g=d.pages}else{if(g>d.pages){d.$wrapper.scrollLeft(d.singleWidth);g=1}}d.setCurrentPage(g)})};d.setCurrentPage=function(f,e){if(d.options.buildNavigation){d.$nav.find(".cur").removeClass("cur").fadeTo("fast",1);a(d.$navLinks[f-1]).addClass("cur").fadeTo("fast",0.2)}d.options.changeEnd(f);if(e!==false){d.$wrapper.scrollLeft(d.singleWidth*f)}d.currentPage=f};d.goForward=function(e){if(e!==true){e=false}d.gotoPage(d.currentPage+1,e)};d.goBack=function(){d.gotoPage(d.currentPage-1)};d.gotoHash=function(){if(/^#?panel-\d+$/.test(window.location.hash)){var f=parseInt(window.location.hash.substr(7));var e=d.$items.filter(":eq("+f+")");if(e.length!=0){d.setCurrentPage(f);return true}}return false};d.buildNavigation=function(){d.$nav=a("<div id='thumbNav'></div>").appendTo(d.$el);d.$items.each(function(f,g){var e=f+1;var h=a("<a href='#'></a>");if(typeof(d.options.navigationFormatter)=="function"){h.html(d.options.navigationFormatter(e,a(this)))}else{h.text(e)}h.click(function(i){d.gotoPage(e);if(d.options.hashTags){d.setHash("panel-"+e)}i.preventDefault()});d.$nav.append(h)});d.$navLinks=d.$nav.find("> a")};d.buildNextBackButtons=function(){var e=a('<a class="arrow forward" title="Next">&gt;</a>'),f=a('<a class="arrow back" title="Previous">&lt;</a>');f.click(function(g){d.goBack();g.preventDefault()}).hover(function(){a(this).fadeTo("fast",0.6)},function(){a(this).fadeTo("fast",1)});e.click(function(g){d.goForward();g.preventDefault()}).hover(function(){a(this).fadeTo("fast",0.6)},function(){a(this).fadeTo("fast",1)});d.$wrapper.after(f).after(e)};d.buildAutoPlay=function(){d.$startStop=a("<a href='#' id='start-stop'></a>").html(d.playing?d.options.stopText:d.options.startText);d.$el.append(d.$startStop);d.$startStop.click(function(f){d.startStop(!d.playing);f.preventDefault()});d.startStop(d.playing)};d.startStop=function(e){if(e!==true){e=false}d.playing=e;if(d.options.autoPlay){d.$startStop.toggleClass("playing",e).html(e?d.options.stopText:d.options.startText)}if(e){d.clearTimer();d.timer=window.setInterval(function(){d.goForward(true)},d.options.delay)}else{d.clearTimer()}};d.clearTimer=function(){if(d.timer){window.clearInterval(d.timer)}};d.setHash=function(e){if(typeof window.location.hash!=="undefined"){if(window.location.hash!==e){window.location.hash=e}}else{if(location.hash!==e){location.hash=e}}return e};d.init()};a.anythingSlider.defaults={easing:"swing",autoPlay:true,startStopped:false,delay:3000,animationTime:600,hashTags:true,buildNavigation:true,pauseOnHover:true,startText:"Start",stopText:"Stop",navigationFormatter:null,changeEnd:function(){}};a.fn.anythingSlider=function(b){if(b==="n"){return this.each(function(c){var d=a(this).data("AnythingSlider");if(d){d.goForward()}})}else{if(b==="p"){return this.each(function(c){var d=a(this).data("AnythingSlider");if(d){d.goBack()}})}else{if(typeof(b)=="object"){return this.each(function(c){(new a.anythingSlider(this,b));b.hashTags=false})}else{if(typeof(b)=="number"){return this.each(function(c){var d=a(this).data("AnythingSlider");if(d){d.gotoPage(b)}})}}}}}})(jQuery);$(function(){function b(j,i){$(i).fadeOut("fast",function(){$("#"+j).fadeIn("fast")})}$("#page_blog,#page_products,#page_expertise").show();var e={animationTime:600,delay:4000,hashTags:false,navigationFormatter:function(){return false}},h=$.extend({},e),d=$("#page_web"),f=$(".menu"),a=0,c=$("#about"),g=f.find(".web,.copy-writing-and-editing");h.autoPlay=false;setPageHeight();$(".anythingSlider:eq(0)").anythingSlider($.extend({changeEnd:function(i){changeCaption(i,"web")}},e));$("#page_web_about .arrow.forward").click(function(){var i=a+1;if(i>2){return}c.find("li").fadeOut("fast");c.find("li:eq("+i+")").fadeIn("fast");a=i});$("#page_web_about .arrow.back").click(function(){var i=a-1;if(i<0){return}c.find("li").fadeOut("fast");c.find("li:eq("+i+")").fadeIn("fast");a=i});f.find(".web,.copy-writing-and-editing").attr("href","#top");f.find(".blog").attr("href","#blog");f.find(".products").attr("href","#products");f.find(".skills-and-services,.contact").attr("href","#skills-and-services");$.localScroll({hash:true,duration:600});$(window).resize(function(){setPageHeight()});$.get("/pages/copy-writing-and-editing.php",null,function(l){var k=d.find(".sliders").append(l);g.attr("href","#top").click(function(){var n=$(this),m=0;g.removeClass("selected");if(n.hasClass("web")){d.find(".menu .web").addClass("selected")}else{d.find(".menu .copy-writing-and-editing").addClass("selected")}if(n.hasClass("copy-writing-and-editing")===true){m=-490}d.find(".sliders").animate({top:m},e.animationTime)});var i=d.find(".subMenu");i.find(".web").click(function(){if($(this).hasClass("clients")===true){b("page_web_clients","#page_web_approach,#page_web_about")}else{if($(this).hasClass("about")===true){b("page_web_about","#page_web_clients,#page_web_approach")}else{b("page_web_approach","#page_web_clients,#page_web_about")}}return false}).end().find(".copy").click(function(){if($(this).hasClass("clients")===true){b("page_copy_clients","#page_copy_approach")}else{b("page_copy_approach","#page_copy_clients")}return false});var j=d.find(".content.approach .right div").css({position:"absolute",top:0,left:0}).not(".current").hide().css("opacity",0);$("<a/>").attr("href","#").addClass("arrow").click(function(){var o=$(this.parentNode),n=o.attr("class").split(" "),m=parseInt(n[1].split("-")[1])+1;approach(o,$("#page_web .item-"+m),e.animationTime);return false}).prependTo(j.end().not(".last"));d.find(".content.approach .left a").click(function(){approach(d.find(".content.approach .right .current"),$(".content.approach .right ."+this.className.split(" ")[0]),e.animationTime);return false});d.find(".anythingSlider.injected").anythingSlider($.extend({changeEnd:function(m){changeCaption(m,"copy")}},e));$("#page_blog .subWrapper").load("/pages/blog.php",null,function(){$slider=$(this).find(".anythingSlider.injected").anythingSlider(h);$("#page_blog_latest").click(function(){$slider.anythingSlider(1);return false});$("#page_blog_next").click(function(){$slider.anythingSlider("n");return false});$("#page_blog_previous").click(function(){$slider.anythingSlider("p");return false});$("#page_products .content").load("/pages/products.php",null,function(){var m=$("#page_expertise");m.find(".placeholder").load("/pages/skills-and-services.php",function(){var n=m.find(".subSubMenu");m.find(".subMenu a").click(function(){$(this.parentNode.parentNode).find("li").removeClass("selected");$(this.parentNode).addClass("selected");m.find(".subPage").hide();$("#"+$(this).attr("class")).show();return false});f.find(".contact").click(function(){m.find(".subMenu .page_expertise_contact").trigger("click")});n.find("a").click(function(){var p=$(this),q=p.text(),o=$(this.parentNode.parentNode.parentNode);n.find("li").removeClass("selected");n.find("."+p.attr("class")).parent().addClass("selected");m.find(".subSubPage").hide();m.find("div."+p.attr("class")).show();$("#page_expertise_image").fadeOut("fast",function(){$(this).attr({src:"/images/expertise/"+q.toLowerCase()+".jpg",alt:q}).fadeIn("fast")});return false});$("a[href^='http://']").click(function(){$(this).attr("target","_blank")})})})})})});function changeCaption(c,b){var a=$("#page_"+b+"_caption_"+c);$("#page_"+b+"_clients .caption").animate({width:0},{duration:300,queue:false});if(a){setTimeout(function(){a.animate({width:600},{duration:600,queue:false})},300)}}function approach(a,c,b){a.animate({opacity:0},{queue:false,duration:b,complete:function(){$(this).hide()}}).removeClass("current");c.show().animate({opacity:1},{queue:false,duration:b}).addClass("current")}function setPageHeight(){var e=$(window).height(),d=543,a=d+100,c=701,b="auto";if(e>a){a=e}if(e>c){c=e;b="hidden"}$("body").css("overflow",b);$(".page:not(#page_web)").height(a).find(".colour").css("marginBottom",(a-d-100));$("#page_web").height(c).find(".colour").css("marginBottom",(c-d-158));if(window.location.hash&&b==="hidden"){window.location.href=window.location.hash}};