$(document).ready(function () {
	$(".nav a").click(function (event) {
		var id = $(this).attr('href');
		if (id == "#") {
			$("html, body").animate({ scrollTop: 0 }, 200);
		}
		else {
			top = $(id).offset().top;
			$("html, body").animate({ scrollTop: top }, 200);
		}
		return true;
	});
	
	$(".imagegroup a").lightBox({
		txtImage: "<i>Copyright (c) 2010 Matt Wright. All rights reserved.</i> Image"
	});
});

var resizeFunction = function() {
	$("div.section").each(function (index) {
		var margin = "75px";
		if ($(this).height() < $(window).height()) {
			margin = ($(window).height() - $(this).height())+"px";
			console.log(margin);
		}
		$(this).css({ marginBottom: margin });
	});
}

$(window).load(resizeFunction);
$(window).resize(resizeFunction);