// Enforce pagebody-is-taller-than-side-columns requirement  ** version 1.3.1 **

var FPHconfig = {
  "mainCol" : ["pagebody"],
  "cols"    : ["pageextra1", "pageextra2", "pageextra3", "pageextra4"]
};

function fixPagebodyHeight()
{
  if (document.layers == null)
  {
    var _mainCol = document.getElementById(FPHconfig["mainCol"]);
    var _mainColHeight = (_mainCol != null) ? _mainCol.offsetHeight : 0;

    var _isChanged = false;

    var i = FPHconfig["cols"].length - 1;
    if (i+1) { do
    {
      var _col = document.getElementById(FPHconfig["cols"][i]);
      var _colHeight = (_col != null) ? _col.offsetHeight : 0;
      if (_colHeight > _mainColHeight)
      {
        _mainColHeight = _colHeight;
        _isChanged = true;
      }
    } while (i--); }

    if (_isChanged) { _mainCol.style.height = _mainColHeight + "px"; }
    document.body.className = (document.body.className + " heightfixed").replace(/^ /, "");
  }
};




var StepPWconfig = { "step1" : 0 };

function stepPageWidth()
{
  var _bdyClass = document.body.className;
  var _bdyWidth = document.body.clientWidth;
  var _s1 = StepPWconfig["step1"];
  if (  (_bdyWidth > _s1)
     && !_bdyClass.match(/ width(\d+)/) )
  {
    document.body.className += " width1";
    if (typeof(setCookie) != "undefined") { setCookie('winWidth','width1'); }
  }
  else if (  (_bdyWidth < _s1)
          && _bdyClass.match(/ width(\d+)/) )
  {
    document.body.className = _bdyClass.replace(/ width(\d+)/, "");
    if (typeof(setCookie) != "undefined") { setCookie('winWidth',''); }
  }
};




// Obsolete function - merely left in for reasons of backwards compatibility
function disableCSSinStupidBrowsers() { return true; };



/* depends on utils_1.0.js */