function Dimensions(width, height) {
	this.width = width;
	this.height = height;
}

function getWindowDimensions() {
	if (window.innerWidth) {
		return new Dimensions(window.innerWidth, window.innerHeight);
	} else if (document.documentElement && document.documentElement.clientWidth) {
		return new Dimensions(document.documentElement.clientWidth, document.documentElement.clientHeight);
	} else if (document.body) {
		return new Dimensions(document.body.clientWidth, document.body.clientHeight);
	}
	return 0;
}

function updateBorders() {
	var windowDimensions = getWindowDimensions();
	var bodyClassName = (windowDimensions.width > 718) ? "scriptenabled withborder" : "scriptenabled";
	var height = Math.max(windowDimensions.height, document.getElementById("mainContainer").offsetHeight);
	document.body.style.height = "" + height + "px";
	document.body.className = bodyClassName;
	resizeTimer = null;
}



(function() {
	var originalOnload = window.onload;
	window.onload = function() {
		if (originalOnload) {
			originalOnload();
		}
		updateBorders();
		/*if(addScrollers){
			addScrollers();
		}*/
	}
})();

var resizeTimer = null;
window.onresize = function() {
	if (resizeTimer != null) {
		clearTimeout(resizeTimer);
	}
	resizeTimer = setTimeout(updateBorders, 200);
};