function poupUp_height()
{
	var _lightbox = document.getElementById("popup");
	var _popup_table = document.getElementById("fader");
	var _height = 0;
	var _width = 0;
	var _minWidth = 1002;
	
	if (window.innerHeight) {
		_height = window.innerHeight;
		_width = window.innerWidth;
	} else {
		_height = document.documentElement.clientHeight;
		_width = document.documentElement.clientWidth;
	}
	var _page = document.getElementById("container-holder");
	if (_lightbox && _popup_table && _page) {
		if (_height >= _page.offsetHeight) _popup_table.style.height = _height + "px";
		else _popup_table.style.height = _page.offsetHeight + "px";
		
		if (_width < _minWidth) {_popup_table.style.width = _minWidth + "px";} else {_popup_table.style.width = '100%'}
		
		if (_height > _lightbox.offsetHeight) {
			if (!window.innerHeight) {
				_lightbox.style.position = "absolute";
				_lightbox.style.top = document.documentElement.scrollTop + (_height - _lightbox.offsetHeight) / 2 + "px"
			} else {
				_lightbox.style.position = "fixed";
				_lightbox.style.top = (_height - _lightbox.offsetHeight) / 2 + "px";
			}
		}
		else {
			_lightbox.style.top = "0px";
			_lightbox.style.position = "absolute";
		}
		if (_width > _lightbox.offsetWidth) _lightbox.style.left = (_width - _lightbox.offsetWidth) / 2 + "px";
		else {_lightbox.style.left = "0px";_lightbox.style.position = "absolute";}
	}
}


if (window.addEventListener){
	window.addEventListener("resize", poupUp_height, false);
	window.addEventListener("load", poupUp_height, false);
}
else if (window.attachEvent){
	window.attachEvent("onresize", poupUp_height);
	window.attachEvent("onload", poupUp_height);
	window.attachEvent("onscroll", poupUp_height);
}