function gen_stred(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 - Střední Čechy ze vzduchu</title> \n\n";

	// styl pro POPIS - globalni nastaveni (subclass tagu SPAN) - font, barva, ..
	txt += "<style> \n";
	txt += "SPAN.text {FONT-SIZE: 10pt; COLOR: #d3d3a9; FONT-STYLE: normal; FONT-FAMILY: arial,helvetica} \n";
	txt += "SPAN.head {FONT-WEIGHT: bold; FONT-SIZE: 14pt; COLOR: #d3d3a9; FONT-STYLE: normal; FONT-FAMILY: arial,helvetica} \n";
	txt += "</style> \n";
	
	txt += "<sc" + "ript language='JavaScript'> \n";
	txt += "<!-- \n"; 
	txt += "var i; \n";
	
	// pole (cache) obrazku
	txt += "images = new Array(); \n";
	txt += "images[0] = './stred/a0409-kon.jpg'; \n";	
	txt += "images[1] = './stred/a0409-ben.jpg'; \n";
	txt += "images[2] = './stred/a0409-kon-ben.jpg'; \n";
	txt += "images[3] = './stred/a0302-kon.jpg'; \n";
	txt += "images[4] = './stred/a0403-kon.jpg'; \n";
	txt += "images[5] = './stred/a0409-kon.jpg'; \n";
	txt += "images[6] = './stred/a0308-trosky.jpg'; \n";
	txt += "images[7] = './stred/a0409-mlyn.jpg'; \n";
	txt += "images[8] = './stred/a0409-pole.jpg'; \n";
	txt += "images[9] = './stred/a0302-krivoklat.jpg'; \n";
	txt += "images[10] = './stred/a0501-svatyjan.jpg'; \n";
	txt += "images[11] = './stred/a0403-tocnik.jpg'; \n";
	txt += "images[12] = './stred/a0409-dobris-z.jpg'; \n";
	txt += "images[13] = '.jpg'; \n";
	txt += "images[14] = '.jpg'; \n";
	txt += "images[15] = '.jpg'; \n";
	txt += "images[16] = '.jpg'; \n";
	txt += "images[17] = '.jpg'; \n";
	txt += "images[18] = '.jpg'; \n";
	txt += "images[19] = '.jpg'; \n";
	txt += "images[20] = '.jpg'; \n";
	txt += "images[21] = '.jpg'; \n";
	txt += "images[22] = '.jpg'; \n";
	txt += "images[23] = '.jpg'; \n";
	txt += "images[24] = '.jpg'; \n";
	txt += "images[25] = '.jpg'; \n";
	txt += "images[26] = '.jpg'; \n";
	txt += "images[27] = '.jpg'; \n";
	txt += "images[28] = '.jpg'; \n";
	txt += "images[29] = '.jpg'; \n";
	txt += "images[30] = '.jpg'; \n";
	txt += "images[31] = '.jpg'; \n";
	txt += "images[32] = '.jpg'; \n";
	txt += "images[33] = '.jpg'; \n";
	txt += "images[34] = '.jpg'; \n\n";
                                             	
	// pole textu
	txt += "texty = new Array(); \n";
	txt += "texty[0] = 'Zámek Konopiště'; \n";
	txt += "texty[1] = 'Zámek Konopiště, v pozadí Benešov'; \n";
	txt += "texty[2] = 'Zámek Konopiště, v pozadí Benešov'; \n";
	txt += "texty[3] = 'Zimní pohled na zámek Konopiště'; \n";
	txt += "texty[4] = 'Zámek Konopiště v předjaří'; \n";
	txt += "texty[5] = 'Zámek Konopiště'; \n";
	txt += "texty[6] = 'Hrad Tosky v podvečer'; \n";
	txt += "texty[7] = 'Bývalý větrný mlýn uprostřed polí středních Čech'; \n";
	txt += "texty[8] = 'Středočeská pole v pozdním létě'; \n";
	txt += "texty[9] = 'Zimní Křivoklát'; \n";
	txt += "texty[10] = 'Kláštěr Svatý Jan pod Skalou uprostřed zimy'; \n";
	txt += "texty[11] = 'Hrad Točník, předjaří'; \n";
	txt += "texty[12] = 'Dobříš, zámek a hospodářský dvůr'; \n";
	txt += "texty[13] = ''; \n";
	txt += "texty[14] = ''; \n";
	txt += "texty[15] = ''; \n";
	txt += "texty[16] = ''; \n";
	txt += "texty[17] = ''; \n";
	txt += "texty[18] = ''; \n";
	txt += "texty[19] = ''; \n";
	txt += "texty[20] = ''; \n";
	txt += "texty[21] = ''; \n";	
	txt += "texty[22] = ''; \n";
	txt += "texty[23] = ''; \n";	
	txt += "texty[24] = ''; \n";	
	txt += "texty[25] = ''; \n";	
	txt += "texty[26] = ''; \n";	
	txt += "texty[27] = ''; \n";	
	txt += "texty[28] = ''; \n";	
	txt += "texty[29] = ''; \n";	
	txt += "texty[30] = ''; \n";	
	txt += "texty[31] = ''; \n";	
	txt += "texty[32] = ''; \n";	
	txt += "texty[33] = ''; \n";	
	txt += "texty[34] = ''; \n\n";	

	
	txt += "function gallery(){ \n";
	txt += "i = " + index + "; \n"; // !! zde se prirazuje index vybraneho obrazku !!
	txt += "document.img.src = images[i]; \n";
	txt += "popis.innerText = texty[i]; \n";
	txt += "if (i == 0){ \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 != 0) { \n";
	txt += "i--; \n";
	txt += "document.img.src = images[i]; \n";
	txt += "popis.innerText = texty[i]; \n";
	txt += "document.gallery.next.value = '  >  '; } \n";
	txt += "if (i == 0) { \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 += "popis.innerText = 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 = 0; \n";
	txt += "document.img.src = images[i]; \n";
	txt += "popis.innerText = 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 += "popis.innerText = texty[i]; \n";
	txt += "document.gallery.next.value='      '; \n";
	txt += "document.gallery.previous.value='  <  '; \n";
	txt += "} \n";                       
	
	txt += "//--> </sc" + "ript> \n";
	
	txt += "</head> \n\n";
	
	txt += "<body bgcolor=#4F4F4F onload='gallery();' text=#0099FF vLink=#bec4bd aLink=#bec4bd link=#bec4bd border=0> \n";
	txt += "<TABLE BGCOLOR=#4F4F4F height=100% WIDTH=100% border=0 cellspacing=0 align=center > \n";
	txt += "<TR><td width=40></td><td> \n";
	txt += "<TABLE BGCOLOR=#4F4F4F align='center' width=800 border=0 cellspacing=0 > \n";
	txt += "<tr height=510><td></td> <td height='520' width='800'><div align='center'> \n";
    txt += "<span class='head'> Střední Čechy s nadhledem</span><p> \n";
	txt += "<a href=javascript:history.go(-1)> <img border='0' name='img' alt=&copy;2005&nbsp;Pavel&nbsp;Kop&#345;iva&nbsp;-&nbsp;Klikněte&nbsp;pro&nbsp;návrat> </a> <p>\n";
	// zde je zobrazovan POPIS
	txt += "<span class='text' id='popis'></span> \n";
	txt += "</div></td> <td width=0></td></tr> </table> \n";
	txt += "</TD></TR> \n";
	txt += "<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=10 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
}	
