jQuery(document).ready(function($) {
	var main = $('#main');
	
	// first let's see if we even care about backgrounds:
	if (main.css('backgroundImage').substr(0, 4) != 'url(') return;
	
	// does the browser support background-size? if not, we'll have to do our own
	if (main.css('background-size') !== 'cover' && main.css('-webkit-background-size') !== 'cover' && main.css('-moz-background-size') !== 'cover' && main.css('-o-background-size') !== 'cover' && main.css('-ms-background-size') !== 'cover' && main.css('-khtml-background-size') !== 'cover') {
		var wind = $(window);
		
		// first create a new img for the background
		var img = $('<img src="' + main.css('backgroundImage').slice(5, -2) + '">').css({
			left: '0px',
			position: 'absolute',
			top: '0px',
			width: '100%',
			zIndex: -5
		});
		
		main.css({ background: 'none', position: 'relative' });
		main.append(img);
	}
});
