/*
Project: Okinfo
Author:   A.Timofeev / Re.Active (www.reactant.ru)
Version:  2009-04-04
 */

/* Размеры окна
----------------------------------------------- */
	/* -----------[ Класс с размерами ]----------- */
		function Screen (id)
		{
			/* -[ Определяем размеры окна ]- */
				this.fullwidth = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
				this.fullheight = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
			/* -[ Определяем размеры блока ]- */
				if (id) {this.blockwidth = document.getElementById(id).clientWidth;}
				if (id) {this.blockheight = document.getElementById(id).clientHeight;}
		}
		Screen.prototype.screenset = function (id,min,max,updmin,updmax)
		{
			/* -[ Задаем размеры окна ]- */
				var newwidth = 'auto';
				if (this.fullwidth < min){newwidth = updmin+'px';}
				if (this.fullwidth > max){newwidth = updmax+'px';}
				document.getElementById(id).style.width = newwidth;
		}		
		Screen.prototype.blockset = function (id,min,max,upd)
		{
			/* -[ Задаем размеры блока ]- */
				if (this.blockheight<min){document.getElementById(id).style.height = upd+'px';}
		}
				
window.onload=function()
{
	var screen = new Screen ('Wrapper');
	screen.screenset('Wrapper', 1024,1600,960,1600);
}