if (typeof( window.innerWidth ) == 'number') {
  //Non-IE
  function getBrowserHeight() {
    return window.innerHeight;
  }
} else if (document.documentElement && document.documentElement.clientHeight) {
  //IE 6+ in 'standards compliant mode'
  function getBrowserHeight() {
    return document.documentElement.clientHeight;
  }
} else if (document.body && document.body.clientHeight) {
  //IE 4 compatible
  function getBrowserHeight() {
    return document.body.clientHeight;
  }
}

function fixheight(e) {
  diff = getBrowserHeight() - document.height;
  huser = document.getElementById('huser');
  if (huser) {
    h = huser.clientHeight + diff;
    if (h > 200) {
      huser.setAttribute("style", "height: "+ h+"px;");
    } else {
      huser.setAttribute("style", "height: auto;");
    }
  } else {
    huser = document.getElementById('trailer');
    if (huser) {
      huser.setAttribute("style", "margin-top: 20px");
      diff = getBrowserHeight() - document.height;
      if (diff > 0) {
	huser.setAttribute("style", "margin-top: " + (diff+20) + "px");
      }
    }
  }
}

window.onload = fixheight;
window.onresize = fixheight;
