function resize()
{

  var theWidth, theHeight;
  // Window dimensions:
  if (window.innerWidth) {
  theWidth=window.innerWidth;
  }
  else if (document.documentElement && document.documentElement.clientWidth) {
  theWidth=document.documentElement.clientWidth;
  }
  else if (document.body) {
  theWidth=document.body.clientWidth;
  }
  if (window.innerHeight) {
  theHeight=window.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight) {
  theHeight=document.documentElement.clientHeight;
  }
  else if (document.body) {
  theHeight=document.body.clientHeight;
  }

  var e = document.getElementById("main");
  e.offsetHeight;

  if(document.getElementById('scroll'))
  {
    if(e.offsetHeight > theHeight-135)
    document.getElementById('scroll').style.height=theHeight-135 + 'px';
   
    if(e.offsetHeight < theHeight-135)
    {
      document.getElementById('scroll').style.overflowY='auto';
      document.getElementById('scroll').style.height=e.offsetHeight + 'px';
    }
  }
}
