(function(c){var d,b=true;function e(g){e._cache=e._cache||{};if(!e._cache[g]){var f=$("#content_"+g).clone();f.css({position:"absolute",visibility:"none",height:"auto",width:$("#main").width()});$("#main").append(f);e._cache[g]=f.height();f.remove()}return e._cache[g]}function a(i,k){var g=$.Deferred(),h;if(!b){h=(i==="home")?"/":"/"+i+"/";_gaq.push(["_trackPageview",h])}content=$("#content_"+i);if(d.get(0)===content.get(0)){return}function f(l){if(b){b=false;$("#main").css("height",$("#main").height())}$("#main").animate({height:0},function(){d.hide();l.then(function(){if(typeof k==="function"){k()}content.show();$("#main").animate({height:e(i)});d=content;g.resolve()})})}if(!content.size()){var j=$.get("/content/"+i+".html",function(l){content=$(l);content.hide();$("#main").append(content);f(j)})}else{f($.Deferred().resolve())}return g}$(function(){d=$("#main").children().first();Route.setup({"/":function(){a("home")},"/about/":function(){a("about")},"/projects/":function(){a("projects")}});$("a.home_link").bind("click",function(f){Route.navigate("/");f.preventDefault()});$("a.about_link").bind("click",function(f){Route.navigate("/about/");f.preventDefault()});$("a.projects_link").bind("click",function(f){Route.navigate("/projects/");f.preventDefault()})})})(window);
