
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 setScroll() {
	// get elements
	var containerElement = $('container')
	var scrollElement = $('scroll')
	// get container dimensions (using prototype function)
	var containerDim = containerElement.getDimensions()
	// get windowheight
	var windowHeight = getWindowHeight()
	// set container height to at least fit window
	if (containerDim['height'] < windowHeight) {
		containerElement.style.height = windowHeight + 'px'
	}
	// set scroll height
	scrollElement.style.height = (windowHeight - 220) + 'px'	
}

function resizeHomePage() {
	// get elements
	var containerElement = $('container')
	var mainElement = $('main2')
	// get container dimensions (using prototype function)
	var containerDim = containerElement.getDimensions()
	// get windowheight
	var windowHeight = getWindowHeight()
	// set container height to at least fit window
	if (windowHeight < 575) {
		containerElement.style.height = '575px'
		mainElement.style.height = '277px' // containerelm - 298 (height of header)
	}
	else if (containerDim['height'] != windowHeight) {
		containerElement.style.height = windowHeight + 'px'
		mainElement.style.height = (windowHeight - 298) + 'px'
	}
}

	
