function ini_bg() {
	var theWindow = $(window);
	function resizeBg() {
		// account for scroll bars
		var docW = theWindow.width();
		var docH = theWindow.height();
		/*
		var newW = (theWindow.width() < 950) ? "950px" : "100%";
		var newH = getDocHeight();
		$("#bg_container").css("width",newW);
		$("#bg_container").css("height",newH+"px");
		*/
		// set width or height class
		if ( (docW / docH) < aspectRatio ) {
			$("#bg")
				.removeClass()
				.addClass('bgheight');
		} else {
			$("#bg")
				.removeClass()
				.addClass('bgwidth');
		}
	}
	theWindow.resize(function() { resizeBg(); }).trigger("resize");		
	
}
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}
