function winHeight() {
  if (window.innerHeight) return window.innerHeight;
  else if (document.documentElement && document.documentElement.clientHeight)
	return document.documentElement.clientHeight;
  else if (document.body && document.body.clientHeight)
	return document.body.clientHeight;
  else return 0;
}

function setFooter() {
  if (document.getElementById) {
	var windowHeight = winHeight();
	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 = 'absolute';
		footerElement.style.top = (windowHeight - footerHeight) + 'px';
		document.getElementById("menubg").style.height=footerElement.style.top;
	  } else {
		footerElement.style.position = 'static';
		document.getElementById("menubg").style.height="0px";
	  }
	}
  }
}


