// JavaScript Document//-------/* Menu rozwijalne */--------------var timer = new Array ();var oMenu = new Array ();var topValue = new Array (); //podczas rozwijania przechowuje wartosc koncowa, w zaleznosci od ilosci subMenuvar offset = 23; //wysokosc jednego przycisku subMenuvar frame;var flag = true;var drugie = false;var menu = function () {   oDivNode = document.getElementById("nav");/* Ustawiamy poczatkowa pozycje subMenu, aby sie poprawnie rozwijalo */   var iloscMenu = oDivNode.childNodes.length ; //ilosc glownych Menu   for (var k = 1; k <= iloscMenu; ++k) {      oMenu = document.getElementById("menu" + (k)); //Pobieramy instancje do konterera wszystkich subMenu      iloscSubMenu = oMenu.childNodes.length; //Pobieramy ilosc subMenu (aby wiedziec o ile ustawic przesuniecie)      oMenu.style.height = (iloscSubMenu * offset) + "px";      topValue[k] = - (((iloscSubMenu) * offset) + 1);            oMenu.style.top =  topValue[k] + "px"; //Aby menu bylo poprawnie ustawione      if (k == 4 || k == 5) {         //alert (oMenu.style.left);         oMenu.style.left = "1px";      }   }   /* Dla IE warstwy kontrolujace film Flash, musza miec tlo, wiec ustawiamy je na przezroczyste */   if (czyIE()) {      for (var k  = 1; k <= iloscMenu; ++k) {         oFlashControl = document.getElementById('cover' + k);         oFlashControl.style.backgroundColor = '#000000';         oFlashControl.style.filter = "alpha(opacity = 0)";               }   }}window.onload = menu;// funkcja uruchamiana po najechaniu na niewidzialna warstwer Cover (steruje filmem FLASH)function playFlash (elem, k, ilosc, e) {   elem.style.cursor = "pointer";      if (!e) var e = window.event;   var oTarget = e.relatedTarget || e.fromElement;        if (oTarget.nodeName != "A" && !czyOpera()) {      document.getElementById('js_to_flash').TStopPlay('item' + k);      document.getElementById('js_to_flash').TGotoLabel('item' + k, 's1');   } else if (oTarget.nodeName != "BODY" && oTarget.nodeName != "#text" && oTarget.nodeName != "A") {      document.getElementById('js_to_flash').TStopPlay('item' + k);      document.getElementById('js_to_flash').TGotoLabel('item' + k, 's1');   }     showMenu(k, ilosc);}// funkcja uruchamiana po najechaniu na niewidzialna warstwer Cover (steruje filmem FLASH)function stopFlash (elem, k, ilosc, e) {   elem.style.cursor = "normal";   if (!e) var e = window.event;   var oTarget = e.relatedTarget || e.toElement;   if (oTarget.nodeName != "A" && !czyOpera()) {      document.getElementById('js_to_flash').TStopPlay('item' + k);      document.getElementById('js_to_flash').TCurrentFrame('item' + k);      document.getElementById('js_to_flash').TGotoLabel ('item' + k, 's2');   } else if (oTarget.nodeName != "BODY" && oTarget.nodeName != "#text" && oTarget.nodeName != "A") {      document.getElementById('js_to_flash').TStopPlay('item' + k);      document.getElementById('js_to_flash').TCurrentFrame('item' + k);      document.getElementById('js_to_flash').TGotoLabel ('item' + k, 's2');   }   hideMenu(k, ilosc);}/* Funkcja uruchamiana w filem FLASH (menu) ustawia niewidzialna warstwe sterujaca na aktywna */function initMenu (num) {//alert("OK");   oCover = document.getElementById ('cover' + num);   oCover.style.display = "block";}function initAllMenu () {   if (czyIE()) {      for (var k = 1; k <= 6; k++) {         oCover = document.getElementById ('cover' + k);         oCover.style.display = "block";            oFlashControl = document.getElementById('cover' + k);         oFlashControl.style.backgroundColor = '#000000';         oFlashControl.style.filter = "alpha(opacity = 0)";      }   }}/* Funkcja rozwija menu */function showMenu (k, ilosc) {   clearInterval (timer[k]);   oMenu[k] = document.getElementById("menu" + k);   oMenu[k].style.visibility = "visible";   var regExp = /[\-]{0,1}\d*/;      timer[k] = setInterval (function () {       if ((h = oMenu[k].style.top.match(regExp)) >= -2) {         clearInterval (timer[k]);      } else {         h = parseInt(h) + 3;                 oMenu[k].style.top = h + "px";      }   }, 10  );}/* Funckcja zwija menu */function hideMenu (k, ilosc) {   clearInterval (timer[k]);   oMenu[k] = document.getElementById("menu" + k);   var regExp = /[\-]{0,1}\d*/;       timer[k] = setInterval (function () {       if ((h = oMenu[k].style.top.match(regExp)) <= topValue[k]) {         clearInterval (timer[k]);         oMenu[k].style.visibility = "hidden";      } else {         h = h - 3;         oMenu[k].style.top = h + "px";      }   }, 10);}function checkShowMenu (k, ilosc, event) {   showMenu (k, ilosc);  }function checkHideMenu (k, ilosc, e) {   if (!e) var e = window.event;   var oTarget = e.relatedTarget || e.toElement;   var regExp = /cover/;   //kiedy przechodzimy miedzy rozwinietym menu, nie odtwrzaj flasha koncowego   if (!(regExp.test(oTarget.id)) && oTarget.nodeName != "A" && oTarget.nodeName != "LI" && !czyOpera()) {      document.getElementById('js_to_flash').TStopPlay('item' + k);      document.getElementById('js_to_flash').TCurrentFrame('item' + k);      document.getElementById('js_to_flash').TGotoLabel ('item' + k, 's2');   } else if (!(regExp.test(oTarget.id)) && oTarget.nodeName != "A" && oTarget.nodeName != "LI" && oTarget.nodeName != "BODY" && oTarget.nodeName != "#text") {      document.getElementById('js_to_flash').TStopPlay('item' + k);      document.getElementById('js_to_flash').TCurrentFrame('item' + k);      document.getElementById('js_to_flash').TGotoLabel ('item' + k, 's2');   }      hideMenu (k, ilosc);}
