		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setFooter() {					
					//alert(hh + " "  + bh + " "  + ch + " "  + fh);		// 116 37 ** 37
				
			if (document.getElementById) {					

				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {					
					var hh = document.getElementById('header').offsetHeight;
					var bh = document.getElementById('button_bar').offsetHeight;
					var ch = document.getElementById('content').offsetHeight;
					var fh = document.getElementById('footer').offsetHeight;
					var rh = document.getElementById('right_bar').offsetHeight;
					if (ch < rh) {
						ch = rh;
						document.getElementById('mainbdy').style.height = rh - 70 + 'px';
					}	
					//alert(windowHeight  + " " + (hh + bh + ch + fh));
					var footerElement = document.getElementById('footer');
					if (windowHeight - (hh + bh + ch + fh) >= 0) {
						
						footerElement.style.position = 'relative';
						footerElement.style.top = (windowHeight - (hh + bh + ch + fh + 2)) + 'px';  // 2 px for some reason, might be some css height stuffs
						
					}
					else {
						footerElement.style.position = 'relative';
					}
				}
			}
		}
		window.onload = function() {
			setFooter();
		}
		window.onresize = function() {
			setFooter();
		}

