// napis_title='wpisac stala informacja w title'

function WiechuPopImage(imageURL,imageTitle){
	img=imageURL;
	napis_title='* JACKO-LAND - Poznań *';
	foto = new Image();
	foto.src =(img);
	kontrola(img);
}
function kontrola(img){
	 if((foto.width!=0)&&(foto.height!=0)){
 		  viewFoto(img);
		}
	 else{
		  kontrola_strefa="kontrola('"+img+"')";
		  intervallo=setTimeout(kontrola_strefa,20);
		}
	}
function viewFoto(img){
	foto_w = foto.width;
	foto_h = foto.height;
	foto_w_org = foto_w;
	foto_h_org = foto_h;
	win_w = screen.width;
	win_h = screen.height;
	if((win_w<=(foto_w+160))||(win_h<=(foto_h+160))){
		if(win_w<=(foto_w+160)){foto_w = win_w-160;}
		if(win_h<=(foto_h+160)){foto_h = win_h-160;}
		win_w = parseInt(win_w/2-foto_w/2);
		win_h = parseInt(win_h/2-foto_h/2);
		okno = "width="+foto_w+",height="+foto_h+",left="+win_w+",top="+win_h+",resizable=no,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no";
	}
	else{
		win_w = parseInt(win_w/2-foto_w/2);
		win_h = parseInt(win_h/2-foto_h/2);
		okno = "width="+foto_w+",height="+foto_h+",left="+win_w+",top="+win_h+",resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no";
	}
	podglad = window.open('','podglad',okno);
	with (podglad.document){
		write("<html><head><title>"+napis_title+"</title>");
		write("<style>body{margin:0px;}</style>");
		write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">");
		write("<meta http-equiv=\"imagetoolbar\" content=\"no\">");
		write("</head>");
		write("<body oncontextmenu=\"return false\" ondragstart=\"return false\" onselectstart=\"return false\" onBlur=\"self.close()\">");
		write("<center><a href='javascript:self.close();'><img src='"+img+"' width="+foto_w_org+" height="+foto_h_org+" border=\"0\" </a></center></body></html>");
	}
	podglad.document.close();
	podglad.focus();
}
