<script type="text/javascript">
  function showImage(nazwa)
  {
    var str = "status=no,location=no,menubar=no,toolbar=no,";
    str += "directories=no,scrollbars=no,resizable=no";
    var wnd = open(nazwa, "", "width=1,height=1"+str);
    var img = new Image();
    img.onload = function(){
      if(wnd.innerWidth && wnd.innerHeight){
        wnd.innerWidth = img.width + 20;
        wnd.innerHeight = img.height + 20;
      }
      else
        wnd.resizeTo(img.width - 10, img.height);
    }
    img.src = nazwa;
  }
</script>
