var inth1 = 35;
function ieDialog() {
  alert('Hello World!');
}
function winOnLoad() {
  var ele = xGetElementById('scContent');
  if (ele && xDef(ele.style, ele.offsetHeight)) { // another compatibility check
    inth1 = xHeight('scContent')+15;
    adjustLayout();
    xAddEventListener(window, 'resize', winOnResize, false);
  }
}
function winOnResize() {
  adjustLayout();
}
function adjustLayout() {
 var h1 = xHeight('scContent')+15;
 if (h1 > inth1) h1 = inth1;
 var h11 = xHeight('navSub');
 var h12 = xHeight('scToolBox');
 var h2 = xClientHeight()-127;
 //alert(h1 + ' ' + h11 + ' ' + h12 +  ' ' + h2 );
 if ( (h1>h11 || h1>h12) && (h2<h11 || h2<h12)  ) {
  //avoid double scrolling
  xHeight('navSub',h1);
 } else {
  var maxHeight = Math.max( Math.max(h1, Math.max(h11,h12)), h2);
  //var maxHeight = Math.min( h1, h2);
  xHeight('scContent',maxHeight-15);
  xHeight('navSub',maxHeight);
 }
}

