﻿function CheckSize() {
  window.document.getElementById("scroll").style.height = "";

  if (window.document.getElementById("rightcontent")) {
    window.document.getElementById("rightcontent").style.height = "";
  }
  // var realScreenHeight = window.document.body.offsetHeight;

  if (window.innerHeight) {
    var availableScreenHeight = window.innerHeight;
  } else {
    var availableScreenHeight = window.document.documentElement.clientHeight;
  }
  var divScreenHeight = availableScreenHeight - 577;
  var scrollHeight = window.document.getElementById("scroll").offsetHeight;
  //var browserName = navigator.appName;
  //var browserVersion = parseInt(navigator.appVersion);
  //var browserDetail = browserName.concat(browserVersion);

/*
  while (document.getElementById("scrollholder").lastChild.className != "scroll") {
    var unnuetz = document.getElementById("scrollholder").lastChild;
    document.getElementById("scrollholder").removeChild(unnuetz);
  }
*/    

  if (divScreenHeight > 0) {
    window.document.getElementById("scrollholder").style.height = 435 + divScreenHeight + "px";
    window.document.getElementById("bannerflex").style.height = 31 + divScreenHeight + "px";
  } else {
    window.document.getElementById("scrollholder").style.height = "435px";
    window.document.getElementById("bannerflex").style.height = "31px";
  }
        
  var scrollholderHeight = window.document.getElementById("scrollholder").offsetHeight;


  if (document.getElementById("rightcontent")) {
    window.document.getElementById("rightcontent").style.height = scrollHeight - 130 + "px";
  }

  if (scrollholderHeight >= scrollHeight) {
    window.document.getElementById("scroll").style.height = scrollholderHeight + "px";

    if (document.getElementById("rightcontent")) {
      window.document.getElementById("rightcontent").style.height = scrollholderHeight - 130 + "px";
    }
  }
    
  /* ScrollLoad("scrollholder", "scroll", "1", true);
    
  if (document.getElementById("scrollholder").lastChild.className == "track") {
    document.getElementById("scrollholder").lastChild.style.height = scrollholderHeight - 2 + "px";
  }
  */
}
