/www/menu.js
1,6 → 1,44
// History:
// Doplnìna detekce jazyka domuentu (ve znaèce body)
 
//var undefined; // Pro zpetnou kompatibilitu kdyby JS nepodporoval undefined
 
function Test()
// Testovací funkce pro ladìní
{
with (document)
{
var Info;
// Test
// Užiteèné: document.URL (cesta a jméno souboru stránky)
write('<p class="MenuText Small">');
write('document language '+DocLang());
write('</p>');
write('<p class="MenuText Small">');
write('document language '+navigator.appVersion);
write('</p>');
write('<p class="MenuText Small">');
write('document language '+document.body.lang);
write('</p>');
write('<p class="MenuText Small">');
write('navigator language '+navigator.language); // FF ano, IE6 ne
write('</p>');
}
}
 
 
function DocLang()
// Vrací zkratku jazyka stránky ( cz en )
// Není-li v dokumentu uvedená vrací en
{
var s;
s=document.body.lang.toLowerCase();
if(s=="cs") return "cz"; // To by mì zajímalo proè je v HTML cs
if(s=="cz") return "cz"; // a všude jinde cz
return "en";
}
 
 
function DrawHeader(MoreInfo)
// Nepovinny parametr udava nadpis stranky
// Neni-li uveden bere se text ze znacky title dokumentu
7,18 → 45,20
{
with (document)
{
if(0)
write('<b>Hlavièka z JavScriptu: ', MoreInfo, '</b>' );
else
{
// Default informace pokud je parametr nezadany
if(MoreInfo==undefined) MoreInfo=document.title;
// Vlozeni HTML kodu
write('<div class="InnerHeader"> ');
// Default informace pokud je parametr nezadany
if(MoreInfo==undefined) MoreInfo=document.title;
// Vlozeni HTML kodu
write('<div class="InnerHeader"> ');
if (DocLang()=="cz")
{ // èeský text
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>');
write('<span class="HeaderText">'+MoreInfo+'</span>');
write('</div> ');
}
else
{ // English text
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>');
}
write('<span class="HeaderText">'+MoreInfo+'</span>');
write('</div> ');
}
}
 
29,29 → 69,32
{
with(document)
{
if (0)
{
write('<b>Menu z JavaScriptu: ', MoreInfo, '</b>');
}
else
{
// Default text
if(MoreInfo==undefined) MoreInfo="Menu";
// Vlastni menu
write('<div class="InnerMenu">');
write(' <div class="Navigation">');
write(' <div class="MenuText">');
write( MoreInfo);
write(' </div>');
write(' <ul>');
// Default text
if(MoreInfo==undefined) MoreInfo="Menu";
// Vlastni menu
write('<div class="InnerMenu">');
write(' <div class="Navigation">');
write(' <div class="MenuText">');
write( MoreInfo);
write(' </div>');
write(' <ul>');
if (DocLang()=="cz")
{ // èeský text
write(' <li> <a href="index.html" title="Domù">MLAB Home</a> </li>');
write(' <li> <a href="AboutAuthors.html" title="O autorech">Autoøi</a> </li>');
write(' <li> <a href="AboutWeb.html" title="O webu">O WEBu</a> </li>');
write(' <li> <a href="ToDoList.html" title="Co jìštì zbývá udìlat">To do list</a> </li>');
write(' </ul>');
write(' </div>');
write('</div> ');
}
else
{ // English text
write(' <li> <a href="index.html" title="Home">MLAB Home</a> </li>');
write(' <li> <a href="AboutAuthors.html" title="About Authors">Authors</a> </li>');
write(' <li> <a href="AboutWeb.html" title="About this WEB">About WEB</a> </li>');
write(' <li> <a href="ToDoList.html" title="What to do">To do list</a> </li>');
}
write(' </ul>');
write(' </div>');
write('</div> ');
}
}
 
61,23 → 104,25
{
with (document)
{
if (0)
{
write('<b>Patièka z JavaScriptu: ', MoreInfo, '</b>');
}
else
{
// Default text je prazdny
if(MoreInfo==undefined) MoreInfo="";
// Vlozeni HTML kodu
write('<div class="InnerFooter">');
write('&nbsp;'); // ústupek IE6 (chyba výpoètu šíøky pøi nenulovém paddingu )
// Default text je prazdny
if(MoreInfo==undefined) MoreInfo="";
// Vlozeni HTML kodu
write('<div class="InnerFooter">');
write('&nbsp;'); // ústupek IE6 (chyba výpoètu šíøky pøi nenulovém paddingu )
if (DocLang()=="cz")
{ // èeský text
write('<a href=#>Nahoru</a> &nbsp; ')
write('<a href="Copyright.html">Copyright</a> &copy; ');
write('<a href="AboutAuthors.html">Autoøi MLAB</a> &nbsp; ');
write('['+document.lastModified+'] &nbsp;&nbsp;&nbsp;');
write(MoreInfo);
write('</div>');
}
else
{ // English text
write('<a href=#>Up</a> &nbsp; ')
write('<a href="Copyright.html">Copyright</a> &copy; ');
write('<a href="AboutAuthors.html">MLAB Authors</a> &nbsp; ');
}
write('['+document.lastModified+'] &nbsp;&nbsp;&nbsp;');
write(MoreInfo);
write('</div>');
}
}