function browserSize() {
  var tmpObj = new Object(); 
  if( typeof( window.innerWidth ) == 'number' ) {
    //geen IE
    tmpObj.myWidth = window.innerWidth;
    tmpObj.myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ 
    tmpObj.myWidth = document.documentElement.clientWidth;
    tmpObj.myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 
    tmpObj.myWidth = document.body.clientWidth;
    tmpObj.myHeight = document.body.clientHeight;

  }
  return tmpObj;	
}

function setTDHeight() {
    tmpObj = browserSize();
    var tdHeight = tmpObj.myHeight - 395;
    if (tmpObj.myHeight < 395 ) return false; 
	document.getElementById("maintable").height = tdHeight; 
}

function setTable(){
    tmpObj = browserSize();
	if (tmpObj.myHeight > 1 ){ 
      setTDHeight();
	}
}