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;
};

window.onload = setDiv;
window.onresize = setDiv;

function setDiv() {
  var windowHeight = getWindowHeight(); // Window Height
  var div1 = document.getElementById('box') // Get div1 element
  var div2 = document.getElementById('content') // Get div2 element
  var div1Height = div1.offsetHeight // div height
  var div2Height = div2.offsetHeight // div height
  div1.style.height = (windowHeight-255) + 'px'; // Set div1 height to window height
  div2.style.height = (windowHeight-255) + 'px'; // Set div2 height to window height
}
