function krSetWidthHeight() {
	var bSidebar, nContentMax, nContentOffcer, newHeight;
	bSidebar = $('#SIDEBAR').length;
	nContentMax = (bSidebar) ? 670 : 850;
	nContentOffset = (bSidebar) ? 250 : 30; 
	$("#CONTENT").width(Math.min($(document).width() - nContentOffset, nContentMax));
	$("#FOOTER").width(Math.min($(document).width() - 30, 850));
	if (arguments.length > 0) {
		newHeight = arguments[0];
	} else {
		newHeight = Math.max($("#CONTENT").height(), $("#SIDEBAR").height(), 600);
	}
	$("#CONTENT").height(newHeight);
	if (bSidebar) {
		$("#SIDEBAR").height(newHeight);
	}
}

$(document).ready(function() {
	krSetWidthHeight()
});
$(window).resize(function() {
	krSetWidthHeight()
});


