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 - Berlin, Postdamer Platz</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/0306-v-025-nam.jpg'; \n";
	txt += "images[2] = 'images/0306-v-022-nam.jpg'; \n";
	txt += "images[3] = 'images/0306-v-021-nam.jpg'; \n";
	txt += "images[4] = 'images/0306-v-005-nam.jpg'; \n";
	txt += "images[5] = 'images/0306-v-001-nam.jpg'; \n";
	txt += "images[6] = 'images/0306-v-007-nam.jpg'; \n";
	txt += "images[7] = 'images/0306-v-002-nam.jpg'; \n";
	txt += "images[8] = 'images/0306-v-003-nam.jpg'; \n";
	txt += "images[9] = 'images/0306-v-018-nam.jpg'; \n";
	txt += "images[10] = 'images/0306-v-019-nam.jpg'; \n";
	txt += "images[11] = 'images/0306-v-020-nam.jpg'; \n";
	txt += "images[12] = 'images/0306-v-012x-nam_800.jpg'; \n";

	txt += "images[14] = 'images/0306-v-014-nam_800.jpg'; \n";

	txt += "images[16] = 'images/0306-v-016-nam_800.jpg'; \n";

	txt += "images[18] = 'images/0306-v-018-nam_800.jpg'; \n";
	txt += "images[19] = 'images/0306-v-019-nam_800.jpg'; \n";
	txt += "images[20] = 'images/0306-v-020-nam_800.jpg'; \n";
	txt += "images[21] = 'images/0306-v-021-nam_800.jpg'; \n";
	txt += "images[22] = 'images/0306-v-022-nam_800.jpg'; \n";
	txt += "images[23] = 'images/0306-v-023-nam_800.jpg'; \n";
	txt += "images[24] = 'images/0306-v-024-nam_800.jpg'; \n";
	txt += "images[25] = 'images/0306-v-025-nam_800.jpg'; \n";
	txt += "images[26] = 'images/0306-v-026-nam_800.jpg'; \n";
	txt += "images[27] = 'images/0306-v-027-nam_800.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\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 == 11){ \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 != 11) { \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 == 11){ \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 = 11; \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=#CCCCCC align='center' width=700 border=0 cellspacing=0 > \n";
	txt += "<tr height=650><td></td> <td height='650' width='700'><div align='center'> \n";
	txt += "<img border='0' name='img' alt=&copy;2003&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
}	
