var document_height = null;

function set_footer_location() {
	if (document_height < $(window).height()) {
		$('footer').css({position:'absolute',top: $(window).height() - $('footer').outerHeight(), width:'100%'});
	} else {
		$('footer').css({position:'relative',top: 0});
	}
}

$(document).load(function() {
	document_height = $(document.body).height();
	set_footer_location();
});

$(window).resize(set_footer_location);

if ($('body.work').length) {
	
	var subnav_offset_top = $('div.subnav').offset().top;
	
	$(window).bind('scroll', function() {
		if (subnav_offset_top -20 < $(window).scrollTop()) {
			$('div.subnav').css({position:'absolute', top:$(window).scrollTop() +20});
		}
	});
	
}
