Rev Author Line No. Line
39 miho 1 // History:
2 // Doplnìna detekce jazyka domuentu (ve znaèce body)
3  
1 kaklik 4 //var undefined; // Pro zpetnou kompatibilitu kdyby JS nepodporoval undefined
5  
39 miho 6 function Test()
7 // Testovací funkce pro ladìní
8 {
9 with (document)
10 {
11 var Info;
12 // Test
13 // Užiteèné: document.URL (cesta a jméno souboru stránky)
14 write('<p class="MenuText Small">');
15 write('document language '+DocLang());
16 write('</p>');
17 write('<p class="MenuText Small">');
18 write('document language '+navigator.appVersion);
19 write('</p>');
20 write('<p class="MenuText Small">');
21 write('document language '+document.body.lang);
22 write('</p>');
23 write('<p class="MenuText Small">');
24 write('navigator language '+navigator.language); // FF ano, IE6 ne
25 write('</p>');
26 }
27 }
1 kaklik 28  
39 miho 29  
30 function DocLang()
31 // Vrací zkratku jazyka stránky ( cz en )
32 // Není-li v dokumentu uvedená vrací en
33 {
34 var s;
35 s=document.body.lang.toLowerCase();
36 if(s=="cs") return "cz"; // To by mì zajímalo proè je v HTML cs
37 if(s=="cz") return "cz"; // a všude jinde cz
38 return "en";
39 }
40  
41  
1 kaklik 42 function DrawHeader(MoreInfo)
43 // Nepovinny parametr udava nadpis stranky
44 // Neni-li uveden bere se text ze znacky title dokumentu
45 {
46 with (document)
47 {
39 miho 48 // Default informace pokud je parametr nezadany
49 if(MoreInfo==undefined) MoreInfo=document.title;
50 // Vlozeni HTML kodu
51 write('<div class="InnerHeader"> ');
52 if (DocLang()=="cz")
53 { // èeský text
37 miho 54 write('<a href="index.html" title="Domù"><span class="HeaderLogo">MLAB</span><img border=0 width=120 height=57 src="MLAB_online.gif" alt="MLAB Logo"></a>');
1 kaklik 55 }
39 miho 56 else
57 { // English text
58 write('<a href="index.html" title="Home"><span class="HeaderLogo">MLAB</span><img border=0 width=120 height=57 src="MLAB_online.gif" alt="MLAB Logo"></a>');
59 }
60 write('<span class="HeaderText">'+MoreInfo+'</span>');
61 write('</div> ');
1 kaklik 62 }
63 }
64  
65  
66 function DrawMenu(MoreInfo)
67 // Nepovinny parametr udava nazev menu
68 // Neni-li uveden dava se text Menu
69 {
70 with(document)
71 {
39 miho 72 // Default text
73 if(MoreInfo==undefined) MoreInfo="Menu";
74 // Vlastni menu
75 write('<div class="InnerMenu">');
76 write(' <div class="Navigation">');
77 write(' <div class="MenuText">');
78 write( MoreInfo);
79 write(' </div>');
80 write(' <ul>');
81 if (DocLang()=="cz")
82 { // èeský text
37 miho 83 write(' <li> <a href="index.html" title="Domù">MLAB Home</a> </li>');
84 write(' <li> <a href="AboutAuthors.html" title="O autorech">Autoøi</a> </li>');
85 write(' <li> <a href="AboutWeb.html" title="O webu">O WEBu</a> </li>');
86 write(' <li> <a href="ToDoList.html" title="Co jìštì zbývá udìlat">To do list</a> </li>');
1 kaklik 87 }
39 miho 88 else
89 { // English text
90 write(' <li> <a href="index.html" title="Home">MLAB Home</a> </li>');
91 write(' <li> <a href="AboutAuthors.html" title="About Authors">Authors</a> </li>');
92 write(' <li> <a href="AboutWeb.html" title="About this WEB">About WEB</a> </li>');
93 write(' <li> <a href="ToDoList.html" title="What to do">To do list</a> </li>');
94 }
95 write(' </ul>');
96 write(' </div>');
97 write('</div> ');
1 kaklik 98 }
99 }
100  
101  
102 function DrawFooter(MoreInfo)
103 // Nepovinny parametr pro text do paticky
104 {
105 with (document)
106 {
39 miho 107 // Default text je prazdny
108 if(MoreInfo==undefined) MoreInfo="";
109 // Vlozeni HTML kodu
110 write('<div class="InnerFooter">');
111 write('&nbsp;'); // ústupek IE6 (chyba výpoètu šíøky pøi nenulovém paddingu )
112 if (DocLang()=="cz")
113 { // èeský text
37 miho 114 write('<a href=#>Nahoru</a> &nbsp; ')
21 miho 115 write('<a href="Copyright.html">Copyright</a> &copy; ');
37 miho 116 write('<a href="AboutAuthors.html">Autoøi MLAB</a> &nbsp; ');
1 kaklik 117 }
39 miho 118 else
119 { // English text
120 write('<a href=#>Up</a> &nbsp; ')
121 write('<a href="Copyright.html">Copyright</a> &copy; ');
122 write('<a href="AboutAuthors.html">MLAB Authors</a> &nbsp; ');
123 }
124 write('['+document.lastModified+'] &nbsp;&nbsp;&nbsp;');
125 write(MoreInfo);
126 write('</div>');
1 kaklik 127 }
128 }