/*
function barSet() {
  // Set up the browser width and height
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
// This sets the height of the nav bar to the bottom of the browser
	myHeight = myHeight - 13;

	document.getElementById("bar_bottom").style.position="absolute";
	document.getElementById("bar_bottom").style.left= 0;
	document.getElementById("bar_bottom").style.top= myHeight;
	document.getElementById("bar_bottom").style.visibility="visible";
	document.getElementById("bar_bottom").style.backgroundColor="#FE000C";

// This sets the width of the menu table to the app width
	if (myWidth <=744) {
		document.getElementById("masterTable").width = 744;
	} else if ((myWidth >744) && (myWidth <= 850)) {
		document.getElementById("masterTable").width = myWidth;
	} else {
		document.getElementById("masterTable").width = 850;
	}
	if (myHeight < 438) {
		document.getElementById("backgroundcell").height = 115;
		document.getElementById("backgroundcell").style.backgroundColor="#FE000C";
	} else {
		var backCellHeight = myHeight - 325;
		// added 45 px to compensate for top margin above navigation
		//alert(backCellHeight);
		document.getElementById("backgroundcell").height = backCellHeight;
	}
}
*/
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 contentHeight = document.getElementById('content').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}