	function getWindowWidth() {
		var windowWidth = 0;
		if (typeof(window.innerWidth) == 'number') {
			windowWidth = window.innerWidth;
		}
		else {
			if (document.documentElement && document.documentElement.clientWidth) {
				windowWidth = document.documentElement.clientWidth;
			}
			else {
				if (document.body && document.body.clientWidth) {
					windowWidth = document.body.clientWidth;
				}
			}
		}

		return windowWidth;
	}

var s = getWindowWidth();
		// if width larger than 1270 then show fourth column
		// check if cookie is set, otherwise, reload page.

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

if (s>1270) {
	//high res

	var c = readCookie('screen');
			if (c==null) {
			//cookie not set, set it
			var date = new Date();
			date.setTime(date.getTime()+(7*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
			document.cookie = "screen="+s+expires+"; path=/";
			//and reload page
			window.location.reload();
		} 

} else {
		//Low res erase cookie
			var date = new Date();
			date.setTime(date.getTime()+(-1*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
			document.cookie = "screen="+s+expires+"; path=/";

}