function getClientHeight(){
 var h="0";
 if (document.documentElement && document.documentElement.clientHeight)
  h = document.documentElement.clientHeight;
 else if (document.body && document.body.clientHeight)
  h = document.body.clientHeight;
 else
  h = window.innerHeight;
 return h;
}

function getDocumentHeight(){
 var h="0";

 if (document.body && document.body.offsetHeight)
  h = document.body.offsetHeight;
 if (document.body && document.body.scrollHeight && document.body.scrollHeight>h)
  h = document.body.scrollHeight;
 if (window.scrollMaxY && (window.innerHeight + window.scrollMaxY)>h)
  h = (window.innerHeight + window.scrollMaxY);

 return h;
}

function getClientWidth(){
 var w="0";
 if (document.documentElement && document.documentElement.clientWidth)
  w = document.documentElement.clientWidth;
 else if (document.body && document.body.clientWidth)
  w = document.body.clientWidth;
 else
  w = window.innerWidth;
 return w;
}

function getDocumentWidth(){
 var w="0";

 if (document.body && document.body.offsetWidth)
  w = document.body.offsetWidth;
 if (document.body && document.body.scrollWidth && document.body.scrollWidth>w)
  w = document.body.scrollWidth;
 if (window.scrollMaxX && (window.innerWidth + window.scrollMaxX)>w)
  w = (window.innerWidth + window.scrollMaxX);

 return w;
}

function showPopup(){
  document.getElementById('bg').style.width= parseInt(getDocumentWidth())+'px';
  document.getElementById('bg').style.height= parseInt(getDocumentHeight())+'px';
  document.getElementById('bg').style.display= '';
  document.getElementById('content').style.display= '';
}
function hidePopup(){
  document.getElementById('bg').style.display= 'none';
  document.getElementById('content').style.display= 'none';
}

function keyPressHandler(e) {
  if (!e) e=window.event; // für MSIE
  if (e.keyCode==27) {
    hidePopup();
  }
}
document.onkeydown=keyPressHandler;

