// JavaScript Document

function changeLanguage(newLocation)
{
  if(document.FCKForm.chbxEnglishVersion.checked)
    window.location.replace(newLocation+"?chbxChecked=true");
  else
    window.location.replace(newLocation+"?chbxChecked=false");  
}

window.onload=function()
{
  var $browserHeight = 0;
  if(document.innerHeight)
    $browserHeight = document.innerHeight;
  else 
  if(document.documentElement.clientHeight)
    $browserHeight = document.documentElement.clientHeight;
  else 
  if(document.body)
    $browserHeight = document.body.clientHeight; 

  var $textBody = document.getElementById('flexibleBody');
  
  if(getCurrentHeight(document.getElementById('flexibleBody')) < 240)
    $textBody.style.height = ($browserHeight - 377)+"px";
}

function getCurrentHeight($element)
{
  var ee;

  try
  {
    var $cs = document.defaultView.getComputedStyle($element, '');
    $val = style2px($cs.getPropertyValue("height"));
  }
  catch(ee)
  {
    $val=($element.offsetHeight);
    if($val < 0)
      $val = 0;
  }
  return $val;
}
