(function(){})(window.jQuery);
$(document).ready(function(){function r(){$(".collapse").bind("click",function(){$(this).next().toggle();$(this).toggleClass("toggle")}).next().toggle()}$("a[href^='http']").not("[href*='sfsarch.com']").attr("target","_blank");if($(".side-nav-scroll").length>0){$(".side-nav-scroll").jScrollPane();$(".side-nav-scroll a").bind("click",function(){$.cookie("scroll-pos",$(".side-nav-scroll").data("jsp").getPercentScrolledY(),{path:"/"})});$(".side-nav-scroll").data("jsp").scrollToPercentY($.cookie("scroll-pos",{path:"/"}))}$.cookie("scroll-pos",
null,{path:"/"});$("input[placeholder],textarea[placeholder]").placeholder();$(".hidden").hide();var g=false,l=window.History;if(!l.enabled)return false;l.Adapter.bind(window,"statechange",function(){l.getState()});var j=window.location.pathname;$("a[href='/"+segment_1+"/']").parent().parent().parent().show();$("a[href='/"+segment_1+"/']").parent().parent().parent().parent().addClass("selected");$("a[href='/"+segment_1+"/']").parent().parent().parent().parent().children("a").addClass("selected");
$("a[href='/"+segment_1+"/']").addClass("selected");$("a[href='"+j+"']").addClass("selected");$("a[href='"+j+"']").parent().parent().parent().show();$("a[href='"+j+"']").parent().parent().parent().parent().addClass("selected");$("a[href='/"+segment_1+"/"+segment_2+"/']").addClass("selected");$("a[href='/"+segment_1+"/"+segment_2+"/']").parent().parent().parent().show();$("a[href='/"+segment_1+"/"+segment_2+"/']").parent().parent().parent().parent().addClass("selected");$("a[href='/"+segment_1+"/"+
segment_2+"/"+segment_3+"/']").parent().parent().parent().show();$("a[href='/"+segment_1+"/"+segment_2+"/"+segment_3+"/']").parent().parent().parent().addClass("selected");segment_1=="projects"&&segment_2!=""&&segment_3==""&&$("#projects-list a:first").addClass("selected");$("#snav-features").children("li").slice(0,7).wrapAll("<ul>");$("#snav-features").children("li").slice(0,7).wrapAll("<ul>");$("#snav-features").children("li").slice(0,7).wrapAll("<ul>");$("#snav-features").children("li").slice(0,
7).wrapAll("<ul>");$("#snav-features").children("li").slice(0,7).wrapAll("<ul>");$("#snav-features").children("li").slice(0,7).wrapAll("<ul>");$("#snav-features").children("li").slice(0,7).wrapAll("<ul>");$("#snav-markets").children("li").slice(0,7).wrapAll("<ul>");$("#snav-markets").children("li").slice(0,7).wrapAll("<ul>");$("#snav-markets").children("li").slice(0,7).wrapAll("<ul>");$("#snav-markets").children("li").slice(0,7).wrapAll("<ul>");$("#snav-markets").children("li").slice(0,7).wrapAll("<ul>");
$("#snav-markets").children("li").slice(0,7).wrapAll("<ul>");$("#snav-markets").children("li").slice(0,7).wrapAll("<ul>");if(segment_1=="services"||segment_1=="awards-and-publications")segment_2==""&&segment_1!="awards-and-publications"&&$(".side-nav a:first").addClass("selected");$(".add-ebook").bind("click",function(){$(this).css("width",$(this).width()+"px");$(this).html("Page added")});if(segment_1=="projects"){$("a[href='/projects/']").next().show();$("a[href='/projects/']").next().children("ul").children("li").bind("click",
function(){$(this).parent().children("li").removeClass("selected");$(this).parent().children("li").children("div").hide();$(this).children("div").toggle();$(this).addClass("selected")})}$("<div>").attr("id","page-cover").appendTo("body");r();var i=$("#wrapper").offset().left,o=i;if(segment_1=="projects"&&segment_2!=""){var m=0,s=$("#project-images img").length,p=function(a){if(a<0)a=s-1;if(a>=s)a=0;$("#project-images img").hide();$("#project-images img:eq("+a+")").show();$("#s-img").attr("src",$("#project-images img:eq("+
a+")").attr("src"));m=a};$("<div>").attr("id","project-tn").appendTo("#project");$("#project-images img").each(function(a){a>0&&$(this).hide();a=$(this).attr("src");a=a.substr(a.lastIndexOf("/")+1,a.length);$("<img>").attr("src","http://www.sfsarch.com/images/projects/_project_tn/"+a).data("img",$(this)).appendTo("#project-tn").bind("click",function(){p($(this).data("img").index())})});$("#project-images").bind("click",function(){t()});$("#page-cover").bind("click",function(){u()});$("<div>").attr("id",
"slideshow").appendTo("body").hide();$("<img>").attr("id","s-img").appendTo("#slideshow");$("<div>").attr("id","s-button").text("View Slideshow").appendTo("#project").bind("click",function(){t()});$("<div>").attr("id","s-prev").appendTo("#slideshow").bind("click",function(){m--;p(m)}).bind("mouseenter mouseover",function(){$(this).children("div").fadeIn()}).bind("mouseleave",function(){$(this).children("div").fadeOut()});$("<div>").attr("id","s-next").appendTo("#slideshow").bind("click",function(){m++;
p(m)}).bind("mouseenter mouseover",function(){$(this).children("div").fadeIn()}).bind("mouseleave",function(){$(this).children("div").fadeOut()});$("<div>").appendTo("#s-prev, #s-next");$("<div>").attr("id","s-close").text("X").appendTo("#slideshow").bind("click",function(){u()});$("<div>").attr("id","s-title").text($("#project-column-1 h1").text()).appendTo("#slideshow");p(0);var t=function(){$("#slideshow").show();$("#page-cover").show()},u=function(){$("#slideshow").hide();$("#page-cover").hide()};
j=$("#project-features a").length-1;j>-1&&$("#project-features a:lt("+j+")").after(", ");$("<div>").attr("id","q-button").text("Client Quote").appendTo("#client-quote");$("#q-button").bind("click",function(){$("#client-quote-content").toggle();$(this).toggleClass("toggle")})}if(segment_1=="people"){$("<div>").attr("id","people-nav-container").appendTo("body");$("<div>").attr("id","people-nav-scroll").appendTo("#people-nav-container");$("#people-nav").appendTo("#people-nav-scroll");var e=$("#people-nav li").length,
n=e,f=e*128;$("#people-nav li").clone().prependTo("#people-nav ul");$("#people-nav li").clone().appendTo("#people-nav ul");$("#people-nav-scroll").css("left",-f+i+110);$("<div>").attr("id","people-nav-name").appendTo("#people-nav-scroll");$("<article>").attr("id","person").appendTo("#content").hide();segment_2!=""&&$("#people-list").show();j=$("#people-nav li").length;$("#people-nav").width(j*128);l.Adapter.bind(window,"statechange",function(){var a=l.getState().url,b=l.getState().data.state;if(a!=
"http://dev.sfsarch.com/people/"){$(".basic-page").hide();$("#people-list a").removeClass("selected");$("#people-list a[href='/people/"+b+"/']").addClass("selected");$.ajax({url:"/people/person/"+b+"/",success:function(c){$("#people-list").show();$("#person").html(c);r()}});$("#person").show()}else{$(".basic-page").show();$("#person").hide();$("#people-list").hide()}});$("<div>").attr("id","p-left").css("left",0).appendTo("#people-nav-container");$("<div>").attr("id","p-right").css("left",$("body").width()-
60).appendTo("#people-nav-container");$("<div>").attr("id","p-left-icon").hide().appendTo("#p-left");$("<div>").attr("id","p-right-icon").hide().appendTo("#p-right");$(window).bind("resize",function(){$("#p-right").css("left",$("body").width()-60);o=i;i=$("#wrapper").offset().left;var a=i-o;$("#people-nav-scroll").css("left",$("#people-nav-scroll").position().left+a)}).bind("mouseout",function(a){if(a.relatedTarget==null){$("#p-left-icon").fadeOut();$("#p-right-icon").fadeOut()}});var v=function(a){if(g==
false){var b=e;e-=a;var c=0;c=parseInt($("#people-nav-scroll").css("left"));c=a>0?c+($(".people-nav-image").eq(b).offset().left-$(".people-nav-image").eq(e).offset().left):c-($(".people-nav-image").eq(e).offset().left-$(".people-nav-image").eq(b).offset().left);if(c<-(f*2)){c+=f;$("#people-nav-scroll").css("left",c-($(".people-nav-image").eq(b).offset().left-$(".people-nav-image").eq(e).offset().left));e-=n}if(c>=0){c-=f;$("#people-nav-scroll").css("left",c+($(".people-nav-image").eq(e).offset().left-
$(".people-nav-image").eq(b).offset().left));e+=n}a=Math.abs(200*a);if(a<800)a=800;g=true;$("#people-nav-scroll").animate({left:c},a,"easeOutCubic",function(){var h=parseInt($("#people-nav-scroll").css("left"));if(h<-(f*2)){h+=f;e-=n}if(h>=0){h-=f;e+=n}$("#people-nav-scroll").css("left",h);g=false})}};$("#p-left").bind("click",function(){v(1)}).bind("mouseenter mouseover",function(){$("#p-left-icon").fadeIn()}).bind("mouseleave",function(){$("#p-left-icon").fadeOut()});$("#p-right").bind("click",
function(){v(-1)}).bind("mouseenter mouseover",function(){$("#p-right-icon").fadeIn()}).bind("mouseleave",function(){$("#p-right-icon").fadeOut()});$("#people-nav a").hover(function(){var a=$(this);$(a).find("img:first").hide();var b=$(a).find(".people-nav-name").text();$("#people-nav-name").text(b);a=$(a).parent().offset().left-$("#people-nav-scroll").offset().left;b=$("#people-nav-name").width();a=Math.round(a+60-b/2);$("#people-nav-name").css("left",a);$("#people-nav-name").show()},function(){$(this).find("img:first").show();
$("#people-nav-name").text("");$("#people-nav-name").hide()});$("#people-nav a, #people-list a").each(function(){var a=$(this).attr("href").split("/");$(this).data("link",a[2])}).bind("click",function(a){a.preventDefault();if(g==false){var b=$(this).data("link");l.pushState({state:b},null,"/people/"+b+"/");b=$(this).parent().index();if($("#people-list").find($(this)).length>0)b+=n;b!=e&&a.preventDefault();if(b>e)e=b-1;if(b<e)e=b+1}})}if(segment_1=="home"||segment_1==""){$("<div>").attr("id","home-images-container").appendTo("body");
$("<div>").attr("id","home-images-scroll").appendTo("#home-images-container");$("#home-images").appendTo("#home-images-scroll");f=0;var k=$(".home-image").length,w=0,d=k;$(".home-image img").each(function(){$(this).everyTime(10,"loader",function(){if($(this).width()>10){$(this).stopTime("loader");f+=$(this).width();w++;w==k&&z()}})});var z=function(){$("#home-images .home-image").clone().prependTo("#home-images");$("#home-images .home-image").clone().appendTo("#home-images");$("#home-images-scroll").css("left",
-f+i+110);$(".home-image").css("opacity",0.5);$("#home-images").css("visibility","visible");$("<div>").attr("id","home-info").appendTo("#wrapper");$("<span>").attr("class","home-info-block").appendTo("#home-info");$("<div>").attr("id","home-info-tab").appendTo("#wrapper");$("#home-info").bind("click",function(){location=$(".home-image").eq(d).children("a").attr("href")});$(".home-image").eq(d).css("opacity",1);$("#home-info .home-info-block").html($(".home-image").eq(d).find(".home-info-block").html());
$(".home-image").bind("click",function(a){var b=$(this).index();$("#home-images-scroll").stopTime("info");if(b!=d||g==true)a.preventDefault();b>d&&g==false&&q(-(b-d));b<d&&g==false&&q(d-b)}).hover(function(){$(this).index()!=d&&$(this).animate({opacity:0.7})},function(){$(this).index()!=d&&$(this).animate({opacity:0.5})})};$("<div>").attr("id","p-left").css("left",0).appendTo("#home-images-container");$("<div>").attr("id","p-right").css("left",$("body").width()-60).appendTo("#home-images-container");
$("<div>").attr("id","p-left-icon").hide().appendTo("#p-left");$("<div>").attr("id","p-right-icon").hide().appendTo("#p-right");$(window).bind("resize",function(){$("#p-right").css("left",$("body").width()-60);o=i;i=$("#wrapper").offset().left;var a=i-o;$("#home-images-scroll").css("left",$("#home-images-scroll").position().left+a)}).bind("mouseout",function(a){if(a.relatedTarget==null){$("#p-left-icon").fadeOut();$("#p-right-icon").fadeOut()}});$("#p-left").bind("click",function(){$("#home-images-scroll").stopTime("info");
g==false&&q(1)}).bind("mouseenter mouseover",function(){$("#p-left-icon").fadeIn()}).bind("mouseleave",function(){$("#p-left-icon").fadeOut()});$("#p-right").bind("click",function(){$("#home-images-scroll").stopTime("info");g==false&&q(-1)}).bind("mouseenter mouseover",function(){$("#p-right-icon").fadeIn()}).bind("mouseleave",function(){$("#p-right-icon").fadeOut()});var q=function(a){var b=d;d-=a;var c=0;c=parseInt($("#home-images-scroll").css("left"));c=a>0?c+($(".home-image").eq(b).offset().left-
$(".home-image").eq(d).offset().left):c-($(".home-image").eq(d).offset().left-$(".home-image").eq(b).offset().left);if(c<=-(f*2)){c+=f;$("#home-images-scroll").css("left",c-($(".home-image").eq(b).offset().left-$(".home-image").eq(d).offset().left));d-=k}if(c>=0){c-=f;$("#home-images-scroll").css("left",c+($(".home-image").eq(d).offset().left-$(".home-image").eq(b).offset().left));d+=k}a=Math.abs(200*a);if(a<800)a=800;g=true;$("#home-images-scroll").animate({left:c},a,"easeOutCubic",function(){var h=
parseInt($("#home-images-scroll").css("left"));if(h<-(f*2)){h+=f;d-=k}if(h>=0){h-=f;d+=k}$("#people-nav-scroll").css("left",h);g=false;$("#home-images-scroll").oneTime(500,"info",function(){$("#home-info .home-info-block").html(x);$("#home-info .home-info-block").animate({top:0})})});$(".home-image").animate({opacity:0.5});$(".home-image").eq(d).clearQueue().animate({opacity:1});$(".home-image").eq(d+k).clearQueue().animate({opacity:1});$(".home-image").eq(d-k).clearQueue().animate({opacity:1});A($(".home-image").eq(d).find(".home-info-block").html());
$("#home-info .home-info-block").animate({top:-18})},x="",A=function(a){x=a}}if(segment_1=="ebook"){segment_2!=""&&$("#ebook-form").show();$("#ebook-close").bind("click",function(){$("#ebook-form").hide()});$("#ebook-download-link").bind("click",function(){$(".ebook-item").remove();$("#ebook-form").hide()});$("#save-ebook").bind("click",function(a){a.preventDefault();$("#ebook-form").show()})}if(segment_1=="process"){$("#process-image span, #process-steps span").bind("mouseover",function(){y($(this).index())}).bind("mouseout",
function(){y()});var y=function(a){$("#process-steps span").removeClass("process-hover");if(a==null)$("#process-image").css("background-position-y","0");else{var b=(a+1)*246+(a+1)*10;$("#process-image").css("background-position-y",-b);$("#process-steps span:eq("+a+")").addClass("process-hover")}}}});

