

window.onload = window.onresize = function checkScreenSize() {
  var htmlElement = document.getElementsByTagName('html')[0]
  htmlElement.style.overflow='auto';
  var pageDiv = document.getElementById('page');
  pageDiv.style.margin='0';
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  var wrapperDiv = document.getElementById('wrapper');
  if (myWidth < 999) {
        wrapperDiv.style.width='1000px';
  } else {
        wrapperDiv.style.width='100%';
  }

  if (myHeight < 500) {
        wrapperDiv.style.height='501px';
  } else {
        wrapperDiv.style.height='100%';
  }
};

window.onresize = function checkScreenSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  var wrapperDiv = document.getElementById('wrapper');
  if (myWidth < 999) {
        wrapperDiv.style.width='1000px';
  } else {
        wrapperDiv.style.width='100%';
  }

  if (myHeight < 500) {
        wrapperDiv.style.height='501px';
  } else {
        wrapperDiv.style.height='100%';
  }
};

