var overWork;

function ShowWorkspace() {
  var o = document.getElementById('Workspace');
  if (o != null) {
    document.getElementById('WorkspaceIcon').src = '/img/www_sap_com_global/YourWorkspaceIconOver.gif';
    o.style.top = (parseInt(GetPosition(document
        .getElementById('WorkspaceLink'), 'top')) + 26) + 'px';
    o.style.left = (parseInt(GetPosition(document
        .getElementById('WorkspaceLink'), 'left')) - 12) + 'px';
    o.style.display = 'inline';
    setTimeout('HideWorkspace()', 2000);
  }
}

function ActivateWorkspace() {
  overWork = true;
}

function BeginHideWorkspace() {
  overWork = false;
  setTimeout('HideWorkspace()', 1000);
}

function HideWorkspace() {
  if (!overWork) {
    document.getElementById('Workspace').style.display = 'none';
    document.getElementById('WorkspaceIcon').src = '/img/www_sap_com_global/YourWorkspaceIcon.gif';
  }
}

function GetPosition(object, offset) {
  var totaloffset = ((offset == 'top') ? object.offsetTop : object.offsetLeft);
  var parent = object.offsetParent;
  if (parent != null)
    totaloffset += GetPosition(parent, offset);

  return totaloffset;
}

