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 - Zátopové louky u Týništ&#283; nad Orlicí</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/0209_006_Tyn.jpg'; \n";
	txt += "images[2] = 'images/0209_001_Tyn.jpg'; \n";
	txt += "images[3] = 'images/0209_005_Tyn.jpg'; \n";
	txt += "images[4] = 'images/0209_008_Tyn.jpg'; \n";
	txt += "images[5] = 'images/0209_013_Tyn.jpg'; \n";
	txt += "images[6] = 'images/0209_011_Tyn.jpg'; \n";
	txt += "images[7] = 'images/0209_012_Tyn.jpg'; \n";
	txt += "images[8] = 'images/0209_010_Tyn.jpg'; \n";
	txt += "images[9] = 'images/0209_014_Tyn.jpg'; \n";
	txt += "images[10] = 'images/0209_002_Tyn.jpg'; \n";
	txt += "images[11] = 'images/0209_004_Tyn.jpg'; \n";
	txt += "images[12] = 'images/0209_003_Tyn.jpg'; \n\n";
	
	// pole textu pro stavovy radek MSIE
	txt += "texty = new Array(); \n";
	txt += "texty[1] = 'obrázek'; \n";
	txt += "texty[2] = 'obrázek'; \n";
	txt += "texty[3] = 'obrázek'; \n";
	txt += "texty[4] = 'obrázek'; \n";
	txt += "texty[5] = 'obrázek'; \n";
	txt += "texty[6] = 'obrázek'; \n";
	txt += "texty[7] = 'obrázek'; \n";
	txt += "texty[8] = 'obrázek'; \n";
	txt += "texty[9] = 'obrázek'; \n";
	txt += "texty[10] = 'obrázek'; \n";
	txt += "texty[11] = 'obrázek'; \n";
	txt += "texty[12] = 'obrázek'; \n";
	txt += "texty[13] = 'obrázek'; \n";
	txt += "texty[14] = 'obrázek'; \n";
	txt += "texty[15] = 'obrázek'; \n";
	txt += "texty[16] = 'obrázek'; \n";
	txt += "texty[17] = 'obrázek'; \n";
	txt += "texty[18] = 'obrázek'; \n";
	txt += "texty[19] = 'obrázek'; \n";
	txt += "texty[20] = 'obrázek'; \n";
	txt += "texty[21] = 'obrázek'; \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 == 12){ \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 != 12) { \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 == 12){ \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 = 12; \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=100% border=0 cellspacing=0 align=center > \n";
	txt += "<TR><td width=40></td><td> \n";
	
	txt += "<TABLE BGCOLOR=#eDeCe6 align='center' 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 align='center'><td width=40></td> \n";
	txt += "<td width=100% ><font size='0' face='Verdana'>  \n";
	txt += "<a href=javascript:history.go(-1)>zp&#283;t na náhledy</a></font></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
}	
