// Function to fit screen size.
function fitScreen(){
	if (document.getElementById){
		
		// Get window dimensions.
		// Test for which property is supported by browser.
		if (window.innerHeight){
			windowHeight = window.innerHeight;
			windowWidth = window.innerWidth;
		} else if (document.body.offsetHeight){
			windowHeight = document.body.offsetHeight;
			windowWidth = document.body.offsetWidth;
		} else if (document.body.clientHeight){
			windowHeight = document.body.clientHeight;
			windowWidth = document.body.clientWidth;
		} else if (document.documentElement) {
			windowHeight = document.documentElement.clientHeight;
			windowWidth = document.documentElement.clientWidth;
		} else {
			return false;
		}
		
		// Get page elements.
		pageObj = document.getElementById("pageShadowLeft");
		contentObj = document.getElementById("pageContent");
		
		if (document.location.href.indexOf("faq.asp")>0){
			// FAQ specific size adjustment.
			ulObj 						= pageObj.getElementsByTagName("ul")[0];
			ulScroll					= ulObj.scrollHeight;
			contentObj.style.height 	= "1px";
		} else {
			ulScroll					= 0;
		}
		if (ulScroll + 281 > contentObj.scrollHeight && ulScroll + 281 > windowHeight){
			// When FAQ content extends beyond window bottom.
			newHeight 					= ulScroll + 281;
		} else if (contentObj.scrollHeight > ulScroll + 281 && contentObj.scrollHeight > windowHeight){
			// When content extends beyond window bottom.
			newHeight 					= contentObj.scrollHeight;
		} else {
			// When content does not extend beyond window bottom.
			newHeight 					= windowHeight;
		}
		
		// Adjust page height.
		pageObj.style.height 			= newHeight + "px";
		contentObj.style.height 		= newHeight - 131 + "px";
		
		return true;
	} else {
		return false;
	}
}
onresize = fitScreen;
