
                // ----------------------------- JavaScript - globalni menu promenne -----------------------------------------------------------------------------------------
                var elmStMnu = null;                                  // ukazatel uchova element hlavniho menu, kvuli relativni pozicich pro zobrazeni ostatnich menu 
                var blnStMnuInit = false;                             // v promenne je hodnota "pripravenosti menu"
                var intStMnuAkt = null;                               // promenna pro uchovavani aktualniho obsazeneho indexu v poli arrStMnuAkt
                var arrStMnuAkt = new Array();                        // pole pro uchovani ukazatalu na jednotlive menu/submenu 
                var intStMnuSel = 20;                                 // urcuje velikost radku v submenu velikost tagu TD 
                var intPageScrollX = 0;
                var intPageScrollY = 0;
                // ----------------------------- JavaScript - globalni menu promenne -----------------------------------------------------------------------------------------
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncGetPosForElement(elmCurr, struct)
                {

                        var intX = 0;
                        var intY = 0;
                        do
                        {
                                intX += elmCurr.offsetLeft;
                                intY += elmCurr.offsetTop;
                        }
                        while (elmCurr = elmCurr.offsetParent);
                        struct.x = intX;
                        struct.y = intY;
                }
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncStMnuInit()                               // funkce/procedura inicializuje elmMenu (tag DIV) hlavniho menu (jde o zjisteni souradnic)
                {                                                   // zacatek funkce 
                        elmStMnu = document.getElementById('stMnuMain');  // zjisti ukazatel na pojmenovany element 
                        var vert = { x: null, y: null };                  // objek urcujici pozice 
                        fncGetPosForElement(elmStMnu, vert);              // objekt napl daty, volej funkci
                        elmStMnu.style.left = vert.x;                     // dosad elementu pozice X
                        elmStMnu.style.top = vert.y;                      // pozice Y
                        blnStMnuInit = true;                              // dosad "pripravenost menu"
                }                                                   // konec funkce 
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
				function fncStMnuGetIdx(elmC)							// funkce vrati cislo (vytahne z ID elementu posledni cislo urcujici poradi)
				{														// zacatek funkce
					var i = elmC.id.length;								// ziskej delku ID / identifikatoru
					var S = elmC.id.substr(i-2, i);						// dosad do retezce toto cislo
					i = S * 1;
					// i = parseInt(S);									// konvertuj retezec na cislo 
					return i;											// vrat cislo / urcujici poradi v menu listu
				}														// konec funkce
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncStMnuSubShow()                            // procedura zobrazi SUB menu (skutecne submenu) dle indexu 
                {                                                   // zacatek fce 
                        var elmCurr = arrStMnuAkt[intStMnuAkt];           // dosad submenu, ktere se ma zobrazit do pomocne promenne 
                        var i = fncStMnuGetIdx(elmCurr);                  // ziskej 

                        // alert(i);

                        elmCurr.style.left = parseInt(arrStMnuAkt[intStMnuAkt-1].style.left) + parseInt(arrStMnuAkt[intStMnuAkt-1].style.width);
                        elmCurr.style.top  = parseInt(arrStMnuAkt[intStMnuAkt-1].style.top) + i * intStMnuSel;                   // i*1 == zvetsuje o jednopixelovy border 
                        elmCurr.style.visibility = '';

                        // elmCurr.style.left = 560;
                        // alert(parseInt(arrStMnuAkt[intStMnuAkt-1].style.left));
                        // alert(parseInt(arrStMnuAkt[intStMnuAkt-1].style.width));

                        var S2 = fncGetAbsHirch(elmCurr.id);                // vrati retezec 
                        var elmStMnuSub = document.getElementById('stMnuTD' + S2);
                        if (elmStMnuSub.style.width == "")
                        {
                                var vert = { x: null, y: null };                                                        // objek urcujici pozice 
                                fncGetPosForElement(elmStMnuSub, vert);
                                // alert(vert.x);
                                elmCurr.style.width = vert.x - (parseInt(arrStMnuAkt[intStMnuAkt-1].style.left) + parseInt(arrStMnuAkt[intStMnuAkt-1].style.width));
                        }
                        if (elmStMnuSub.style.height == "")
                        {
							elmCurr.style.height = elmCurr.getAttribute('ItemsCount') * 1 * intStMnuSel + 0;
                        }
                        
                        // alert(elmCurr.id + '*' + i);

                }

                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncGetAbsHirch(strID)                        // funkce vrati retezec, posledni ciselne hodnoty submenu 
                {
                        var S = strID;                                    // do pomocne promenne dosad 
                        var i = S.length - 1;                             // dosad do pomocne promenne delku identifikatoru 
                        var S2 = '';                                      // inicializuj drouhou pomocnou promennou 
                        while ((S.charCodeAt(i) > 0x2f) && (S.charCodeAt(i) < 0x3a)) {          // ziskej ciselny identifikator z ID tagu TR 
                        
                                S2 = S.charAt(i) + S2;                                              // pridavej cislice do pomocne promenne 
                                i--;                                                                // indexni promenna / "couter" 
                        }                                                                     // konec bloku cyklu while 
                        return S2                                         // navratova hodnota z funkce (ciselny retezec)
                }                                                   // konec funkce 
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncStMnuTRin(elmTR,str)                      // funkce se spusti po prejeti mysitka nad polozkou menu 
                {                                                   // zacatek bloku funkce 
                        if (document.all)
                        {
                                // alert(event.srcElement.tagName);
                                var elmSrc = event.srcElement;
                                while (elmSrc.tagName != 'DIV')               // cykluj dokud nenajdes HTML element (Tag) <DIV>
                                {                                           // slozeny vyraz
                                        elmSrc = elmSrc.parentElement;            // tomuto elementu dej tag jeho rodice
                                        if (elmSrc == null) return;               // jestlize jsme na zacatku hierarchie elementu tak navrat z funkce, nemelo by nastat ale tim si nikdo neni jist :-)
                                }                                           // konec pro while
                                if (elmSrc.Action == false) 
                                {
                                        event.returnValue = 0;
                                        return;
                                }
                        }

                        elmTR.className = 'stMnuItem_';                   // dosad styl bunky TR tagu pri najeti/zvyrazni podklad pouziti nadefinovaneho stylu 
                        var S2 = fncGetAbsHirch(elmTR.id);                // vrati retezec 
                        var elmStMnuSub = document.getElementById('stMnuDiv' + S2);             // ziskej ukazatel na 
                        if  ( (elmStMnuSub != null) 
                              && (elmStMnuSub != arrStMnuAkt[intStMnuAkt])
                              && ((fncGetAbsHirch(elmStMnuSub.id).length) > (fncGetAbsHirch(arrStMnuAkt[intStMnuAkt].id).length))
                            ) // jestlize existuje subMenu A soucasne neni toto submenu aktivnim menu tak / then
                        { 
                                intStMnuAkt++;                                // zvetsi index pro podmenu
                                arrStMnuAkt[intStMnuAkt] = elmStMnuSub;       // dosad ukazatel do pole podmenu
                                fncStMnuSubShow();                            // ukaz aktualni podmenu 
                        }                                               // konec bloku testu if 
                }
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncStMnuTRout(elmTR, str)                     // 
                {
                        elmTR.className = 'stMnuItem';
                }
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncStMnuActive(strSmer)                      // funkce aktivuje hlavni menu (nejblizsi submenu) (vstupuje retezec / identifikatro menu)
                {                                                   // zacatek bloku fce
                        if (blnStMnuInit == false)
                        {
                                // alert('Stránka není ještě celá načtená \nnebo nedošlo k načtení všech částí stránky. \n\nMenu zatím nelze použít.');
                                return;
                        }
                        if (intStMnuAkt == null)                                                        // jestlize zadne "hlavni" submenu neni viditelne pak zobraz pozadovane submenu
                        {                                                                                                       // blok prikazu 
                                var elmCurr = document.getElementById('stMnuDiv' + strSmer);          // zjisti ukazatel na menu 

                                // jestlize neexistuje "hlavni podmenu" ukonci funkci
                                if (elmCurr == null) return;
                        } else 
                        {
							if (intStMnuAkt == 0)
							{
								if ( (strSmer * 1) != fncStMnuGetIdx(arrStMnuAkt[intStMnuAkt]) )
								{
									arrStMnuAkt[intStMnuAkt].style.visibility = 'hidden';
									intStMnuAkt = null;
								}
							}
                            var elmCurr = document.getElementById('stMnuDiv' + strSmer);          // zjisti ukazatel na menu 
                            if (elmCurr == null) return;
						}

                        var intX = null;                                                                        // deklarece pomocne promenne urcujici pozici X menu inicializuj na nulu (tzn menu '00' zobrazit primo pod cast, ktera vyvolala toto menu)
                        switch (parseInt(strSmer))                        // jestlize jde o menu s vetsim indexem posad predpripravene "posunovaci hodnoty" / posun menu oproti pocatku 
                        {
                                case 0:
                                        intX = -10;
                                        break;
                                case 1:
                                        intX = 56;
                                        break;
                                case 2:
                                        intX = 80;
                                        break;
                                case 3:
                                        intX = 150;
                                        break;
                                case 4:
                                        intX = 220;
                                        break;
                                case 5:
                                        intX = 315;
                                        break;
                                default: 
                                        intX = 150;
                        }

                        elmCurr.style.left = parseInt(elmStMnu.style.left) + intX;         // aktivnmu menu dosad souradnici X
                        elmCurr.style.top  = parseInt(elmStMnu.style.top) + 25;            // a souradnici Y + korekce velikosti elmStMnu.style.width;
                        elmCurr.style.visibility = 'visible';                              // zobraz panel s menu 
                        intStMnuAkt = 0;                                                   // inicializuj globalni index ukazatele na menu 
                        arrStMnuAkt[intStMnuAkt] = elmCurr;                                // uchovej tento ukazatel v poli. 

                        // doposud neni zjistena sirka menicka, ucinime tak 
                        if (elmCurr.style.width == "")
                        {
                                var vert = { x: null, y: null };                                                        // objek urcujici pozice 
                                elmStMnuSub = document.getElementById('stMnuTD' + strSmer);
                                fncGetPosForElement(elmStMnuSub, vert);
                                elmCurr.style.width = vert.x - parseInt(elmCurr.style.left);
                                // alert(elmCurr.style.width)
                        }

                        if (elmCurr.style.height == "")
                        {
							elmCurr.style.height = elmCurr.getAttribute('ItemsCount') * 1 * intStMnuSel + 5;
                        }

                }

                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncStMnuSubClear()                           // funkce zrusi zobrazeni menu (at jiz nejblizsiho submenu nebo kterho koliv submenu v hierarchii)
                {                                                   // zacatek bloku funkce 
                    if (intStMnuAkt != null)                          // jestlize je nektere menu viditelne tak 
                      {                                               // slozeny blok 
                        var blnClearYesNo = false;                    // deklaruj promennou urcujici vymazani casti menu na obrazovce, posle stavu v toto promenne se provede akce s timto menu
                        var elmCurr;                                  // pomocna ukazatelova promenna zde nam ponese hodnotu menu / submenu, ktere je rodicem menu o kterem se rozhoduje (je dano indexem intStMnuAkt)
                        var blnOut = false;                           // 
                        var x = window.event.x + intPageScrollX;                       // zjisti x aktualni souradnice mysitka 
                        var y = window.event.y + intPageScrollY;                       // aktualni y misitka 
                        // window.status = window.event.x + '***' + window.event.y;
              
                        // odladeni Xsove souradnice pro vymazani menu 
                        if (intStMnuAkt == 0)                         // jestlize se jedna o hlavni urovnove menu / hlavni submenu tak zjisti zda ma byt aktivni 
                          {
              
                            if ((x < parseInt(arrStMnuAkt[intStMnuAkt].style.left)) || (x > (parseInt(arrStMnuAkt[intStMnuAkt].style.left) + parseInt(arrStMnuAkt[intStMnuAkt].style.width))))
                              blnClearYesNo = true;
                          }
                        else                                          // jinak se jedna o nektere dalsi submenu / dalsich podurovni 
                          {
                            elmCurr = arrStMnuAkt[intStMnuAkt-1];     // dosad rodice submenu 
                            if  (
                                  (x < parseInt(arrStMnuAkt[intStMnuAkt].style.left)) || 
                                  (x > (parseInt(arrStMnuAkt[intStMnuAkt].style.left) + parseInt(arrStMnuAkt[intStMnuAkt].style.width)))
                                )
                              {
                                blnOut = true;
                                if 
                                  (
              
                                    (x < parseInt(elmCurr.style.left)) ||
                                    (x > parseInt(elmCurr.style.left) + parseInt(elmCurr.style.width))
                 
                                  )
                                blnClearYesNo = true;
                              
                              }
                          
                          }
                        
                        // odladeni Y souradnice
                        if (intStMnuAkt == 0)
                          {
                            if ((y < (parseInt(arrStMnuAkt[intStMnuAkt].style.top) - 30)) || (y > (parseInt(arrStMnuAkt[intStMnuAkt].style.top) + parseInt(arrStMnuAkt[intStMnuAkt].style.height))))
                              blnClearYesNo = true;
                          }
                        else
                          {
                            elmCurr = arrStMnuAkt[intStMnuAkt-1];
                            var i = fncStMnuGetIdx(arrStMnuAkt[intStMnuAkt]);                         // dosad hodnotu polozky menu nad kterym se rozhoduje
                            if  ((
                                 (y < (parseInt(arrStMnuAkt[intStMnuAkt].style.top))) || 
                                 (y > (parseInt(arrStMnuAkt[intStMnuAkt].style.top) + parseInt(arrStMnuAkt[intStMnuAkt].style.height)))
                                ) || 
                                (blnOut))
                              {
                              //                  alert('ads');
                                if 
                                  (
              
                                    (y < (parseInt(elmCurr.style.top) + i*intStMnuSel + i*0 + 2)) ||
                                    (y > (parseInt(elmCurr.style.top) + i*intStMnuSel + intStMnuSel))
              
                                  )
                                  {
                                    blnClearYesNo = true;
                                  }
                                
                              }
                                 
                          }
                        
                        if (blnClearYesNo)                                     // jestlize priznak vymazani menu nebo jde o 
                          {
                            if (document.all) 
                              { 
                                arrStMnuAkt[intStMnuAkt].style.visibility = 'hidden';
                                // arrStMnuAkt[intStMnuAkt].Active = false;
                                // fncFadeOut(arrStMnuAkt[intStMnuAkt]);
                              }
                             else 
                              arrStMnuAkt[intStMnuAkt].style.visibility = 'hidden';  // "znezobraz" menu
                            intStMnuAkt ? (intStMnuAkt--) : (intStMnuAkt = null);    // jestlize jde o hlavni (podmenu) dosad null jinak odecti jednicku
                          }
                      }

                }
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                function fncTDClck(intType, strAction)
                {
                        // alert(strAction);
                        location.href = strAction;
                }
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
				function fncScroll()
				{
				if (document.all) intPageScrollY = document.body.scrollTop;
				else
					intPageScrollY = window.pageYOffset;
				}
                // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
                // ----------------------------- JavaScript - volani udalosti ------------------------------------------------------------------------------------------------
                document.onmousemove = fncStMnuSubClear;
                window.onscroll = fncScroll;
                // ----------------------------- JavaScript - volani udalosti ------------------------------------------------------------------------------------------------







