
		// ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
		function fncFadeOut(elmCurr) 
		{
			elmCurr.style.filter="blendTrans(duration=0.5)";
			if (elmCurr.filters.blendTrans.status != 2)
			{
				elmCurr.filters.blendTrans.apply(); 
				elmCurr.style.visibility = 'hidden';
				elmCurr.filters.blendTrans.play(); 
			}
		}



        var maxM = 100;
        var arrStMnuAkt = new Array(maxM);                        // pole pro uchovani ukazatalu na jednotlive menu/submenu 
        var PEAK = -1;
        var sax;
        var say;
        var bytLang = null;
        
        var aEND = false;

		var MOZILLA = false;
		var IE = false;

        function push(elm)
        {

            if (PEAK == maxM) {
                    alert('Internal Error! (0)');
            } else {
                    PEAK ++;
                    arrStMnuAkt[PEAK] = elm;
            }
        }

        function pop()
        {
            elmOUT = null;
            if (PEAK == -1) {
                    alert('Internal Error! (1)');
            } else {
                    elmOUT = arrStMnuAkt[PEAK];
                    if (IE) { fncFadeOut(elmOUT); }
                    arrStMnuAkt[PEAK] = null;
                    PEAK --;
                    elmOUT.style.visibility = 'hidden';
            }

            return elmOUT;

        }


        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 intStMnuSel = 17;                                 // urcuje velikost radku v submenu velikost tagu TD 
        var intStTBorder = 1;
        var intPageScrollX = 0;
        var intPageScrollY = 0;
        var elTABLE = null;


        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;
        }


        function fncStMnuInit()                               // funkce/procedura inicializuje elmMenu (tag DIV) hlavniho menu (jde o zjisteni souradnic)
        {                                                   // zacatek funkce 
			if ((typeof(document.all) == 'undefined') || (document.all == null)) { MOZILLA = true;} else {IE = true;}

            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"

			fncTikInit();

            try
            {
				bytLang = fncCookieRead('LANGUAGE');
			}
			catch (e)
			{
				bytLang = 0;
			}

            // alert(elmStMnu.id);

        }                                                   // konec 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;
                return i;                                                               // vrat cislo / urcujici poradi v menu listu
        }

        // funckce zrusi vsechy aktivni menu
        function fncClearAll()
        {
                for (var i=PEAK; i>-1; i--)
                {
                        pop();
                }
        }

        // ----------------------------- 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;
                }

                fncClearAll();

                var elmCurr = document.getElementById('stMnuDiv' + strSmer);          // zjisti ukazatel na menu 
                // jestlize neexistuje "hlavni podmenu" ukonci funkci 
                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(bytLang))
                        {
							case 0:
									switch (parseInt(strSmer))                        // jestlize jde o menu s vetsim indexem posad predpripravene "posunovaci hodnoty" / posun menu oproti pocatku 
									{
											case 0:
													intX = 0;
													break;
											case 1:
													intX = 65;
													break;
											case 2:
													intX = 80;
													break;
											case 3:
													intX = 150;
													break;
											case 4:
													intX = 275;
													break;
											case 5:
													intX = 360;
													break;
											case 6:
													intX = 400;
													break;
											default: 
													intX = 150;
									}
									break;
							case 1:
									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 = 175;
													break;
											case 4:
													intX = 235;
													break;
											case 5:
													intX = 330;
													break;
											case 6:
													intX = 415;
													break;
											default: 
													intX = 150;
									}
									break;
							case 2:
									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 = 170;
													break;
											case 4:
													intX = 245;
													break;
											case 5:
													intX = 330;
													break;
											case 6:
													intX = 460;
													break;
											default: 
													intX = 150;
									}
									break;
							case 3:
									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 = 195;
													break;
											case 4:
													intX = 295;
													break;
											case 5:
													intX = 385;
													break;
											case 6:
													intX = 470;
													break;
											default: 
													intX = 150;
									}
									break;
		                        
                        }

                fncRenderM(elmCurr, strSmer, parseInt(elmStMnu.style.left) + intX, parseInt(elmStMnu.style.top) + 18);

        }
 
        // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------

		// elmCurr = odkaz na SUBmenu 
		// strSmer = retezec hierarchie 
		// iLEFT = levy roh SUPmenu (souradnice X)
		// iTOP = levy roh SUPmenu (souradnice Y)
        function fncRenderM(elmCurr, strSmer, iLEFT, iTOP)
        {

            // doposud neni zjistena sirka menicka, ucinime tak 
            if (isNaN(parseInt(elmCurr.style.width)))
            {
				var vert = { x: null, y: null };
                elmStMnuSub = document.getElementById('stMnuTD' + strSmer);
                fncGetPosForElement(elmStMnuSub, vert);
                elmCurr.style.width = vert.x - parseInt(elmCurr.style.left) + intStTBorder;
            }

            // totez z vyskou
            if (isNaN(parseInt(elmCurr.style.height)))
            {
                elmCurr.style.height = elmCurr.getAttribute('ItemsCount') * 1 * intStMnuSel + (intStTBorder * 2);
            }

            elmCurr.style.left = iLEFT;
            elmCurr.style.top  = iTOP;
            elmCurr.style.visibility = 'visible';

			push(elmCurr);
        }

        function fncRenderS(elmCurr, strSmer)
        {
                var i = fncStMnuGetIdx(elmCurr);
                var l = parseInt(arrStMnuAkt[PEAK].style.left) + parseInt(arrStMnuAkt[PEAK].style.width) - 5; 
                var t = parseInt(arrStMnuAkt[PEAK].style.top) + i * intStMnuSel + 4;
                fncRenderM(elmCurr, strSmer, l, t);
        }

        // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------

        // ----------------------------- 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 fncTDClck(intType, strAction)
        {
            // alert(strAction);
            if (intType == 0) 
            {
				fncClearAll();
				location.href = strAction;
				document.body.style.cursor = 'wait';
			}
            else
		{

			eval(strAction);
		}

        }
        // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------


        function fncStMnuTRout(elmTR, str, oW)                     // 
        {

			// var layer = event.currentTarget || event.srcElement || event.target;

			aEND = false;
            var elmSrc = elmTR;
            while (elmSrc.tagName != 'TR')              // cykluj dokud nenajdes HTML element (Tag) <DIV>
            {                                           // slozeny vyraz
                    elmSrc = elmSrc.offsetParent;       // 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.tagName != 'TR') return;

            elmSrc.className = elmSrc.className.substr(0, elmSrc.className.length-1);
            // elmSrc.className = 'stMnuItem1_';					// dosad styl bunky TR tagu pri najeti/zvyrazni podklad pouziti nadefinovaneho stylu 

            var S2 = fncGetAbsHirch(elmSrc.id);										// vrati retezec 
            var elmStMnuSub = document.getElementById('stMnuDiv' + S2);             // ziskej ukazatel na podmenu 

            // existuje-li podmenu 
            if (elmStMnuSub != null)
            {
			}
        }

        function fncStMnuTRin(elmTR, str)                      // funkce se spusti po prejeti mysitka nad polozkou menu 
        {                                                   // zacatek bloku funkce 

			// var layer = event.currentTarget || event.srcElement || event.target;

			aEND = false;
            var elmSrc = elmTR;
            while (elmSrc.tagName != 'TR')              // cykluj dokud nenajdes HTML element (Tag) <DIV>
            {                                           // slozeny vyraz
                    elmSrc = elmSrc.offsetParent;       // 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.tagName != 'TR') return;

            elmSrc.className += '_';					// dosad styl bunky TR tagu pri najeti/zvyrazni podklad pouziti nadefinovaneho stylu 

            var S2 = fncGetAbsHirch(elmSrc.id);										// vrati retezec 
            var elmStMnuSub = document.getElementById('stMnuDiv' + S2);             // ziskej ukazatel na podmenu 

            var elmTABLE = document.getElementById('stMnu' + S2.substring(0, S2.length-2));
            elmTABLE = elmTABLE.offsetParent;
            while (elmTABLE.tagName != 'TABLE')             // cykluj dokud nenajdes HTML element (Tag) <DIV>
            {												// slozeny vyraz
                    elmTABLE = elmTABLE.offsetParent;       // tomuto elementu dej tag jeho rodice
                    if (elmTABLE == 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 (elTABLE != null)
            {
				elTABLE.className = 'stMnuT';
			}

			elmTABLE.className = 'stMnuT2';
			elTABLE = elmTABLE;

			var iX = S2.length / 2 - 2;
			while (PEAK > iX)
			{
				pop();
			}

			// if (PEAK > (S2.length / 2 - 2)) pop();

            // existuje-li podmenu 
            if  ((elmStMnuSub != null) && (elmStMnuSub != arrStMnuAkt[PEAK]))
            {
                fncRenderS(elmStMnuSub, S2);
            }

			// alert(elmSrc.id);

       }




        // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
        function fncScroll()
        {
				if ((typeof(document.all) == 'undefined') || (document.all == null))
					intPageScrollY = window.pageYOffset;
                else
                    intPageScrollY = document.body.scrollTop;
                fncClearAll();
        }
        // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------
        // ----------------------------- JavaScript - volani udalosti ------------------------------------------------------------------------------------------------

        if (document.layers)
        {
			document.captureEvents(Event.MOUSEMOVE);
			document.captureEvents(Event.SCROLL);
			document.captureEvents(Event.RESIZE);
		}

        window.onscroll = fncScroll;
        window.onresize = fncStMnuInit;
        document.onmousemove = fncMouseMove;

        function fncMouseMove(oW)
        {
			if (MOZILLA)
			{
				sax = oW.pageX + intPageScrollX;
				say = oW.pageY + intPageScrollY;
			}
			else
			{
				sax = window.event.x + intPageScrollX;                       // zjisti x aktualni souradnice mysitka 
				say = window.event.y + intPageScrollY;                       // aktualni y misitka 
			}
        }


        // ----------------------------- JavaScript - funkce ---------------------------------------------------------------------------------------------------------

        var intTik;
        function fncTikInit()
        {
			intTik = setTimeout("fncTikHandler();", 1000);   // tip po sekunde, zaroven uchovej informaci prozruseni casovace
        }

        function fncTikHandler()
        {
			clearTimeout(intTik);

			if (aEND)
			{
				var blnClearYesNo = false;
				var x = sax;
				var y = say;
	            
				var T1 = false;
				var T2 = false;

				for (var i=PEAK; i>-1 && i>PEAK-2; i--)
				{
				
					blnClearYesNo = false;
				
					// odladeni Xsove souradnice pro vymazani menu 
					if (i == 0)                         // jestlize se jedna o hlavni urovnove menu / hlavni submenu tak zjisti zda ma byt aktivni 
					{
						if ((x < parseInt(arrStMnuAkt[i].style.left)) || (x > (parseInt(arrStMnuAkt[i].style.left) + parseInt(arrStMnuAkt[i].style.width)))) 
						{
							blnClearYesNo = true;
						}
					}
					else                                          // jinak se jedna o nektere dalsi submenu / dalsich podurovni 
					{
						if ((x < parseInt(arrStMnuAkt[i].style.left)) || (x > (parseInt(arrStMnuAkt[i].style.left) + parseInt(arrStMnuAkt[i].style.width)))) 
						{
							blnClearYesNo = true;
						}
					}

					// odladeni Y souradnice
					if (i == 0)
					{
						if ((y < (parseInt(arrStMnuAkt[i].style.top) - 30)) || (y > (parseInt(arrStMnuAkt[i].style.top) + parseInt(arrStMnuAkt[i].style.height))))
						{
							blnClearYesNo = true;
						}
					}
					else
					{
						if ((
								(y < (parseInt(arrStMnuAkt[i].style.top))) ||
								(y > (parseInt(arrStMnuAkt[i].style.top) + parseInt(arrStMnuAkt[i].style.height)))
							) 
							)
						{
							blnClearYesNo = true;
						}
					}
	                
					if (blnClearYesNo)
					{
						if ((PEAK-i) == 0) T2 = true; else T1 = true;
					}
				}

				if 
				(
					((T1 == true) && (T2 == true))
					||
					((PEAK == 0) && (T2 == true))
				)
				{
					fncClearAll();
				}
            }

			aEND = true;
			fncTikInit();
		}
		


		// by Michael




