var wind;
function openfoto(i, w, h, n, pp) {
	oi = i;
	if (!pp || pp == 0) {
		if (pp == 0) i = 'c_'+ i;
		pp = '/img/fotografie/';
		saveit = true;
	} else saveit = false;
	if (w > 800 || h > 600) {
		w = Math.round(w / 1.28);
		h = Math.round(h / 1.28);
	}
	x = Math.round((window.screen.width - w) / 2);
	y = Math.round((window.screen.height - h) / 2 / 2);
	wind = window.open('', 'foto', 'scrollbars=no, noresizable, height='+ h +', width='+ w +', top='+ y +', left='+ x +'');
	wind.document.open();
	wind.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">\
<head>\
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-2" />\
    <meta http-equiv="Content-language" content="cs" />\
    <title>'+ n +'</title>\
    <link rel="stylesheet" type="text/css" href="/css/fotografie.css" media="screen" />\
</head>\
<body id="image">\
<a href="#" onclick="self.close()"><img src="'+ pp + i +'" width="'+ w +'" height="'+ h +'" alt="'+ n +'" title="'+ n +'"  />');
if (saveit) 	wind.document.write('<a href="/save_foto.php?f='+ oi +'" id="saveit"></a>');
	wind.document.write('</body>\
</html>');	
	wind.document.close();	
	return true;
}
