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 - Stonehenge</title>\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/0206-002-irl.jpg'; \n";
	txt += "images[2] = 'images/0206-006-irl.jpg'; \n";
	txt += "images[3] = 'images/0206-004-irl.jpg'; \n";
	txt += "images[4] = 'images/0206-003-irl.jpg'; \n";
	txt += "images[5] = 'images/0206-007-irl.jpg'; \n";
	txt += "images[6] = 'images/0206-005-irl.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\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 == 6){ \n";
	txt += "document.gallery.next.value='      '; } \n";
	txt += "} \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";
	
	txt += "function nextimg(){ \n";
	txt += "if (i != 6) { \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 ==6){ \n";
	txt += "document.gallery.next.value='      '; } \n";
	txt += "} \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";
	
	txt += "function lastimg(){ \n";
	txt += "i = 6; \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";
	
	txt += "document.onmousedown=click \n";
	txt += "//--> </sc" + "ript> \n";
	
	txt += "</head> \n";
	
	txt += "<body bgcolor=black onload='gallery();' text=#0099FF vlink=#666699 alink=#666699 link=#666699 border=0> \n";
	txt += "<font size='0' face='Verdana'><B><center> \n";
	txt += "<TABLE BGCOLOR=#000000 HEIGHT='100%' border=0 cellspacing=0> <TR><TD> \n";
	txt += "<TABLE BGCOLOR=#000000 WIDTH=700 height=600 border=0 cellspacing=0 > \n";
	txt += "<TR><td width=40></td><td><center> \n";
 	txt += "<TABLE BGCOLOR=#eDeCe6 width=700 height=450 border=0 cellspacing=0> \n";
	txt += "<tr height=470><td><center> <td height='400' width='670'> <div align='center'> \n";
	txt += "<img border='0' name='img' alt=&copy;2002&nbsp;Pavel&nbsp;Kop&#345;iva> \n";
	txt += "</div></td></td> <td width=0></td></tr> </table> \n";
	txt += "</TR> <TR> <td width=40></td><td> \n";
	txt += "<form name='gallery'> <div align='center'><center> \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 += "</CENTER> </div> </form> </td><td width=40></td> </TR> \n";
	txt += "<tr height=30><td width=40></td> \n";
	txt += "<td width=770><center><font size='0'> \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> </TD></TR></TABLE> </CENTER>";
	
	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
}	
