function windowHeight() {
  // Standard browsers (Mozilla, Safari, etc.)
  if (self.innerHeight)
    return self.innerHeight;
  // IE 6
  if (document.documentElement && document.documentElement.clientHeight)
    return document.documentElement.clientHeight;
  // IE 5
  if (document.body)
    return document.body.clientHeight;
  // Just in case.
  return 0;
}

function handleResize() {
  var height = windowHeight() - $('toolbar').offsetHeight - 30;
  $('map').style.height = height + 'px';
  $('sidebar').style.height = height + 'px';
}
