var xWidth = 0;
var xHeight = 0;
var minHeight = 400;
var subHeight = 183 + 30;

function iev() {
  var rv = -1;
  if (navigator.appName == 'Microsoft Internet Explorer') {
    var ua = navigator.userAgent;
    var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null) {
      rv = parseFloat( RegExp.$1 );
    }
  }
  return rv;
}

var ver = iev();
if ( ver > -1 && ver >= 6.0 ) {
  var subHeight = 188 + 30;
}

function getClientSize(){
  if( typeof( window.innerWidth ) == 'number' ) {
    xWidth = window.innerWidth;
    xHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    xWidth = document.documentElement.clientWidth;
    xHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    xWidth = document.body.clientWidth;
    xHeight = document.body.clientHeight;
  }
  if ((xHeight - subHeight) < minHeight) {
    xHeight = minHeight;
  } else {
    xHeight = (xHeight - subHeight);
  }
}

function resizeIframe(){
  getClientSize();
  document.getElementById("sub").height= xHeight;
  document.getElementById("menu").style.height= xHeight;
  document.getElementById("page").style.height= xHeight;
  document.getElementById("container").style.height= xHeight;
}

function initPage(){
  resizeIframe();
  window.onresize = resizeIframe;
}