
function switchStyle(sId,sStyle,sItemOne,sItemTwo)
{
	if (document.getElementById(sId).style[sStyle]==sItemTwo) {
		document.getElementById(sId).style[sStyle] = sItemOne;
	} else {
		document.getElementById(sId).style[sStyle] = sItemTwo;
	}
}


// FOOTER

var containerHeight = 0;
function getHeight() { 
	containerHeight = document.getElementById('container').offsetHeight;
	return containerHeight;
}
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 setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			//var footerTopMargin = 0;
			var contentHeight = document.getElementById('container').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			var sideBarHeight = document.getElementById('leftSidebar').offsetHeight + document.getElementById('header').offsetHeight + document.getElementById('crumbTrail').offsetHeight + footerHeight;
			
			if (contentHeight>windowHeight && windowHeight<containerHeight) {
				sHeight = containerHeight+20;
			}
			else {
				sHeight = windowHeight;
			}
			
			if (sHeight<sideBarHeight)
				sHeight = sideBarHeight;

			//alert("contentHeight: "+contentHeight+"\nwindowsHeight: "+windowHeight+"\ncontainerHeight: "+containerHeight+"\nsideBarHeight: "+sideBarHeight+"\nGoing to set to: "+sHeight);
			
			document.getElementById('container').style.height = (sHeight - 2) + 'px';

			//footerElement.style.top = ((sHeight - footerHeight)+footerTopMargin) + 'px';

			footerElement.style.top = ((sHeight - footerHeight)) + 'px';
		}
	}
}
window.onload = function () { getHeight(); setFooter(); };
window.onresize = setFooter;