// script by Jakub Sýkora (kubaskyora@volny.cz) ©2oo1

var okno = new Object()

function opnx(path)
{
if (okno.closed==false) okno.close()
okno=window.open("","full","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=300,height=150");
// write script to the opened window;
okno.document.writeln('<script>');
okno.document.writeln('function res()');
okno.document.writeln('{');
okno.document.writeln('xwidth=window.document.pic.width + 32');
okno.document.writeln('yheight=window.document.pic.height + 52');
okno.document.writeln('if (yheight>screen.availHeight) {yheight=screen.availHeight;window.moveTo(0,0)}');
okno.document.writeln('if (xwidth>screen.availWidth) {xwidth=screen.availWidth;window.moveTo(0,0)}');
okno.document.writeln('window.resizeTo(xwidth,yheight)');
okno.document.writeln('setTimeout("res()",1000)');
okno.document.writeln('}');
okno.document.writeln('</script>');

okno.document.writeln('<title>Full view of ' + path + '</title>');

okno.resizeTo(500,300);

okno.document.writeln('<style>a {text-decoration:none</style>');
okno.document.writeln('<body bgcolor="#000000" background="images/bck.jpg" text="#FFFFFF" topmargin="0" leftmargin="0" onLoad="res()">');
okno.document.writeln('<p align="center"><img onLoad="res()" onMouseOver="res()" onClick="res()" name="pic" id="pic" src="' + path + '"><br>');
okno.document.writeln('<a href="#" onClick=window.close()><font size="1" face="Verdana" color="#FFFFFF"><b>Zavøít okno</b></a></p>');

xwidth=okno.document.pic.width + 32;
yheight=okno.document.pic.height + 52;
if (yheight>screen.availHeight) {yheight=screen.availHeight;okno.moveTo(0,0)};
if (xwidth>screen.availWidth) {xwidth=screen.availWidth;okno.moveTo(0,0)};
okno.resizeTo(xwidth,yheight);

};

