<script type="text/javascript">
  function btnWejdźClick()
  {
    var kod = document.getElementById("tfKod").value;
    if(!kod) return;
    kod = SHA1(kod);

    var ajaxObj = window.XMLHttpRequest ? new XMLHttpRequest() :
                  new ActiveXObject("Microsoft.XMLHTTP");
    if(ajaxObj){
      ajaxObj.open("HEAD", kod + ".html", false);
      ajaxObj.send(null);
      if(ajaxObj.status == 200){
        document.location.href = kod + '.html';
      }
      else{
        alert('Nieprawidłowy kod!');
      }
    }
  }
</script>