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 setContentHeight() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentElement = document.getElementById('container');
			var bannerHeight = document.getElementById('banner').offsetHeight;
			var mainNavHeight = document.getElementById('mainNav').offsetHeight;
			var headerHeight = document.getElementById('header').offsetHeight;
			var specHeight = document.getElementById('specCol').offsetHeight;
			var reqHeight = (bannerHeight  + mainNavHeight + headerHeight + specHeight);

			contentElement.style.height = (reqHeight + 35) + 'px';
		}
	}
}

function setContainerHeight() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		var bodyHeight = document.body.offsetHeight;
		var contentElement = document.getElementById('container');
		
		if (bodyHeight > windowHeight)  
		{
			contentElement.style.height = bodyHeight + 'px';
		}
		else
		{
			contentElement.style.height = windowHeight + 'px';
		}
	}
}

function getScrollY() {
  var scrOfY = 0; //scrOfX = 0, 
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    //scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    //scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    //scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfY ;
}

window.onload = function() {
	setContainerHeight();
}
window.onresize = function() {
	setContainerHeight();
}
