+'"]').parentNode;
        } catch (e) {
          try {
            link = document.body.querySelector('img[data-counter="0"]').parentNode;
          } catch (e) {
            return false;
          }
        }
        doClick(link);
      });

      overlay.addEventListener('click', function(e) {
        overlay.style.display = "none";
      })

      function keyPressed(e) {
        e = e || window.event;
        var charCode = e.keyCode || e.which;
        switch(charCode) {
          case 27: // Esc
 