$(document).ready(function(){
	footerPosition();
});


$(window).resize(function(){
	footerPosition();
});

function footerPosition() {
	//alert('win: '+$(window).height()+', wrapper: '+$('#wrapper').height());
	/*if($(window).height() > $('#wrapper').height()) {
		$('#footer').addClass('abs');
	} else {
		$('#footer').removeClass('abs');
	}*/
	if($('#footer')) {
		if($(window).height() > $('#wrapper').height()) {
			$('#footer').addClass('abs');
		}
	}
	if($('#footer.abs')) {
		if($(window).height() < ($('#wrapper').height() + 370)) {
			$('#footer').removeClass('abs');
		}
	}
	//alert('win: '+$(window).height()+', wrapper: '+$('#wrapper').height());
}
