timeout = 0; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds

function Open(URL) {
windowprops = "left=20,top=20,width=800,height=550,scrollbars=yes";

text = "<html><head><title>Náhled</title></head><body bgcolor='#00CC00'";

if (timeout != 0) text +=" onLoad=\"setTimeout('window.close()', " + timeout*1000 + ");\"";

//text += "><center><img border='1' src='" + URL + "' onClick='javascript: window.close();' alt='Zavřít okno'>";
text += ">";
text += "<table align=\"center\" valign=\"middle\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\"><tr><td align=\"center\" valign=\"middle\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td>";
text += "<img border='1' src='" + URL + "' onClick='javascript: window.close();' alt='Zavřít okno'>";
text += "</td></tr></table></td></tr></table>";
if (timeout != 0) text +="<br><br><font face='tahoma, arial' size='-2'>Okno se zavře za " + timeout + " sec.</font>";

text += "</body></html>";

preview = window.open("", "preview", windowprops);
preview.document.open();
preview.document.write(text);
preview.document.close();
}


