function powieksz(plikjpg, s, w) {
       theImage = new Image();
       theImage.src = plikjpg;
       //alert(theImage.src+' height=' + theImage.height+ ' width=' + theImage.width +' '+theImage.complete)
       kontrola(plikjpg);
      }
      
function kontrola(plikjpg) {
       if((theImage.width!=0)&&(theImage.height!=0))
            {
            s = theImage.width + 20;
            w = theImage.height + 30;
            okno = window.open(theImage.src,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=1,width="+s+",height="+w+", top=100, left=100)");
            }
       else
        {
        f="kontrola('"+plikjpg+"')";
        intervallo=setTimeout(f,20);
        }
        }

