window.onload = function () {
	checkWidth();
	resizeColumns();
}
window.onresize = function () {
	checkWidth();
}

function resizeColumns() {
	var contentHeight;
	var sidebarAdjust = 138;
	var x='0';

	if (document.getElementById("news").style.display == 'block') {
		// Set heights on news and sidebar divs
		while (x == 0 || (document.getElementById("news").clientHeight + 60) < document.getElementById("content").scrollHeight) {
			contentHeight = document.getElementById("content").scrollHeight;
			document.getElementById("news").style.height = (contentHeight - 40) + "px";
			x++;
			if (x > 3) {
				break;
			}
		}
	}
	contentHeight = document.getElementById("content").scrollHeight;
	var sidebarHeight = (contentHeight + sidebarAdjust);
	document.getElementById("sidebar").style.height = (sidebarHeight) + "px";
}


function checkWidth() {
	var documentWidth = document.width ? document.width : document.documentElement.offsetWidth - 25;
	if (documentWidth > 850) {
		//document.getElementById("panImage").style.width = "346px";
		document.getElementById("news").style.display = 'block';
	} else {
		document.getElementById("news").style.display = 'none';
	}
}