function fotografie(i)
{
var txt;

txt = "<HTML> \n";
txt += "<HEAD> \n";
txt += "<TITLE>Železnice - Okolí Prahy</TITLE> \n";
txt += "<META http-equiv='content-type' content='text/html; charset=iso-8859-2'> \n";
txt += "<LINK href='../../etc/mv.css' type=text/css rel=STYLESHEET> \n";
txt += "<link rel='shortcut icon' href='http://www.martinvalek.net/favicon.ico' /> \n";
txt += "<sc" + "ript language='JavaScript'> \n";
txt += "<!-- \n";
// Celkový počet fotek
txt += "pocet_obrazku = 20; \n"; 
txt += "show = false; \n"; 
// jména suborů
txt += "images = new Array (); \n";
txt += "images[1] = 'fotky/27-29.jpg'; \n";
txt += "images[2] = 'fotky/29-11.jpg'; \n";
txt += "images[3] = 'fotky/29-28.jpg'; \n";
txt += "images[4] = 'fotky/44-06.jpg'; \n";
txt += "images[5] = 'fotky/44-12.jpg'; \n";
txt += "images[6] = 'fotky/50-37.jpg'; \n";
txt += "images[7] = 'fotky/51-06.jpg'; \n";
txt += "images[8] = 'fotky/57-14.jpg'; \n";
txt += "images[9] = 'fotky/59-23.jpg'; \n";
txt += "images[10] = 'fotky/59-10.jpg'; \n";
txt += "images[11] = 'fotky/59-35.jpg'; \n";
txt += "images[12] = 'fotky/60-02.jpg'; \n";
txt += "images[13] = 'fotky/61-33.jpg'; \n";
txt += "images[14] = 'fotky/61-34.jpg'; \n";
txt += "images[15] = 'fotky/63-16.jpg'; \n";
txt += "images[16] = 'fotky/66-04.jpg'; \n";
txt += "images[17] = 'fotky/66-12.jpg'; \n";
txt += "images[18] = 'fotky/70-13.jpg'; \n";
txt += "images[19] = 'fotky/71-22.jpg'; \n";
txt += "images[20] = 'fotky/99-18.jpg'; \n";
// Komentáře fotografií
txt += "comment = new Array () \n";
txt += "comment[1] = '810.668 ČD, Os 19343, Bošice'; \n";
txt += "comment[2] = '810.098 ČD, Os 19309, Zalešany - Žabonosy'; \n";
txt += "comment[3] = '363 ČD, EC 50 Karlštejn, Srbsko - Beroun'; \n";
txt += "comment[4] = '123.024 ČD, Pn 61702, Srbsko - Beroun'; \n";
txt += "comment[5] = '363.068 ČD, EC 50 Karlštejn, Srbsko - Beroun'; \n";
txt += "comment[6] = '725.101 ČD, Mn 81169, Hvězdonice'; \n";
txt += "comment[7] = '751.004 ČD, Os 9204, Hvězdonice'; \n";
txt += "comment[8] = '363.065 ČD, Os 7812, Černošice-Mokropsy - Všenory'; \n";   
txt += "comment[9] = '141.018 ČD, Os 9918, Černošice-Mokropsy - Všenory'; \n";
txt += "comment[10] = '363.128 ČD, Nex 48313, Světice - Strančice'; \n";   
txt += "comment[11] = '363.129 ČD, Rn 58530, Strančice - Světice'; \n";
txt += "comment[12] = '363.114 ČD, Sp 1830, Strančice - Světice'; \n";
txt += "comment[13] = '363.052+114 ČD, Pn 48047, Praha-Uhříněves - Praha-Kolovraty'; \n";
txt += "comment[14] = '363.128 ČD, Os 8201, Praha-Kolovraty'; \n";
txt += "comment[15] = '363.114 ČD, Nex 48317, Čerčany'; \n";
txt += "comment[16] = '742.372+243 ČD, odkloněný R 353, Nučice - Rudná u Prahy'; \n";
txt += "comment[17] = '753.073 + 749.135 ČD, spojené soupravy vlaků R 655 a Ex 553, Nučice'; \n";
txt += "comment[18] = '750.338 ČD, povodňový odklon, Úžice - Netřeba'; \n";
txt += "comment[19] = '363.083 ČD, Sp 1837, Pyšely - Čerčany'; \n";
txt += "comment[20] = 'Vlak duchů'; \n";   
// Data fotografií
txt += "date = new Array () \n";
txt += "date[1] = '28.2.2000'; \n";
txt += "date[2] = '22.4.2000'; \n";
txt += "date[3] = '26.4.2000'; \n";
txt += "date[4] = '2.4.2001'; \n";
txt += "date[5] = '2.4.2001'; \n";
txt += "date[6] = '5.8.2001'; \n";
txt += "date[7] = '5.8.2001'; \n";
txt += "date[8] = '19.1.2002'; \n";
txt += "date[9] = '1.4.2002'; \n";
txt += "date[10] = '31.3.2002'; \n";
txt += "date[11] = '1.5.2002'; \n";
txt += "date[12] = '2.5.2002'; \n";
txt += "date[13] = '8.7.2002'; \n";
txt += "date[14] = '8.7.2002'; \n";
txt += "date[15] = '22.7.2002'; \n";
txt += "date[16] = '14.8.2002'; \n";
txt += "date[17] = '14.8.2002'; \n";
txt += "date[18] = '18.9.2002'; \n";
txt += "date[19] = '20.10.2002'; \n";
txt += "date[20] = '498.022, Černošice-Mokropsy - Všenory, 2.8.2003'; \n";
// Časovač na automatické přepínání fotek
txt += "var timer; \n";    
// Nastavení obrázku
txt += "function SetPic (){ \n";
txt += "document.images.imgprev.src = images[actpic];} \n";
// Nastavení komentáře obrázku
txt += "function SetKom (){ \n";
txt += "function dominnerText(node, text) { \n";
txt += "while (node.hasChildNodes()) { \n";
txt += "node.removeChild(node.firstChild); \n";
txt += "} \n";
txt += "node.appendChild(document.createTextNode(text)); \n";
txt += "} \n";
txt += "dominnerText(document.getElementById('popis'), comment[actpic])}; \n";
// Nastavení data obrázku
txt += "function SetDat (){ \n";
txt += "function dominnerText(node, text) { \n";
txt += "while (node.hasChildNodes()) { \n";
txt += "node.removeChild(node.firstChild); \n";
txt += "} \n";
txt += "node.appendChild(document.createTextNode(text)); \n";
txt += "} \n";
txt += "dominnerText(document.getElementById('datum'), date[actpic])}; \n";
// Následující snímek
txt += "function NextPic (){ \n";
txt += "if (actpic == pocet_obrazku) actpic = pocet_obrazku; \n";
txt += "else actpic++; \n";
txt += "SetPic(); \n";
txt += "SetKom (); \n";
txt += "SetDat (); \n";
txt += "document.SetPic.previous.value='<<<'; \n";
txt += "if (actpic == pocet_obrazku){ \n";
txt += "document.SetPic.next.value='';  \n";
txt += "document.SetPic.slshow.value=''; \n";
txt += "if (show == true) {show = false; \n";
txt += "StopSlideShow ();} \n";
txt += "} \n";
txt += "} \n";
// Předchozí snímek
txt += "function PrevPic (){ \n";
txt += "if (actpic != 1) { \n";
txt += "actpic--; \n";
txt += "SetPic(); \n";
txt += "SetKom (); \n";
txt += "SetDat (); \n";
txt += "document.SetPic.next.value = '>>>'; } \n";
txt += "if (show == false) { \n";
txt += "document.SetPic.slshow.value='slideshow';} \n";
txt += "if (actpic == 1) { \n";
txt += "document.SetPic.previous.value=''; } \n";
txt += "} \n";
// Snímek volaný z galerie
txt += "function AktPic (){ \n";
//txt += "actpic = 1; \n";
txt += "actpic = " + i + "; \n";
txt += "SetPic(); \n";
txt += "SetKom (); \n";
txt += "SetDat (); \n";
txt += "if (actpic == 1){ \n";
txt += "document.SetPic.previous.value=''; } \n";
txt += "if (actpic == pocet_obrazku){ \n";
txt += "document.SetPic.next.value='';  \n";
txt += "document.SetPic.slshow.value=''; } \n";
txt += "} \n";
// Poslední snímek
txt += "function LastPic (){ \n";
txt += "actpic = pocet_obrazku; \n";
txt += "SetPic(); \n";
txt += "SetKom (); \n";
txt += "SetDat ();} \n";
// Spuštění slideshow
txt += "function SlideShow (){ \n";
txt += "timer = setInterval ('NextPic();', 20000);} \n";
// Zastavení slideshow
txt += "function StopSlideShow (){ \n";
txt += "clearInterval (timer);} \n";
// Ovladac slideshow
txt += "function OvladacSlideShow () {  \n";
txt += "if (show == false && actpic != pocet_obrazku) { show = true; \n";
txt += "SlideShow (); \n";
txt += "document.SetPic.slshow.value='stop';} \n";
txt += "else \n";
txt += "{if (actpic != pocet_obrazku) { show = false; \n";
txt += "StopSlideShow (); \n";
txt += "document.SetPic.slshow.value='slideshow';} \n";
txt += "} \n";
txt += "} \n";
// Ovladac zmeny barvy tlacitek
txt += "function KurzorNadNahledy() { \n";
txt += "document.SetPic.nahledy.style.color = '#ffffff'; } \n";
txt += "function KurzorMimoNahledy() { \n";
txt += "document.SetPic.nahledy.style.color = '#3C3E35'; } \n";
txt += "function KurzorNadSlshow() { \n";
txt += "document.SetPic.slshow.style.color = '#ffffff'; } \n";
txt += "function KurzorMimoSlshow() { \n";
txt += "document.SetPic.slshow.style.color = '#3C3E35'; } \n";
txt += "function KurzorNadPredchozi() { \n";
txt += "document.SetPic.previous.style.color = '#ffffff'; } \n";
txt += "function KurzorMimoPredchozi() { \n";
txt += "document.SetPic.previous.style.color = '#3C3E35'; } \n";
txt += "function KurzorNadDalsi() { \n";
txt += "document.SetPic.next.style.color = '#ffffff'; } \n";
txt += "function KurzorMimoDalsi() { \n";
txt += "document.SetPic.next.style.color = '#3C3E35'; } \n";
txt += "// --> \n";
txt += "//--> </sc" + "ript> \n";

txt += "</HEAD> \n";
txt += "<BODY OnLoad='AktPic ();'> \n";
txt += "<table width=100% height=99%> \n";
txt += "<tr height=20><td> \n";
txt += "<form name='SetPic'> \n";
txt += "<input name='nahledy' onclick='history.go(-1);' class='galerie-navigace-foto' id='nahledy' type='button' width=50px style='cursor: pointer;' value='náhledy' onMouseOver='KurzorNadNahledy()' onMouseOut='KurzorMimoNahledy()'></td> \n";
txt += "<input name='slshow' onclick='OvladacSlideShow();' class='galerie-navigace-foto' id='slideshow' type='button' style='cursor: pointer;' value='slideshow' onMouseOver='KurzorNadSlshow()' onMouseOut='KurzorMimoSlshow()'></td> \n";
txt += "<input name='previous' onClick='PrevPic();' class='galerie-navigace-foto' id='zpet' type='button' style='cursor: pointer;' value='&lt;&lt;&lt;' onMouseOver='KurzorNadPredchozi()' onMouseOut='KurzorMimoPredchozi()'></td> \n";
txt += "<input name='next' onclick='NextPic();' class='galerie-navigace-foto' id='tam' type='button' style='cursor: pointer;' value='&gt;&gt;&gt;' onMouseOver='KurzorNadDalsi()' onMouseOut='KurzorMimoDalsi()'></td></tr></form> \n";
txt += "<tr align=center valign=middle> \n";
txt += "<td> \n";
txt += "<IMG Name='imgprev' title='' alt='Okolí Prahy'> \n";
txt += "<div class='popiska-text' id='popis'></div> \n";
txt += "<div class='datum-text' id='datum'></div></td></tr><table> \n";
txt += "</BODY> \n";
txt += "</HTML>";

	document.open(); 
	document.write(txt);
	document.close(); 
}	
