	function correctHeight() {
		



		if (self.innerHeight) {
                    var oslik = false;
			x = self.innerWidth;
			y = self.innerHeight;

			} else if (document.documentElement && document.documentElement.clientHeight) {
				x = document.documentElement.clientWidth;
				y = document.documentElement.clientHeight;
                                oslik = true;

			} else if (document.body) {
				x = document.body.clientWidth;
				y = document.body.clientHeight;

			}

			var height_pre = document.getElementById('body').offsetHeight;
                        var height_pre2 = document.getElementById('main').offsetHeight;
                   //     alert(height_pre + '- '+height_pre2 + ' - ' +y);
                        if(y > height_pre) {
                           if(oslik) document.getElementById('main').style.height = height_pre2 +  y - height_pre - 200 + 'px';
                           else document.getElementById('main').style.height = height_pre2 +  y - height_pre - 165 + 'px';
                        }
        }

	var root = window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null;

	if (root){
		if (root.addEventListener) root.addEventListener("load", correctHeight, false);
		else if (root.attachEvent) root.attachEvent("onload", correctHeight);
	}

	window.onresize = correctHeight;
	
