function getOverlay() {
  var overlay = document.getElementById('overlay');
  
  if (!overlay) {
    overlay = document.createElement('div');
    overlay.id = 'overlay';
    overlay.style.display = 'none';
    
    overlay.hide = function() {
      this.style.display = 'none';
      this.style.zIndex = '-1';
    }
    overlay.show = function() {
      this.style.display = 'block';
      this.style.zIndex = '10000';
    }
    
    overlayCloser = document.createElement('div');
    overlayCloser.id = 'overlayCloser';
    overlayCloser.onclick = function() {
      this.parentNode.hide();
    }
    overlay.appendChild(overlayCloser);
    
    document.body.appendChild(overlay);
  }
  
  return overlay;
};