Layout = new (function () {
	var sizes = [
		{w:2000, h:1167},
		{w:1800, h:1050},
		{w:1600, h:933},
		{w:1400, h:817},
		{w:1200, h:700},
		{w:1000, h:583},
		{w:800, h:467}
	];
	
	this.selectBkg = function () {
		var w = screen.width;
		var h = screen.height;
		
		for (i = 0; i < sizes.length; i++) {
			if (sizes [i].w >= w && sizes [i].h >= h) {
				document.body.style.backgroundImage = 'url("img/layout/html.bkg.' + sizes [i].w + '.jpg")';
			}
		}
	};
	
	this.fix = function () {
		var w = 0;
		var h = 0;
		var i = 0;
		var imgWidth = 2000;
		var imgHeight = 1167;
		
		if (window.innerWidth) {
			w = window.innerWidth;
			h = window.innerHeight;
		} else if (document.documentElement && document.documentElement.clientWidth) {
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		} else {
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
		
		document.getElementById ('Decoration').className = (w < 1220 ? 'shortDecoration' : 'longDecoration');

		this.selectBkg ();
	};
}) ();
