jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});;(function($){$.fn.quicksand=function(collection,customOptions){var options={duration:750,easing:'swing',attribute:'data-id',adjustHeight:'auto',useScaling:true,enhancement:function(c){},selector:'> *'};$.extend(options,customOptions);if($.browser.msie||(typeof($.fn.scale)=='undefined')){options.useScaling=false;}
var callbackFunction;if(typeof(arguments[1])=='function'){var callbackFunction=arguments[1];}else if(typeof(arguments[2]=='function')){var callbackFunction=arguments[2];}
return this.each(function(i){var val;var animationQueue=[];var $collection=$(collection).clone();var $sourceParent=$(this);var sourceHeight=$(this).css('height');var destHeight;var adjustHeightOnCallback=false;var offset=$($sourceParent).offset();var offsets=[];var $source=$(this).find(options.selector);if($.browser.msie&&$.browser.version.substr(0,1)<7){$sourceParent.html('').append($collection);return;}
var postCallbackPerformed=0;var postCallback=function(){if(!postCallbackPerformed){$sourceParent.html($dest.html());if(typeof callbackFunction=='function'){callbackFunction.call(this);}
if(adjustHeightOnCallback){$sourceParent.css('height',destHeight);}
options.enhancement($sourceParent);postCallbackPerformed=1;}};var $correctionParent=$sourceParent.offsetParent();var correctionOffset=$correctionParent.offset();if($correctionParent.css('position')=='relative'){if($correctionParent.get(0).nodeName.toLowerCase()=='body'){}else{correctionOffset.top+=parseFloat($correctionParent.css('border-top-width'));correctionOffset.left+=parseFloat($correctionParent.css('border-left-width'));}}else{correctionOffset.top-=parseFloat($correctionParent.css('border-top-width'));correctionOffset.left-=parseFloat($correctionParent.css('border-left-width'));correctionOffset.top-=parseFloat($correctionParent.css('margin-top'));correctionOffset.left-=parseFloat($correctionParent.css('margin-left'));}
$sourceParent.css('height',$(this).height());$source.each(function(i){offsets[i]=$(this).offset();});$(this).stop();$source.each(function(i){$(this).stop();var rawObj=$(this).get(0);rawObj.style.position='absolute';rawObj.style.margin='0';rawObj.style.top=(offsets[i].top-parseFloat(rawObj.style.marginTop)-correctionOffset.top)+'px';rawObj.style.left=(offsets[i].left-parseFloat(rawObj.style.marginLeft)-correctionOffset.left)+'px';});var $dest=$($sourceParent).clone();var rawDest=$dest.get(0);rawDest.innerHTML='';rawDest.setAttribute('id','');rawDest.style.height='auto';rawDest.style.width=$sourceParent.width()+'px';$dest.append($collection);$dest.insertBefore($sourceParent);$dest.css('opacity',0.0);rawDest.style.zIndex=-1;rawDest.style.margin='0';rawDest.style.position='absolute';rawDest.style.top=offset.top-correctionOffset.top+'px';rawDest.style.left=offset.left-correctionOffset.left+'px';if(options.adjustHeight==='dynamic'){$sourceParent.animate({height:$dest.height()},options.duration,options.easing);}else if(options.adjustHeight==='auto'){destHeight=$dest.height();if(parseFloat(sourceHeight)<parseFloat(destHeight)){$sourceParent.css('height',destHeight);}else{adjustHeightOnCallback=true;}}
$source.each(function(i){var destElement=[];if(typeof(options.attribute)=='function'){val=options.attribute($(this));$collection.each(function(){if(options.attribute(this)==val){destElement=$(this);return false;}});}else{destElement=$collection.filter('['+options.attribute+'='+$(this).attr(options.attribute)+']');}
if(destElement.length){if(!options.useScaling){animationQueue.push({element:$(this),animation:{top:destElement.offset().top-correctionOffset.top,left:destElement.offset().left-correctionOffset.left,opacity:1.0}});}else{animationQueue.push({element:$(this),animation:{top:destElement.offset().top-correctionOffset.top,left:destElement.offset().left-correctionOffset.left,opacity:1.0,scale:'1.0'}});}}else{if(!options.useScaling){animationQueue.push({element:$(this),animation:{opacity:'0.0'}});}else{animationQueue.push({element:$(this),animation:{opacity:'0.0',scale:'0.0'}});}}});$collection.each(function(i){var sourceElement=[];var destElement=[];if(typeof(options.attribute)=='function'){val=options.attribute($(this));$source.each(function(){if(options.attribute(this)==val){sourceElement=$(this);return false;}});$collection.each(function(){if(options.attribute(this)==val){destElement=$(this);return false;}});}else{sourceElement=$source.filter('['+options.attribute+'='+$(this).attr(options.attribute)+']');destElement=$collection.filter('['+options.attribute+'='+$(this).attr(options.attribute)+']');}
var animationOptions;if(sourceElement.length===0){if(!options.useScaling){animationOptions={opacity:'1.0'};}else{animationOptions={opacity:'1.0',scale:'1.0'};}
d=destElement.clone();var rawDestElement=d.get(0);rawDestElement.style.position='absolute';rawDestElement.style.margin='0';rawDestElement.style.top=destElement.offset().top-correctionOffset.top+'px';rawDestElement.style.left=destElement.offset().left-correctionOffset.left+'px';d.css('opacity',0.0);if(options.useScaling){d.css('transform','scale(0.0)');}
d.appendTo($sourceParent);animationQueue.push({element:$(d),animation:animationOptions});}});$dest.remove();options.enhancement($sourceParent);for(i=0;i<animationQueue.length;i++){animationQueue[i].element.animate(animationQueue[i].animation,options.duration,options.easing,postCallback);}});};})(jQuery);;$.fn.strawberryGrid=function(tagsWrapperSelector,formatsWrapperSelector){return this.each(function(){var $list=$(this).find('ul'),$clone=$list.clone(),$items=$list.find('> li'),$tags=$(tagsWrapperSelector).find('a'),$formats=$(formatsWrapperSelector).find('a');$tags.each(function(){var total=$items.filter('[data-tags~='+$(this).attr('data-tag')+']').size();if(total>0){$(this).append('&nbsp;<sup>'+total+'</sup>');}
else{$(this).closest('li').remove();}});$clone.find(' > li > article').fadeTo(0,0.5);if($list.parent().hasClass('workList')){$items.find('a').live('click',function(){if($(this).closest('li').attr('data-state')=='active'){$(this).attr('href',function(){return'our-work/'+$tags.filter('.active').attr('data-tag')+'/'+$(this).closest('li').attr('data-id');});}});$formats.filter('[data-format=full]').click(function(){if($items.filter(':first').attr('data-state')=='active'){$(this).attr('href',function(){return'our-work/'+$tags.filter('.active').attr('data-tag')+'/'+$items.filter(':first').attr('data-id');});}});}
$tags.click(function(){$tags.filter('[data-tag!='+$(this).attr('data-tag')+']').removeClass('active blackOnYellow');$(this).toggleClass('active blackOnYellow');if($tags.filter('.active').size()==1){var activeTag=$tags.filter('.active').attr('data-tag');if(!$.browser.msie||$.browser.version.substr(0,1)>6){$clone.find('> li[data-tags~='+activeTag+']').prependTo($clone);$formats.filter('[data-format=full]').attr('href',$clone.find('> li:first h1 a').attr('href'));$items.removeAttr('data-state').find('> article').animate({opacity:0.5},250,function(){$list.quicksand($('> li',$clone),{adjustHeight:false,duration:500,easing:'easeInOutQuad'},function(){$list.find('> li[data-tags~='+activeTag+']').attr('data-state','active').find('> article').animate({opacity:1},250);$items=$list.find('> li');});});}
else{$list.find('> li > article').css({opacity:0.5});$list.find('> li[data-tags~='+activeTag+']').attr('data-state','active').find('> article').css({opacity:1});}}
else{$list.find('> li > article').animate({opacity:1},250);}
return false;});$formats.filter('[data-format!=full]').click(function(){if(!$(this).parent('li').hasClass('active')){var $clickedFilter=$(this);$list.filter(':not(:animated)').fadeOut(250,function(){$list.removeClass($formats.closest('.active').attr('data-format'));$clone.removeClass($formats.closest('.active').attr('data-format'));$formats.filter('[data-format!=full]').closest('li').toggleClass('active');$list.addClass($clickedFilter.attr('data-format')).css({'height':'auto'});$clone.addClass($clickedFilter.attr('data-format')).css({'height':'auto'});$list.fadeIn(250);});}
return false;});});};;$.fn.strawberryCarousel=function(tagsWrapper,arrowsWrapper){window.innerShiv=(function(){var d,r;return function(h,u){if(!d){d=document.createElement('div');r=document.createDocumentFragment();/*@cc_on d.style.display = 'none';@*/}
var e=d.cloneNode(true);/*@cc_on document.body.appendChild(e);@*/e.innerHTML=h;/*@cc_on document.body.removeChild(e);@*/if(u===false){return e.childNodes;}
var f=r.cloneNode(true),i=e.childNodes.length;while(i--){f.appendChild(e.firstChild);}
return f;};}());return this.each(function(){function loadItem(item){var $item=$items.filter('div[data-entry-id='+item+']');if($item.find('article').size()===0){$.ajax({url:'/_embeds/_work_details_data/'+item,success:function(data){$item.each(function(){$(this).prepend(innerShiv(data));});}});}}
function updateCarouselLink($toUpdate,$replaceWith){$toUpdate.attr('href',$replaceWith.attr('data-id')).attr('data-id',$replaceWith.attr('data-id')).attr('data-entry-id',$replaceWith.attr('data-entry-id'));}
var $wrapper=$(this).css('overflow','hidden'),$carousel=$wrapper.find('> div'),$items=$carousel.find('> div'),$tags=$(tagsWrapper+' a'),$next=$(arrowsWrapper+' a[data-direction=next]'),$prev=$(arrowsWrapper+' a[data-direction=prev]'),$initialItem=$carousel.find('> div:has(article)').first(),singleWidth=$carousel.find('> div:first').outerWidth(),totalItems=$items.size(),currentItemIndex=$initialItem.index()+1;var listOfUsedTags=$wrapper.attr('data-tags');$tags.each(function(){var total=listOfUsedTags.split($(this).attr('data-tag')).length-1;if(total>0){$(this).append('&nbsp;<sup>'+total+'</sup>');}
else{$(this).closest('li').remove();}});if(totalItems>1){$carousel.append($items.slice(0,1).clone());$carousel.prepend($items.slice(totalItems-1,totalItems).clone());$items=$carousel.find('> div');$items.filter(':first, :last').each(function(){$(this).html(innerShiv($(this).html()));});$carousel.css('width',$items.size()*singleWidth+'px');if($prev.size()===0||$next.size()===0){$wrapper.after('<ul id=\"carouselControls\"></ul>');var $arrows=$('#carouselControls');$arrows.append('<li id=\"goPrev\"><a href="#" data-direction="prev">Previous Project</a></li>');$arrows.append('<li id=\"goNext\"><a href="#" data-direction="next">Next Project</a></li>');$next=$arrows.find('a[data-direction=next]');$prev=$arrows.find('a[data-direction=prev]');updateCarouselLink($next,$initialItem.next());updateCarouselLink($prev,$initialItem.prev());}
loadItem($next.attr('data-entry-id'));if($next.attr('data-entry-id')!=$prev.attr('data-entry-id')){loadItem($prev.attr('data-entry-id'));}
$wrapper.scrollLeft(currentItemIndex*singleWidth);$next.click(function(){return gotoItem(currentItemIndex+1);});$prev.click(function(){return gotoItem(currentItemIndex-1);});function gotoItem(gotoItemIndex){var distance=singleWidth*(gotoItemIndex<currentItemIndex?-1:1);$wrapper.filter(':not(:animated)').animate({scrollLeft:'+='+distance},{duration:1000,easing:'easeInOutQuad',complete:function(){if(gotoItemIndex===0){$wrapper.scrollLeft(singleWidth*totalItems);gotoItemIndex=totalItems;}else if(gotoItemIndex>totalItems){$wrapper.scrollLeft(singleWidth);gotoItemIndex=1;}
currentItemIndex=gotoItemIndex;var $currentItem=$carousel.find('> div:eq('+currentItemIndex+')');$tags.filter('.blackOnYellow').removeClass('blackOnYellow');$.each($currentItem.attr('data-tags').split(" "),function(){$tags.filter('[href~=/our-work/'+this+']').addClass('blackOnYellow');});updateCarouselLink($next,$currentItem.next());updateCarouselLink($prev,$currentItem.prev());$('#backToTop a').click();if(distance>0){loadItem($next.attr('data-entry-id'));}
else{loadItem($prev.attr('data-entry-id'));}}});return false;}
$(document.documentElement).keyup(function(event){if(event.keyCode==37){$prev.click();}else if(event.keyCode==39){$next.click();}});}
else{$next.parents('ul').remove();$('#filterListView p').hide();}});};;$.fn.strawberryHome=function(){window.innerShiv=(function(){var d,r;return function(h,u){if(!d){d=document.createElement('div');r=document.createDocumentFragment();/*@cc_on d.style.display = 'none';@*/}
var e=d.cloneNode(true);/*@cc_on document.body.appendChild(e);@*/e.innerHTML=h;/*@cc_on document.body.removeChild(e);@*/if(u===false){return e.childNodes;}
var f=r.cloneNode(true),i=e.childNodes.length;while(i--){f.appendChild(e.firstChild);}
return f;};}());return this.each(function(){function goToItem(gotoItemIndex,repeat){var distance=singleWidth*Math.abs(currentItemIndex-gotoItemIndex)*(gotoItemIndex<currentItemIndex?-1:1);$wrapper.filter(':not(:animated)').animate({scrollLeft:'+='+distance},{duration:1000,easing:'easeInOutQuad',complete:function(){if(gotoItemIndex===0){$wrapper.scrollLeft(singleWidth*totalItems);gotoItemIndex=totalItems;}
else if(gotoItemIndex>totalItems){$wrapper.scrollLeft(singleWidth);gotoItemIndex=1;}
currentItemIndex=gotoItemIndex;$controls.find('a').removeClass('active').parent().eq(currentItemIndex-1).children('a').addClass('active');if(repeat){timer=setTimeout(function(){goToItem(currentItemIndex+1,true);},5000);}}});}
var $wrapper=$(this),$carousel=$('#latestWork > div'),$items=$carousel.find('> article');$wrapper.before('<ol id="latestWorkControls"></ol>');$controls=$('#latestWorkControls');$items.each(function(){$controls.append('<li><a href="'+$('.latestWorkImage',this).attr('href')+'">'+$('h1',this).text()+'</a></li>');});$controls.find('a').click(function(){clearTimeout(timer);goToItem($(this).parent().index()+1,false);return false;}).filter(':first').addClass('active');var singleWidth=$items.first().outerWidth(),totalItems=$items.size();$carousel.append(innerShiv('<article>'+$items.slice(0,1).html()+'</article>'));$carousel.prepend(innerShiv('<article>'+$items.slice(totalItems-1,totalItems).html()+'</article>'));$items=$carousel.find('> article');$carousel.css({'width':$items.size()*singleWidth+'px'});$wrapper.scrollLeft(singleWidth);var currentItemIndex=1;var timer=setTimeout(function(){goToItem(currentItemIndex+1,true);},5000);$wrapper.hover(function(){clearTimeout(timer);},function(){timer=setTimeout(function(){goToItem(currentItemIndex+1,true);},5000);});});};;$(document).ready(function(){if(!$.browser.msie||($.browser.msie&&$.browser.version>7)){$('#latestWork').strawberryHome();}
$('#grid').filter('.workList, .peopleList').strawberryGrid('#filterListTags','#filterListView');$('#work').strawberryCarousel('#filterListTags','#carouselControls');$('a[rel~=external]').click(function(){this.target="_blank";});$('a.readMore').click(function(){$(this).fadeOut('250').parent().siblings('div:not(:visible)').slideDown();return false;});$('#backToTop a').click(function(){var selector='body, html';if(/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)){selector='html';}
$(selector).animate({scrollTop:0},{duration:500,easing:'easeInOutQuad'});return false;});});