$(document).ready(function() { $('#content').css('margin-bottom', 0); placeFooter(); } );
$(window).resize(placeFooter);

function placeFooter()
{
	var windowHeight = $(window).height();
	var footerPosition = $('#footer').position();
	var footerHeight = parseInt($('#footer').css('height'));
	
	
	if(windowHeight > (footerPosition.top + footerHeight))
	{
		$('#footer').css('margin-top', windowHeight - (footerPosition.top + footerHeight));
	}
	else
	{
		$('#footer').css('margin-top', 20);
	}
}
