Layout = new (function () {
	this.setBkgImage = function () {
		var res = null;
		var i = 0;
		var resolutions = [
							{ x : 600, y : 439 },
							{ x : 800, y : 585 },
							{ x : 1000, y : 732 },
							{ x : 1200, y : 878 },
							{ x : 1400, y : 1024 },
							{ x : 1600, y : 1171 },
							{ x : 1800, y : 1317 },
							{ x : 2000, y : 1463 }
						  ];
		
		for (i = 0; i < resolutions.length; i++) {
			res = resolutions [i];
			if (res.x > screen.availWidth && res.y > screen.availHeight) break;
		}
		
		if (!res) {
			res = resolutions [resolutions.length - 1];
		}
		document.body.style.backgroundImage = 'url("/layout/body.bkg.' + res.x + 'x' + res.y + '.jpg")';
	}
	
	this.init = function () {
		this.setBkgImage ();
	};
}) ();
