$(document).ready(function() {
	
	// make project images align-bottom
	var projects = $("#wrap").children(".project");
	var imgh;
	var margt;
	projects.each(
		function(i){
			imgh = $(this).find("img").height();
			margt = 280 - imgh - 40;
			$(this).find("img").css("margin-top",margt);
			// make sure the headings and paragraps have the same width as image
			$(this).find("p","h3").width($(this).find("img").width());
		}
	);
	// set the width of #wrap to the width of all of its content
	var ww = 0;
	var elems = $("#wrap").children();
	elems.each(
		function(i){
			ww = ww + $(this).width() + parseInt($(this).css("padding-left")) + parseInt($(this).css("padding-right")) + 1;
		}
	);
	$("#wrap").width(ww);
	// scroll to id

  	var target = location.hash;
  	if( target ){
    	$.scrollTo(target, 0);
		}
 });