function gen_stranky(index) // param. index = index vybraneho obrazku
{
	var txt; // obsah stranky jako string
	txt = "<html> \n";
	txt += "<meta http-equiv='Content-Type' content='text/html; charset=windows-1250'> \n";
	txt += "<META name='description' content='fotogalerie Pavel Kop&#345;iva'> \n";
	txt += "<META name='keywords' content='Kop&#345;iva, Kopriva, foto, fotografie, galerie, fotogalerie, album, gallery, photo, fotky, photos, art'> \n";
	txt += "<META HTTP-EQUIV='Expires' CONTENT='0'> \n";
	txt += "<META HTTP-EQUIV='Pragma' CONTENT='no-cache'> \n";
	txt += "<META HTTP-EQUIV='Cache-Control' CONTENT='no-cache'> \n";

	txt += "<head> \n";
	txt += "<title>GALERIE: Pavel Kop&#345;iva - &#268;ervená Lhota</title> \n\n";
	
	txt += "<sc" + "ript language='JavaScript'> \n";
	txt += "<!-- \n"; 
	txt += "var i; \n";
	
	// pole (cache) obrazku
	txt += "images = new Array(); \n";
	txt += "images[1] = 'images/u0208_004_Rybniky.jpg'; \n";
	txt += "images[2] = 'images/u0208_001_CervLhota.jpg'; \n";
	txt += "images[3] = 'images/u0208_002_CervLhota.jpg'; \n";
	txt += "images[4] = 'images/u0208_003_CervLhota.jpg'; \n\n";
	
	// pole textu pro stavovy radek MSIE
	txt += "texty = new Array(); \n";
	txt += "texty[1] = 'Rybníky u Červené Lhoty'; \n";
	txt += "texty[2] = 'Vodní zámek Červená Lhota'; \n";
	txt += "texty[3] = 'Vodní zámek Červená Lhota'; \n";
	txt += "texty[4] = 'Vodní zámek Červená Lhota'; \n\n";
	
	txt += "function gallery(){ \n";
	txt += "i = " + index + "; \n"; // !! zde se prirazuje index vybraneho obrazku !!
	txt += "document.img.src = images[i]; \n";
	txt += "window.status = texty[i]; \n";
	txt += "if (i == 1){ \n";
	txt += "document.gallery.previous.value='      '; } \n";
	txt += "if (i == 4){ \n";
	txt += "document.gallery.next.value='      '; } \n";
	txt += "} \n\n";
	
	txt += "function previmg(){ \n";
	txt += "if (i != 1) { \n";
	txt += "i--; \n";
	txt += "document.img.src = images[i]; \n";
	txt += "window.status = texty[i]; \n";
	txt += "document.gallery.next.value = '  >  '; } \n";
	txt += "if (i == 1) { \n";
	txt += "document.gallery.previous.value='      '; } \n";
	txt += "} \n\n";
	
	txt += "function nextimg(){ \n";
	txt += "if (i != 4) { \n";
	txt += "i++; \n";
	txt += "document.img.src = images[i]; } \n";
	txt += "window.status = texty[i]; \n";
	txt += "document.gallery.previous.value='  <  '; \n";
	txt += "if (i ==4){ \n";
	txt += "document.gallery.next.value='      '; } \n";
	txt += "} \n\n";
	
	txt += "function firstimg(){ \n";
	txt += "i = 1; \n";
	txt += "document.img.src = images[i]; \n";
	txt += "window.status = texty[i]; \n";
	txt += "document.gallery.previous.value='      '; \n";
	txt += "document.gallery.next.value='  >  '; \n";
	txt += "} \n\n";
	
	txt += "function lastimg(){ \n";
	txt += "i = 4; \n";
	txt += "document.img.src = images[i]; \n";
	txt += "window.status = texty[i]; \n";
	txt += "document.gallery.next.value='      '; \n";
	txt += "document.gallery.previous.value='  <  '; \n";
	txt += "} \n";
	
	txt += "function click() { \n";
	txt += "if (event.button==2) { \n";
	txt += "alert('Informace o použití fotografie u autora: kopriva@stapro.cz'); \n";
	txt += "} } \n\n";
	
	txt += "document.onmousedown=click \n";
	txt += "//--> </sc" + "ript> \n";
	
	txt += "</head> \n\n";
	
	txt += "<body bgcolor=black onload='gallery();' text=#0099FF vLink=#666699 aLink=#666699 link=#666699 border=0> \n";
	txt += "<TABLE BGCOLOR=black height=100% WIDTH=750 border=0 cellspacing=0 align=center > \n";
	txt += "<TR><td width=40></td><td> \n";
	
	txt += "<TABLE BGCOLOR=#eDeCe6 width=750 border=0 cellspacing=0 > \n";
	txt += "<tr height=470><td></td> <td height='300' width='600'><div align='center'> \n";
	txt += "<img border='0' name='img' alt=&copy;2002&nbsp;Pavel&nbsp;Kop&#345;iva> \n";
	txt += "</div></td> <td width=0></td></tr></TABLE>  \n";
	txt += "</TD></TR> <TR> <td width=40></td><td> \n";
	txt += "<form name='gallery'> <font size='0' face='Verdana' ><center> \n";
	txt += "<B> \n";
	txt += "<input name='first' onClick='firstimg();' type='button' value='&nbsp;&nbsp;&lt;&lt;&nbsp;&nbsp;' > \n";
	txt += "<input name='previous' onClick='previmg();' type='button' value='&nbsp;&nbsp;&lt;&nbsp;&nbsp;' > \n";
	txt += "<input name='next' onclick='nextimg();' type='button' value='&nbsp;&nbsp;&gt;&nbsp;&nbsp;' > \n";
	txt += "<input name='last' onClick='lastimg();' type='button' value='&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp;'> \n";
	txt += "</B> </center></font> </form> </td><td width=40></td> </TR> \n";
	txt += "<tr height=30><td width=40></td> \n";
	txt += "<td width=750><font size='0' face='Verdana' ><center>  \n";
	txt += "<a href=javascript:history.go(-1)>zp&#283;t na náhledy</a></font></center></td> \n";
	txt += "<td width=40></td></tr></TABLE> \n\n";
	
	txt += "</body> </html>";
	
	document.open(); // otevreni noveho dokumentu (obsahu stranky - NE okna)
	document.write(txt); // zapis obsahu stranky
	document.close(); // zavreni dokumentu a jeho fyzicke zobrazeni v prohlizeci
}	
