attachEventListener(window, "resize", checkBrowserWidth, false);

function checkBrowserWidth() {
	var theWidth = getBrowserWidth();
	var bodyTag = $$('body'); // Fixes IE6
 	var bodyTag = document.getElementsByTagName("body")[0];
	if (theWidth > 970) {
		bodyTag.removeClassName('narrow');
		bodyTag.addClassName('wide');
	}
	else {
		bodyTag.removeClassName('wide');
		bodyTag.addClassName('narrow');
	}
	return true;
}

function getBrowserWidth() {
	if (window.innerWidth) {
		return window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth != 0) {
		return document.documentElement.clientWidth;
	}
	else if (document.body) {
		return document.body.clientWidth;
	}
	return 0;
}
