/* 
Detect browser height and ensure the bottom navigation always aligns to the bottom of the page.
*/
var isIE5=navigator.userAgent.toUpperCase().indexOf("MSIE 5")!=-1;
var targetElementID="contents", targetElementStyleOffset=70;
function adjustHeight() {
  if (document.getElementById) {
    var targetElement=document.getElementById(targetElementID),
		 documentHeight, totalOffset;
    if (targetElement && document.documentElement.offsetHeight
		 && targetElement.offsetHeight && targetElement.offsetTop) {
	 documentHeight=document.documentElement.offsetHeight;
	 if (targetElement.offsetHeight<documentHeight-targetElement.offsetTop) {
		 if (isIE5)
		totalOffset=targetElement.offsetTop;
		else totalOffset=targetElement.offsetTop+targetElementStyleOffset;
		 targetElement.style.height=String(documentHeight-totalOffset)+'px';
	 }
    }
  }
}