  var winWidth = 0; 
  var winHeight = 0;
  var currentWidth = -1;
  var currentHeight = -1;
  function getSize(spacingId, navId, contentId) {
    modWinHeight = currentHeight;    
    modWinHeight -= document.getElementById(spacingId).clientHeight;
    navHeight = document.getElementById(navId).offsetHeight-99980;
   // alert(document.getElementById(navId).offsetHeight)
    
    contentHeight = document.getElementById(contentId).offsetHeight-99980;
    return Math.max(Math.max(modWinHeight,contentHeight), navHeight);
  }
  
  function checkWidthHeight()
  {
    if( typeof( window.innerWidth ) == 'number' ) {
      winWidth = window.innerWidth;
      winHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      winWidth = document.documentElement.clientWidth;   
      winHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      winWidth = document.body.clientWidth;
      winHeight = document.body.clientHeight;
    }   
    
    if (winWidth == currentWidth && winHeight == currentHeight)
      return false;
    else
      currentWidth = winWidth;
      currentHeight = winHeight;
      return true;
  }
  
  function SetContainerSize(containerId, spacerId, navId, contentId)
  {
    obj = document.getElementById(containerId);
    needsUpdate = checkWidthHeight();
    maxSize = getSize(spacerId, navId, contentId);
    if (needsUpdate || (obj.clientHeight < maxSize ))
    {
      obj.style.height = maxSize + "px";
    }
   setTimeout("SetContainerSize(\"" + containerId + "\",\"" + spacerId + "\",\"" + navId + "\",\"" + contentId + "\")", 1000);
  }

