/* Content block height altering */

var headerHeight = 163;
var footerHeight = 61; 

function getHeight() {
	var myHeight = 0;

	if (typeof(window.innerWidth) == 'number') {
		myHeight = window.innerHeight;
	} else {
		if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			myHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
				myHeight = document.body.clientHeight;
			}
		}
	}
	return myHeight;
}

function resizeContent() {
	var pseudoImage = new Image();
	var windowHeight = getHeight();

	if (windowHeight > 0) {
		newHeight = windowHeight - headerHeight - footerHeight;
		document.getElementById('contentMenu').style.height = newHeight + 'px';
		document.getElementById('contentArea').style.height = newHeight + 'px';
	}
}

function restoreScroll(elementName) {
	var cookieMatch = document.cookie.match(new RegExp(elementName + 'Scroll=!~([0-9]*)~!'));
	if (cookieMatch != null) {
		document.getElementById(elementName).scrollTop = cookieMatch[1];
	}
}

function storeScroll(elementName) {
	document.cookie = elementName + 'Scroll=!~' + document.getElementById(elementName).scrollTop + '~!';
}
