function winH(){
  if(window.innerHeight)return window.innerHeight;
  else if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;
  else if(document.body&&document.body.clientHeight)return document.body.clientHeight;
  else return null;
};

//returns computed height of element
function getH(el){
  var pupik;
  if (document.all)pupik=document.all.item(el).offsetHeight;
  else if(document.getElementById){
    obj=document.getElementById(el);
    pupik=document.defaultView.getComputedStyle(obj,"").getPropertyValue("height");
    pupik=pupik.substring(0,pupik.length-2);
  };
  return pupik;
};

function ini(){
if(getH("middle")<=(winH()-230))document.getElementById("middle").style.height=parseInt(winH()-230)+"px";
};