function resizeImage() {
	var window_height = parseInt($(window).height());
	var window_width  = parseInt($(window).width());
	
	var image_width = parseInt($('#background-image').attr('width'));
	var image_height = parseInt($('#background-image').attr('height'));

	var height_ratio = window_height / image_height
	var width_ratio = window_width / image_width
	
	
	if (height_ratio > width_ratio) {
		var new_height = Math.ceil(height_ratio * image_height);
		var new_width = Math.ceil(height_ratio * image_width);
		
	} else {
		var new_height = Math.ceil(width_ratio * image_height);
		var new_width = Math.ceil(width_ratio * image_width)
	}

	$('#background-image').attr('width', new_width);
	$('#background-image').attr('height', new_height);
	
	// Render offsets
	var lMargin = Math.floor((new_width-window_width)/2);
	var hMargin = Math.floor((new_height-window_height)/2);
	$('#background-image').css('margin-left', '-'+lMargin+'px');
	$('#background-image').css('margin-top', '-'+hMargin+'px');
	
}
