getAbsolutePosition = function(elm)
{
  var resultX = 0;
  var resultY = 0;
  
  do
  {
    resultX += elm.offsetLeft;
    resultY += elm.offsetTop;
  }
  while (elm = elm.offsetParent);
  
  return { x : resultX, y : resultY };
}

// Browser independent scroll vertical offset in pixels
scrollY = function()
{
    try
    {
        if (typeof(window.pageYOffset) == 'undefined')
            throw sigh;
        else
            var o = window.pageYOffset;
    }
    catch(sigh)
    {
        var o = document.body.scrollTop | document.documentElement.scrollTop;
    }
    
    return o;
}
/*
function ShowCmsEditor() {
    var divCmsEditor = document.getElementById('CmsEditor');
    var divAlpha = document.getElementById('AlphaBox');
    divAlpha.style.height = document.body.clientHeight;

    divCmsEditor.style.display = 'block';
    divAlpha.style.display = 'block';
    
    // Not used anymore, the edit screen has a fixed top
    //var top = getAbsolutePosition(divCmsEditor).y;
    //var offset = scrollY();
    
    divCmsEditor.style.top = 113 + 'px';
}

function CloseCmsEditor(object) {
    var divCmsEditor = document.getElementById('CmsEditor');
    var divAlpha = document.getElementById('AlphaBox');
    
    divCmsEditor.style.display = 'none';
    divCmsEditor.style.top = '50%';
    divAlpha.style.display = 'none';
}
*/
