$(document).ready(function(){var d;$(".project").hover(function(){if(!$(this).hasClass("selected")&&!$(this).hasClass("constructing")){$(this).css("background-color","#f6f6f6");$(".expand",this).css("top",$(this).offset().top+$(this).height()-$(".expand",this).height()-2);$(".expand",this).css("left",$(this).offset().left+$(this).width()/2-$(".expand",this).width()/2);if(!$(".project").is(":animated")){$(".expand",this).fadeIn(500)}}},function(){if(!$(this).hasClass("selected")&&!$(this).hasClass("constructing")){$(this).css("background-color","transparent");$(".expand",this).hide()}});$(".project").click(function(){if(!$(this).hasClass("selected")&&!$(this).hasClass("constructing")){$pr=$(this);d="#"+$(this).attr("id");$ex=$(".expand",this);$ex.hide();$(".selected > .belowfold").fadeOut(300);for(var e=0;e<c.length;e++){if($(this).attr("id")==c[e]){$(this).animate({height:a[e]},300)}}$(".belowfold",this).fadeIn(300,function(){$ex.css("top",$pr.height()+$pr.offset().top-26);$ex.show()});$(".project").css("cursor","pointer");$(this).css("cursor","auto");$(".constructing").css("cursor","auto");$(".selected").css("background-color","transparent");$(".selected").stop().animate({height:"198px"},{queue:false,duration:200,easing:"easeOutCubic"});$(".selected > .expand").fadeOut(100);$(".selected > .expand").html('<img src="images/expand_icon.png" alt="expand icon"/> expand');$(".selected > .expand").css("width","75px");$(".project").removeClass("selected");$(this).addClass("selected");$(".hovericon",this).css("top",$(".left",this).height()/2-$(".hovericon",this).height()/2+$(".left",this).offset().top);$(".hovericon",this).css("left",$(".left",this).width()/2-$(".hovericon",this).width()/2+$(".left",this).offset().left)}$(".expand",this).html('<img src="images/collapse_icon.png" alt="expand icon"/> collapse');$(".expand",this).css("width","82px")});$(".expand").click(function(){if($("img",this).attr("src")=="images/collapse_icon.png"){$(".project").css("cursor","pointer");$(".constructing").css("cursor","auto");$(".selected > .belowfold").fadeOut(200);$(".selected").css("background-color","transparent");$(".selected").stop().animate({height:"198px"},{queue:false,duration:200,easing:"easeOutCubic"});$(".project").removeClass("selected");$(this).css("width","75px");$(this).html('<img src="images/expand_icon.png" alt="expand icon"/> expand');$(this).fadeOut(100);return false}});$(".launch").hover(function(){$(this).css("background","url(images/launch.jpg) no-repeat bottom left")},function(){$(this).css("background","url(images/launch.jpg) no-repeat top left")});$(".launch").click(function(){$(this).css("background","url(images/launch.jpg) no-repeat top left")});var c=["lod","sblm","cogan","ge","aebuilders","awi","svs","churchst","phillycarshare","processingjs","webbyawards","composite","magnet"];var a=[];for(var b=0;b<c.length;b++){a.push($("#"+c[b]).height())}$(".belowfold").hide();$(".expand").hide();$("#ge-gallery,#sblm-gallery,#lod-gallery,#cogan-gallery,#awi-gallery,#magnet-gallery").hover(function(){if($(this).parent().parent().hasClass("selected")){$(".hovericon").fadeOut(300);startRotate($(this))}},function(){stopRotate()});$("#all").click(function(){$(d+" > .expand").triggerHandler("click");$(".project").show()});$("#web").click(function(){$(d+" > .expand").triggerHandler("click");$(".project").hide();$(".web").show()});$("#motion").click(function(){$(d+" > .expand").triggerHandler("click");$(".project").hide();$(".motion").show()});$("#app").click(function(){$(d+" > .expand").triggerHandler("click");$(".project").hide();$(".app").show();})});var imgInterval;var currentImg;var firstTime=true;function startRotate(a){if(currentImg==undefined){$("img",a).css({opacity:0});$("img:first",a).css({opacity:1})}rotate(a);imgInterval=setInterval(function(){rotate(a)},2500)}function rotate(b){currentImg=($("img.show",b)?$("img.show",b):$("img:first",b));var a=((currentImg.next().length)?((currentImg.next().hasClass("show"))?$("img:first",b):currentImg.next()):$("img:first",b));a.css({opacity:0}).addClass("show").animate({opacity:1},1500);currentImg.animate({opacity:0},1500).removeClass("show")}function stopRotate(){imgInterval=clearInterval(imgInterval)}function resetRotate(a){$("img:first",a).addClass("show");currentImg=undefined};
