sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


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();
	var contentHeight=document.getElementById('contents').offsetHeight+105;
	var naviHeight=document.getElementById('naviheight').offsetHeight+162;
	var masterDiv=document.getElementById('masterdiv');
	if (contentHeight > naviHeight) {
		if(windowHeight < contentHeight) {
			masterDiv.style.height = contentHeight+'px';
		} else {
			masterDiv.style.height = '100%';
		}
	} 
	if (contentHeight < naviHeight) {
		if(windowHeight < naviHeight) {
			masterDiv.style.height = naviHeight+'px';
		} else {
			masterDiv.style.height = '100%';
		}
	}
  }
}
