var WindowWidth  = 0;
var WindowHeight = 0;



function GetWindowSize() {
  if (getInternetExplorerVersion() > -1) {
    WindowWidth  = document.body.clientWidth * 1;
    WindowHeight = document.body.clientHeight * 1;
  } else {
    WindowWidth  = window.innerWidth * 1;
    WindowHeight = window.innerHeight * 1;
  }
}



function RenderPage() {
  document.getElementById('Header_Display').style.display      = 'block';
  document.getElementById('PageContent_Display').style.display = 'block';
  if (getInternetExplorerVersion() > -1) {document.getElementById('IEWarning_Display').style.display = 'block';}
}



function ResizePageContent() {

  GetWindowSize();

  var ObjDisplay = document.getElementById('PageContent_Display');
  var ObjFrame   = document.getElementById('PageContent_Frame');

  var TempHeight = WindowHeight - 175;
  if (TempHeight < 50) {TempHeight = 50;}
  ObjFrame.style.height = TempHeight + 'px';

  var TempLeft = (WindowWidth - (ObjDisplay.clientWidth * 1)) / 2;
  if (TempLeft < 0) {TempLeft = 0;}
  ObjDisplay.style.left = TempLeft + 'px';

  if (getInternetExplorerVersion() == -1) {
    ObjDisplay = document.getElementById('Header_Inner_Display');
    TempLeft = (WindowWidth - (ObjDisplay.clientWidth * 1)) / 2;
    if (TempLeft < 0) {TempLeft = 0;}
    ObjDisplay.style.left = TempLeft + 'px';
  }

}



function getInternetExplorerVersion() {
  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);
}

