function getWindowHeight() {
	if (typeof(window.innerHeight) == 'number') {
		getWindowHeight = function() { return window.innerHeight; };
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			getWindowHeight = function() { return document.documentElement.clientHeight; };
		} else if (document.body && document.body.clientHeight) {
			getWindowHeight = function() { return document.body.clientHeight; };
		} else {
			getWindowHeight = function() { return null; };
		}
	}
	return getWindowHeight();
}

function setHeight() {
	var contentRegion = document.getElementById('ContentRegion');
	var contentRegionHeight = contentRegion.clientHeight;
	var currentWindowHeight = getWindowHeight();
	
	if (contentRegionHeight < currentWindowHeight) {
		contentRegion.style.height = currentWindowHeight + 'px';
	} else {
		//contentRegion.style.height = 'auto';
	}
}

// getElementById
function getObjectById(id) {
	if (document.getElementById) getObjectById = function(id) { return (typeof(id) != 'string') ? id : document.getElementById(id); };
		else if (document.all) getObjectById = function(id) { return (typeof(id) != 'string') ? id : document.all[id]; };
		else if (document.layers) getObjectById = function(id) { return (typeof(id) != 'string') ? id : document.layers[id]; };
		else getObjectById = function(id) { throw new Error('Browser does not support \"getObjectById()\" function.') };
	return getObjectById(id);
}

function getVisibility(oElement) { 
	oElement = getObjectById(oElement);
	return (oElement.style.display != 'none') ? true : false;
}

function setVisibility(oElement, visibility) { 
	oElement = getObjectById(oElement);
	if (oElement == null) return false;
	oElement.style.display = (visibility) ? '' : 'none';
}

function toggleVisibility(id) {
	setVisibility(id, !getVisibility(id));
	return false;
}

function getInnerText(oElement) {
	oElement = getObjectById(oElement);
	return (oElement.innerText) ? oElement.innerText : oElement.textContent;
}

function setInnerText(oElement, text) {
	oElement = getObjectById(oElement);
	return (oElement.innerText) ? oElement.innerText = text : oElement.textContent = text;
}